diff --git a/00010-add-riscv64-support.patch b/00010-add-riscv64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..690672166711330deffc6feb2c75a12eba628281 --- /dev/null +++ b/00010-add-riscv64-support.patch @@ -0,0 +1,89 @@ +diff -ur kubernetes-1.24.0/hack/lib/golang.sh kubernetes-1.24.0/hack/lib/golang.sh +--- kubernetes-1.24.0/hack/lib/golang.sh 2023-07-20 22:33:41.510603733 +0800 ++++ kubernetes-1.24.0/hack/lib/golang.sh 2023-07-20 22:40:52.327303254 +0800 +@@ -27,6 +27,7 @@ + linux/arm64 + linux/s390x + linux/ppc64le ++ linux/riscv64 + ) + + # The node platforms we build for +@@ -37,6 +38,7 @@ + linux/s390x + linux/ppc64le + windows/amd64 ++ linux/riscv64 + ) + + # If we update this we should also update the set of platforms whose standard +@@ -53,6 +55,7 @@ + windows/amd64 + windows/386 + windows/arm64 ++ linux/riscv64 + ) + + # Which platforms we should compile test targets for. +@@ -67,6 +70,7 @@ + darwin/arm64 + windows/amd64 + windows/arm64 ++ linux/riscv64 + ) + + # The set of server targets that we are only building for Linux +@@ -213,8 +217,8 @@ + + elif [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then + host_arch=$(kube::util::host_arch) +- if [[ "${host_arch}" != "amd64" && "${host_arch}" != "arm64" && "${host_arch}" != "ppc64le" ]]; then +- # on any platform other than amd64, arm64 and ppc64le, we just default to amd64 ++ if [[ "${host_arch}" != "amd64" && "${host_arch}" != "arm64" && "${host_arch}" != "riscv64" && "${host_arch}" != "ppc64le" ]]; then ++ # on any platform other than amd64,riscv64, arm64 and ppc64le, we just default to amd64 + host_arch="amd64" + fi + KUBE_SERVER_PLATFORMS=("linux/${host_arch}") +@@ -434,6 +438,10 @@ + export CGO_ENABLED=1 + export CC=${KUBE_LINUX_S390X_CC:-s390x-linux-gnu-gcc} + ;; ++ "linux/riscv64") ++ export CGO_ENABLED=1 ++ export CC=${KUBE_LINUX_S390X_CC:-riscv64-linux-gnu-gcc} ++ ;; + esac + fi + +diff -ur kubernetes-1.24.0/hack/lib/util.sh kubernetes-1.24.0/hack/lib/util.sh +--- kubernetes-1.24.0/hack/lib/util.sh 2022-05-03 21:36:49.000000000 +0800 ++++ kubernetes-1.24.0/hack/lib/util.sh 2023-07-20 22:38:56.415114479 +0800 +@@ -185,8 +185,11 @@ + ppc64le*) + host_arch=ppc64le + ;; ++ 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, riscv64, s390x or ppc64le." + exit 1 + ;; + esac +diff -ur kubernetes-1.24.0/hack/local-up-cluster.sh kubernetes-1.24.0/hack/local-up-cluster.sh +--- kubernetes-1.24.0/hack/local-up-cluster.sh 2022-05-03 21:36:49.000000000 +0800 ++++ kubernetes-1.24.0/hack/local-up-cluster.sh 2023-07-20 22:42:50.083495031 +0800 +@@ -316,8 +316,11 @@ + 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, riscv64, s390x or ppc64le." >&2 + exit 1 + ;; + esac diff --git a/kubernetes.spec b/kubernetes.spec index e892a12c94298e32590432e0d8cfe68a101d533d..c5155b318e0bcc024dba085f6ea2fb2be2849d6c 100644 --- a/kubernetes.spec +++ b/kubernetes.spec @@ -3,7 +3,7 @@ Name: kubernetes Version: 1.24.0 -Release: 5 +Release: 6 Summary: Container cluster management License: ASL 2.0 URL: https://k8s.io/kubernetes @@ -33,7 +33,9 @@ Patch0006: 0006-Return-error-for-localhost-seccomp-type-with-no-loca.patch Patch0007: 0007-Validate-etcd-paths.patch Patch0008: 0008-fix-node-address-validation.patch Patch0009: 0009-Add-ephemeralcontainer-to-imagepolicy-securityaccoun.patch - +%ifarch riscv64 +Patch00010: 00010-add-riscv64-support.patch +%endif %description Container cluster management. @@ -264,6 +266,9 @@ getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \ %systemd_postun kubelet kube-proxy %changelog +* Thu Jul 20 2023 zhangxiang - 1.24.0-6 +- DESC:add riscv64 support + * Tue Jul 04 2023 zhangxiaoyu - 1.24.0-5 - Type:bugfix - CVE:NA