diff --git a/3000-enable-musl-for-loongarch64.patch b/3000-enable-musl-for-loongarch64.patch new file mode 100644 index 0000000..bad29d0 --- /dev/null +++ b/3000-enable-musl-for-loongarch64.patch @@ -0,0 +1,51 @@ +From 3cda639a6dfc98446dd799a9b44d8080ef62c405 Mon Sep 17 00:00:00 2001 +From: herengui +Date: Fri, 19 May 2023 14:12:53 +0800 +Subject: [PATCH] enable musl for loongarch64 + +Signed-off-by: herengui +--- + 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 + diff --git a/add-kylinsecos-to-supermin-support.patch b/add-kylinsecos-to-supermin-support.patch new file mode 100644 index 0000000..17a4b72 --- /dev/null +++ b/add-kylinsecos-to-supermin-support.patch @@ -0,0 +1,26 @@ +From bbbf9d682017e93de210d8911347626fea93f1f3 Mon Sep 17 00:00:00 2001 +From: yangchenguang +Date: Thu, 4 May 2023 18:04:36 +0800 +Subject: [PATCH] add kylinsecos to supermin support + +Signed-off-by: yangchenguang +--- + 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 + diff --git a/fix-supermin-cannot-detect-kylinsecos.patch b/fix-supermin-cannot-detect-kylinsecos.patch new file mode 100644 index 0000000..8f1e628 --- /dev/null +++ b/fix-supermin-cannot-detect-kylinsecos.patch @@ -0,0 +1,39 @@ +From 3cb595825d136cdce47dd264360780bb405acfba Mon Sep 17 00:00:00 2001 +From: yangchenguang +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 +--- + 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 + diff --git a/supermin.spec b/supermin.spec index bb3ffc5..6bd440b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -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 - 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 - 5.1.19-16 - fix cannot detect package manager on hce