Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f7f756e20e
!64 [sync] PR-61: fix sw_64 build error
From: @openeuler-sync-bot 
Reviewed-by: @cherry530 
Signed-off-by: @cherry530
2025-03-21 02:05:23 +00:00
Hailiang
c542d83b29 fix sw_64 build error
(cherry picked from commit b79dc786c4ab8c0c375912b0af4057b4c6bdfa40)
2025-03-21 10:04:20 +08:00
openeuler-ci-bot
78b1688b3b
!58 手工同步PR,支持下游版本使用自定义vendor提高软件包兼容性
From: @xiaochn 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2025-01-20 09:12:48 +00:00
xiaochuannan
1b9629c8f1 Replace openEuler with vendor 2024-12-10 17:08:32 +08:00
openeuler-ci-bot
b6425a85a6
!49 loongarch64: use glibc instead of unsupported dietlibc
From: @zhangwenlong01 
Reviewed-by: @Lostwayzxc 
Signed-off-by: @Lostwayzxc
2024-07-01 06:20:22 +00:00
Wenlong Zhang
afda70d0cd loongarch64: use glibc instead of unsupported dietlibc 2024-07-01 11:07:35 +08:00
openeuler-ci-bot
f93b5cba63
!44 fix cannot detect package manager on KylinOS
From: @yue-yuankun 
Reviewed-by: @duyiwei7w, @Charlie_li 
Signed-off-by: @Charlie_li
2024-05-20 09:29:28 +00:00
yueyuankun
d241de567d fix cannot detect package manager on KylinOS 2024-04-29 17:26:52 +08:00
openeuler-ci-bot
db27639f62
!45 riscv64: 用musl替换不支持的dietlibc
From: @laokz 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2024-04-29 02:39:06 +00:00
laokz
12e405ed6e riscv64: use musl instead of unsupported dietlibc 2024-04-22 16:34:22 +08:00
4 changed files with 183 additions and 3 deletions

View File

