add loongarch64 and sw_64 support,add kylinsecos support

(cherry picked from commit a53b535ec5e2f3d2842011527131edc0ba9502f0)
This commit is contained in:
yeqinglong 2023-08-11 11:33:37 +08:00 committed by openeuler-sync-bot
parent 81c42c88c6
commit 4a7fe573c1
4 changed files with 140 additions and 2 deletions

View File

@ -0,0 +1,51 @@
From 3cda639a6dfc98446dd799a9b44d8080ef62c405 Mon Sep 17 00:00:00 2001
From: herengui <herengui@kylinsec.com.cn>
Date: Fri, 19 May 2023 14:12:53 +0800
Subject: [PATCH] enable musl for loongarch64
Signed-off-by: herengui <herengui@kylinsec.com.cn>
---
Makefile.in | 4 ++--
init/Makefile.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 0ddd63e..4b6592e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -280,7 +280,7 @@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -I/usr/musl/include
COM_ERR_CFLAGS = @COM_ERR_CFLAGS@
COM_ERR_LIBS = @COM_ERR_LIBS@
CPIO = @CPIO@
@@ -681,7 +681,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@ -L/usr/musl/lib
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
LIBINTL = @LIBINTL@
diff --git a/init/Makefile.in b/init/Makefile.in
index e05bd32..e0df0c2 100644
--- a/init/Makefile.in
+++ b/init/Makefile.in
@@ -930,8 +930,8 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
CLEANFILES = *~
init_SOURCES = init.c
-init_CFLAGS = -static
-init_LDFLAGS = -static
+init_CFLAGS = -static -I/usr/musl/include
+init_LDFLAGS = -static -L/usr/musl/lib
all: all-am
.SUFFIXES:
--
2.40.1

View File

@ -0,0 +1,26 @@
From bbbf9d682017e93de210d8911347626fea93f1f3 Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Thu, 4 May 2023 18:04:36 +0800
Subject: [PATCH] add kylinsecos to supermin support
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
src/ph_rpm.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index a6e1eb4..db7818a 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,7 +31,7 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS"; "kylinsecos" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
--
2.33.0

View File

@ -0,0 +1,39 @@
From 3cb595825d136cdce47dd264360780bb405acfba Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Fri, 7 Apr 2023 15:12:31 +0800
Subject: [PATCH] fix(*):fix supermin cannot detect kylinsecos
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加supermin对kylinsec的支持
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
src/ph_rpm.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 8260396..a6e1eb4 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,13 +31,14 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
(stat "/etc/openEuler-release").st_kind = S_REG ||
(stat "/etc/euleros-release").st_kind = S_REG ||
- (stat "/etc/hce-release").st_kind = S_REG
+ (stat "/etc/hce-release").st_kind = S_REG ||
+ (stat "/etc/kylinsec-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =
--
2.33.0

View File

@ -1,8 +1,16 @@
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
# KYLINSEC
%ifarch loongarch64 sw_64
# If a strip is executed on the loongarch64 executable supermin, it will cause the program to deteriorate
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/.*/usr/bin/strip[[:space:]].*$!!g')
# and don't generate debug packages for loongarch64
%global debug_package %{nil}
%endif
# END KYLINSEC
Name: supermin
Version: 5.1.19
Release: 16
Release: 17
Summary: A tool for building supermin appliances, required by libguestfs
License: GPLv2+
URL: http://libguestfs.org/
@ -16,7 +24,14 @@ Patch0004: Expand-directory-when-adding-symlinks.patch
Patch9000: 9000-fix-cannot-detect-package-manager.patch
Patch9001: add-pie-and-bind_now-flags.patch
Patch9002: fix-cannot-detect-package-manager-on-hce.patch
BuildRequires: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel
Patch9003: fix-supermin-cannot-detect-kylinsecos.patch
Patch9004: add-kylinsecos-to-supermin-support.patch
BuildRequires: augeas dnf dnf-plugins-core e2fsprogs-devel
%ifarch loongarch64 sw_64
BuildRequires: glibc-devel
%else
BuildRequires: dietlibc-devel
%endif
BuildRequires: findutils gnupg2 grubby hivex ocaml ocaml-findlib-devel
BuildRequires: rpm rpm-devel systemd-udev tar
BuildRequires: /usr/bin/pod2man /usr/bin/pod2html /usr/sbin/mke2fs
@ -56,7 +71,9 @@ sed -i "N;$num i\ (stat \"/etc/%{vendor}-release\").st_kind = S_REG ||" ./
%build
%configure --disable-network-tests
%ifnarch loongarch64 sw_64
make -C init CC="diet gcc"
%endif
%make_build
%install
@ -79,6 +96,11 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
%{_mandir}/man1/*
%changelog
* Fri Aug 11 2023 yeqinglong <yeqinglong@kylinsec.com.cn> - 5.1.19-17
- add loongarch64 and sw_64 support
- add kylinsec to supermin support
- fix supermin cannot detect kylinsecos
* Tue Nov 15 2022 xu_ping <xuping33@h-partners.com> - 5.1.19-16
- fix cannot detect package manager on hce