From af91ab44e78b524de1f9bce6079f5005b7dc37c9 Mon Sep 17 00:00:00 2001 From: zhangxiang Date: Thu, 27 Jul 2023 16:22:43 +0800 Subject: [PATCH] add riscv64 support --- 0008-add-riscv64-support.patch | 35 ++++++++++++++++++++++++++++++++++ KubeOS.spec | 8 +++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0008-add-riscv64-support.patch diff --git a/0008-add-riscv64-support.patch b/0008-add-riscv64-support.patch new file mode 100644 index 0000000..7c27042 --- /dev/null +++ b/0008-add-riscv64-support.patch @@ -0,0 +1,35 @@ +diff -ur --new-file KubeOS-v1.0.2/Makefile KubeOS-v1.0.2/Makefile +--- KubeOS-v1.0.2/Makefile 2023-07-27 16:16:41.392379717 +0800 ++++ KubeOS-v1.0.2/Makefile 2023-07-27 16:17:41.452508122 +0800 +@@ -32,7 +32,7 @@ + VERSION := $(shell cat $(VERSION_FILE)) + PACKAGE:=openeuler.org/saiyan/pkg/version + BUILDFLAGS = -buildmode=pie -trimpath +-LDFLAGS = -w -s -buildid=IdByKubeOS -linkmode=external -extldflags=-static -extldflags=-zrelro -extldflags=-Wl,-z,now -X ${PACKAGE}.Version=${VERSION} ++LDFLAGS = -w -s -buildid=IdByKubeOS -linkmode=external -extldflags=-zrelro -extldflags=-Wl,-z,now -X ${PACKAGE}.Version=${VERSION} + ENV = CGO_CFLAGS="-fstack-protector-all" CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -O2" + + all: proxy operator agent +diff -ur --new-file KubeOS-v1.0.2/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go KubeOS-v1.0.2/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go +--- KubeOS-v1.0.2/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go 1970-01-01 08:00:00.000000000 +0800 ++++ KubeOS-v1.0.2/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go 2023-07-27 16:19:31.620743657 +0800 +@@ -0,0 +1,19 @@ ++// Copyright 2020 The Prometheus Authors ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++// +build linux ++// +build riscv riscv64 ++ ++package procfs ++ ++var parseCPUInfo = parseCPUInfoRISCV diff --git a/KubeOS.spec b/KubeOS.spec index 6f50813..b8b6fcd 100644 --- a/KubeOS.spec +++ b/KubeOS.spec @@ -2,7 +2,7 @@ Name: KubeOS Version: 1.0.2 -Release: 8 +Release: 9 Summary: O&M platform used to update the whole OS as an entirety License: Mulan PSL v2 Source0: https://gitee.com/openeuler/KubeOS/repository/archive/v%{version}.tar.gz @@ -13,6 +13,9 @@ Patch4: 0004-KubeOS-add-the-clearing-of-space-before-the-upgrade-.patch Patch5: 0005-KubeOS-add-the-configuration-of-etc-resolv.conf-and-.patch Patch6: 0006-KubeOS-remove-grub2-legacy-install-add-error-handlin.patch Patch7: 0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch +%ifarch riscv64 +Patch8: 0008-add-riscv64-support.patch +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: make BuildRequires: golang >= 1.13 @@ -113,6 +116,9 @@ install -p -m 0600 ./files/os-release %{buildroot}/opt/kubeOS/files rm -rfv %{buildroot} %changelog +* Mon Jul 17 2023 zhangxiang - 1.0.2-9 +- add riscv64 support + * Thu Dec 08 2022 liyuanrong - 1.0.2-8 - Type:requirement - CVE:NA -- Gitee