From f1323d735fde554cd2b3e4ccb3815a283b0aec7d Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Sat, 20 Apr 2024 15:09:40 +0000 Subject: [PATCH] Fix and Apply riscv64 Support Patch to v1.29.1 Signed-off-by: Ruoqing He --- ...ply-riscv64-Support-Patch-to-v1.29.1.patch | 69 +++++++------------ kubernetes.spec | 10 ++- 2 files changed, 35 insertions(+), 44 deletions(-) rename 1000-add-riscv-support.patch => 1000-Fix-and-Apply-riscv64-Support-Patch-to-v1.29.1.patch (75%) diff --git a/1000-add-riscv-support.patch b/1000-Fix-and-Apply-riscv64-Support-Patch-to-v1.29.1.patch similarity index 75% rename from 1000-add-riscv-support.patch rename to 1000-Fix-and-Apply-riscv64-Support-Patch-to-v1.29.1.patch index 8e2ff70..3c8e370 100644 --- a/1000-add-riscv-support.patch +++ b/1000-Fix-and-Apply-riscv64-Support-Patch-to-v1.29.1.patch @@ -1,23 +1,23 @@ -From 20db0e90fdfb804c5639964c54df4854771d92f7 Mon Sep 17 00:00:00 2001 -From: misaka00251 -Date: Mon, 25 Sep 2023 10:49:49 +0800 -Subject: [PATCH] Add riscv64 support +From d483a2043ea0d574e4753f3ac6d2e97dd7a54c8b Mon Sep 17 00:00:00 2001 +From: Ruoqing He +Date: Sat, 20 Apr 2024 14:44:10 +0000 +Subject: [PATCH 1/1] Fix and Apply riscv64 Support Patch to v1.29.1 +Signed-off-by: Ruoqing He --- build/pause/Makefile | 3 ++- cluster/get-kube-binaries.sh | 5 ++++- cluster/images/etcd/Makefile | 5 ++++- hack/lib/golang.sh | 12 ++++++++++-- hack/lib/util.sh | 5 ++++- - hack/local-up-cluster.sh | 5 ++++- test/images/image-util.sh | 2 +- - 7 files changed, 29 insertions(+), 8 deletions(-) + 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/build/pause/Makefile b/build/pause/Makefile -index 256a9fd1..ac01e882 100644 +index 1c49bf2f..de27a9f2 100644 --- a/build/pause/Makefile +++ b/build/pause/Makefile -@@ -32,7 +32,7 @@ OSVERSION ?= 1809 20H2 ltsc2022 +@@ -32,7 +32,7 @@ OSVERSION ?= 1809 ltsc2022 OUTPUT_TYPE ?= docker ALL_OS = linux windows @@ -25,7 +25,7 @@ index 256a9fd1..ac01e882 100644 +ALL_ARCH.linux = amd64 arm arm64 ppc64le s390x riscv64 ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ALL_ARCH.windows = amd64 - ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022 + ALL_OSVERSIONS.windows := 1809 ltsc2022 @@ -66,6 +66,7 @@ TRIPLE.linux-arm := arm-linux-gnueabihf TRIPLE.linux-arm64 := aarch64-linux-gnu TRIPLE.linux-ppc64le := powerpc64le-linux-gnu @@ -35,7 +35,7 @@ index 256a9fd1..ac01e882 100644 BASE.linux := scratch # Source for windows pause image base is located at https://github.com/microsoft/windows-pause-image-base diff --git a/cluster/get-kube-binaries.sh b/cluster/get-kube-binaries.sh -index 589a335f..81dc0a1c 100755 +index 13b916fd..e81e30a2 100755 --- a/cluster/get-kube-binaries.sh +++ b/cluster/get-kube-binaries.sh @@ -120,9 +120,12 @@ function detect_client_info() { @@ -53,7 +53,7 @@ index 589a335f..81dc0a1c 100755 exit 3 ;; diff --git a/cluster/images/etcd/Makefile b/cluster/images/etcd/Makefile -index 5543cc61..cde77f89 100644 +index 85e3737a..c9ae52e0 100644 --- a/cluster/images/etcd/Makefile +++ b/cluster/images/etcd/Makefile @@ -51,7 +51,7 @@ OSVERSION ?= 1809 @@ -64,19 +64,19 @@ index 5543cc61..cde77f89 100644 +ALL_ARCH.linux = amd64 arm arm64 ppc64le s390x riscv64 ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ALL_ARCH.windows = amd64 - ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022 + ALL_OSVERSIONS.windows := 1809 ltsc2022 @@ -106,6 +106,9 @@ endif ifeq ($(ARCH),s390x) - BASEIMAGE?=registry.k8s.io/build-image/debian-base-s390x:bullseye-v1.3.0 + BASEIMAGE?=registry.k8s.io/build-image/debian-base-s390x:bookworm-v1.0.0 endif +ifeq ($(ARCH),riscv64) -+ BASEIMAGE?=registry.k8s.io/build-image/debian-base-riscv64:bullseye-v1.3.0 ++ BASEIMAGE?=registry.k8s.io/build-image/debian-base-riscv64:bookworm-v1.0.0 +endif BASE.windows = mcr.microsoft.com/windows/nanoserver diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh -index c6cbce44..ccdb753e 100755 +index f3466ff7..01b6fa69 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -27,6 +27,7 @@ readonly KUBE_SUPPORTED_SERVER_PLATFORMS=( @@ -87,7 +87,7 @@ index c6cbce44..ccdb753e 100755 ) # The node platforms we build for -@@ -36,6 +37,7 @@ readonly KUBE_SUPPORTED_NODE_PLATFORMS=( +@@ -35,6 +36,7 @@ readonly KUBE_SUPPORTED_NODE_PLATFORMS=( linux/arm64 linux/s390x linux/ppc64le @@ -95,7 +95,7 @@ index c6cbce44..ccdb753e 100755 windows/amd64 ) -@@ -48,6 +50,7 @@ readonly KUBE_SUPPORTED_CLIENT_PLATFORMS=( +@@ -47,6 +49,7 @@ readonly KUBE_SUPPORTED_CLIENT_PLATFORMS=( linux/arm64 linux/s390x linux/ppc64le @@ -103,7 +103,7 @@ index c6cbce44..ccdb753e 100755 darwin/amd64 darwin/arm64 windows/amd64 -@@ -63,6 +66,7 @@ readonly KUBE_SUPPORTED_TEST_PLATFORMS=( +@@ -61,6 +64,7 @@ readonly KUBE_SUPPORTED_TEST_PLATFORMS=( linux/arm64 linux/s390x linux/ppc64le @@ -111,7 +111,7 @@ index c6cbce44..ccdb753e 100755 darwin/amd64 darwin/arm64 windows/amd64 -@@ -213,8 +217,8 @@ kube::golang::setup_platforms() { +@@ -210,8 +214,8 @@ kube::golang::setup_platforms() { elif [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then host_arch=$(kube::util::host_arch) @@ -122,7 +122,7 @@ index c6cbce44..ccdb753e 100755 host_arch="amd64" fi KUBE_SERVER_PLATFORMS=("linux/${host_arch}") -@@ -444,6 +448,10 @@ kube::golang::set_platform_envs() { +@@ -435,6 +439,10 @@ kube::golang::set_platform_envs() { export CGO_ENABLED=1 export CC=${KUBE_LINUX_S390X_CC:-s390x-linux-gnu-gcc} ;; @@ -134,7 +134,7 @@ index c6cbce44..ccdb753e 100755 fi diff --git a/hack/lib/util.sh b/hack/lib/util.sh -index 67454132..d0b3d3ed 100755 +index 70568f76..e73af96d 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -185,8 +185,11 @@ kube::util::host_arch() { @@ -143,32 +143,15 @@ index 67454132..d0b3d3ed 100755 ;; + riscv64*) + host_arch=riscv64 -+ ;; ++ ;; *) - kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le." -+ kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x, ppc64le or riscv64." ++ kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x, ppc64le and riscv64." exit 1 ;; esac -diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh -index 0a49b296..6c909be0 100755 ---- a/hack/local-up-cluster.sh -+++ b/hack/local-up-cluster.sh -@@ -316,8 +316,11 @@ function detect_binary { - ppc64le*) - host_arch=ppc64le - ;; -+ riscv64*) -+ host_arch=riscv64 -+ ;; - *) -- echo "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le." >&2 -+ echo "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x, ppc64le or riscv64." >&2 - exit 1 - ;; - esac diff --git a/test/images/image-util.sh b/test/images/image-util.sh -index 2b211868..5d6b91a4 100755 +index 9b729b34..b010f4ed 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -34,7 +34,7 @@ source "${KUBE_ROOT}/hack/lib/logging.sh" @@ -176,10 +159,10 @@ index 2b211868..5d6b91a4 100755 # Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project -declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" ) -+declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" ["riscv64"]="riscv64") ++declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" ["riscv64"]="riscv64" ) # NOTE(claudiub): In the test image build jobs, this script is not being run in a git repository, # which would cause git log to fail. Instead, we can use the GIT_COMMIT_ID set in cloudbuild.yaml. -- -2.39.3 (Apple Git-145) +2.43.0 diff --git a/kubernetes.spec b/kubernetes.spec index 47d49ee..44488bc 100644 --- a/kubernetes.spec +++ b/kubernetes.spec @@ -3,7 +3,7 @@ Name: kubernetes Version: 1.29.1 -Release: 5 +Release: 6 Summary: Container cluster management License: ASL 2.0 URL: https://k8s.io/kubernetes @@ -27,7 +27,12 @@ Source15: kubernetes.conf Patch0001: 0001-fix-compile-options.patch Patch0002: 0002-kubelet-support-exec-and-attach-websocket-protocol.patch Patch0003: 0003-Add-envFrom-to-serviceaccount-admission-plugin.patch +%ifarch riscv64 +Patch1000: 1000-Fix-and-Apply-riscv64-Support-Patch-to-v1.29.1.patch +%endif +%ifarch loong64 Patch1001: 1001-Add-loong64-host-build-support.patch +%endif %description Container cluster management. @@ -266,6 +271,9 @@ getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \ %systemd_postun kubelet kube-proxy %changelog +* Thu Jul 04 2024 heruoqing - 1.29.1-6 +- DESC:fix and apply riscv64 support patch + * Fri Jun 14 2024 wangweijie - 1.29.1-5 - DESC:add loong64 host build support -- Gitee