@ -0,0 +1,34 @@
From 3186a6bc327687fa1d1a941fe631d22788aac570 Mon Sep 17 00:00:00 2001
From: yueyuankun <yueyuankun@kylinos.cn>
Date: Wed, 17 Apr 2024 15:41:17 +0800
Subject: [PATCH] fix cannot detect package manager on KylinOS
---
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 1e16bbe..c232bff 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -32,14 +32,15 @@ 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"; "anolis"; "uos"; "nestos" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "anolis"; "uos"; "nestos" ; "kylin" ] ||
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/UnionTech-release").st_kind = S_REG ||
(stat "/etc/anolis-release").st_kind = S_REG ||
- (stat "/etc/openEuler-release-nestos-for-virt").st_kind = S_REG
+ (stat "/etc/openEuler-release-nestos-for-virt").st_kind = S_REG ||
+ (stat "/etc/kylin-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =
--
2.33.0

View File

@ -0,0 +1,36 @@
From 9a0d078dc35fde7a715666bce6c765ed5fe5e916 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 10 Nov 2023 08:55:25 +0000
Subject: [PATCH 12/13] src/format_ext2_kernel.ml: Rename function file ->
kernel
No change, just rename the function.
---
src/format_ext2_kernel.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index 4589552..36514c6 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -54,7 +54,7 @@ let rec build_kernel debug host_cpu copy_kernel kernel =
printf "supermin: kernel: modpath %s\n%!" modpath;
);
- copy_or_symlink_file copy_kernel kernel_file kernel;
+ copy_or_symlink_kernel copy_kernel kernel_file kernel;
(kernel_version, modpath)
@@ -308,7 +308,7 @@ and read_string chan offset len =
really_input chan buf 0 len;
Bytes.to_string buf
-and copy_or_symlink_file copy_kernel src dest =
+and copy_or_symlink_kernel copy_kernel src dest =
if not copy_kernel then
symlink src dest
else (
--
2.42.0

View File

@ -0,0 +1,72 @@
From 5230e2c3cd07e82bd6431e871e239f7056bf25ad Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 10 Nov 2023 10:20:49 +0000
Subject: [PATCH 13/13] src: Uncompress kernel on RISC-V
---
src/format_ext2_kernel.ml | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index 36514c6..09a3f21 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -25,6 +25,20 @@ open Ext2fs
open Fnmatch
open Glob
+(* Similar but not the same as get_file_type in mode_build. There
+ * is a case for deriving a common base utility. XXX
+ *)
+type compression_type = GZip | Uncompressed
+let get_compression_type file =
+ let chan = open_in file in
+ let buf = Bytes.create 512 in
+ let len = input chan buf 0 (Bytes.length buf) in
+ close_in chan;
+ let buf = Bytes.to_string buf in
+ if len >= 3 && buf.[0] = '\x1f' && buf.[1] = '\x8b' && buf.[2] = '\x08'
+ then GZip
+ else Uncompressed (* or other unknown compression type *)
+
let rec build_kernel debug host_cpu copy_kernel kernel =
(* Locate the kernel.
* SUPERMIN_* environment variables override everything. If those
@@ -54,7 +68,19 @@ let rec build_kernel debug host_cpu copy_kernel kernel =
printf "supermin: kernel: modpath %s\n%!" modpath;
);
- copy_or_symlink_kernel copy_kernel kernel_file kernel;
+ (* RISC-V relies on the bootloader or firmware to uncompress the
+ * kernel and doesn't have a concept of self-extracting kernels.
+ * On Arm which is similar, qemu -kernel will automatically uncompress
+ * the kernel, but qemu-system-riscv won't do that and the code is a
+ * big mess so I don't fancy fixing it. So we have to detect that
+ * case here and uncompress the kernel.
+ *)
+ let kernel_compression_type = get_compression_type kernel_file in
+ if string_prefix "riscv" host_cpu && kernel_compression_type <> Uncompressed
+ then
+ copy_and_uncompress_kernel kernel_compression_type kernel_file kernel
+ else
+ copy_or_symlink_kernel copy_kernel kernel_file kernel;
(kernel_version, modpath)
@@ -308,6 +334,13 @@ and read_string chan offset len =
really_input chan buf 0 len;
Bytes.to_string buf
+and copy_and_uncompress_kernel compression_type src dest =
+ let cmd =
+ match compression_type with
+ | GZip -> sprintf "zcat %s > %s" (quote src) (quote dest)
+ | Uncompressed -> sprintf "cp %s %s" (quote src) (quote dest) in
+ run_command cmd
+
and copy_or_symlink_kernel copy_kernel src dest =
if not copy_kernel then
symlink src dest
--
2.42.0

View File

@ -1,6 +1,8 @@
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
Name: supermin Name: supermin
Version: 5.3.3 Version: 5.3.3
Release: 3 Release: 8
Summary: A tool for building supermin appliances, required by libguestfs Summary: A tool for building supermin appliances, required by libguestfs
License: GPLv2+ License: GPLv2+
URL: http://libguestfs.org/ URL: http://libguestfs.org/
@ -11,8 +13,17 @@ Patch0002: 0002-use-installed-packages-instead-of-dnf-downloading.patch
Patch9001: add-pie-and-bind_now-flags.patch Patch9001: add-pie-and-bind_now-flags.patch
Patch9002: 9002-fix-cannot-detect-package-manager-on-UnionTech.patch Patch9002: 9002-fix-cannot-detect-package-manager-on-UnionTech.patch
Patch0004: 0001-fix-cannot-detect-package-manager-on-NestOS.patch Patch0004: 0001-fix-cannot-detect-package-manager-on-NestOS.patch
Patch9003: 9003-fix-cannot-detect-package-manager-on-KylinOS.patch
BuildRequires: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel %ifarch riscv64
Patch9100: 9100-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch
Patch9101: 9101-src-Uncompress-kernel-on-RISC-V.patch
BuildRequires: musl-gcc musl-libc-static
%elifarch loongarch64 sw_64
BuildRequires: glibc-static
%else
BuildRequires: dietlibc-devel
%endif
BuildRequires: augeas dnf dnf-plugins-core e2fsprogs-devel
BuildRequires: findutils gnupg2 grubby hivex ocaml ocaml-findlib-devel BuildRequires: findutils gnupg2 grubby hivex ocaml ocaml-findlib-devel
BuildRequires: rpm rpm-devel systemd-udev tar BuildRequires: rpm rpm-devel systemd-udev tar
BuildRequires: /usr/bin/pod2man /usr/bin/pod2html /usr/sbin/mke2fs BuildRequires: /usr/bin/pod2man /usr/bin/pod2html /usr/sbin/mke2fs
@ -44,9 +55,21 @@ This contains man files for the using of supermin.
%prep %prep
%autosetup -p1 %autosetup -p1
%if "%{vendor}" != "openEuler"
sed -i 's/; "openEuler"/&; "%{vendor}"/' ./src/ph_rpm.ml
num=$(grep -n "etc/openEuler-release" ./src/ph_rpm.ml |awk -F ":" '{printf $1}')
sed -i "N;$num i\ (stat \"/etc/%{vendor}-release\").st_kind = S_REG ||" ./src/ph_rpm.ml
%endif
%build %build
%configure --disable-network-tests %configure --disable-network-tests
%ifarch riscv64
make -C init CC="musl-gcc"
%elifarch loongarch64
%make_build
%else
make -C init CC="diet gcc" make -C init CC="diet gcc"
%endif
%make_build %make_build
%install %install
@ -69,6 +92,21 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
%{_mandir}/man1/* %{_mandir}/man1/*
%changelog %changelog
* Tue Mar 18 2025 mahailiang <mahailiang@uniontech.com> - 5.3.3-8
- fix sw_64 build error
* Tue Dec 10 2024 xiaochn <xiaochuannan@inspur.com> - 5.3.3-7
- Replace openEuler with vendor
* Thu Jun 27 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 5.3.3-6
- loongarch64: use glibc instead of unsupported dietlibc
* Mon Apr 22 2024 yueyuankun <yueyuankun@kylinos.cn> - 5.3.3-5
- fix cannot detect package manager on KylinOS
* Mon Apr 22 2024 laokz <zhangkai@iscas.ac.cn> - 5.3.3-4
- riscv64: use musl instead of unsupported dietlibc
* Thu Nov 30 2023 chendexi <chendexi@kylinos.cn> - 5.3.3-3 * Thu Nov 30 2023 chendexi <chendexi@kylinos.cn> - 5.3.3-3
- Modify release file name due to release package name change - Modify release file name due to release package name change