Compare commits
No commits in common. "f7f756e20e33595b4952af19ab94fa0d70af06b6" and "744edd61b57cc6e9ec819b020fa0623892c0c2e9" have entirely different histories.
f7f756e20e
...
744edd61b5
@ -1,34 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
|
||||
|
||||
Name: supermin
|
||||
Version: 5.3.3
|
||||
Release: 8
|
||||
Release: 3
|
||||
Summary: A tool for building supermin appliances, required by libguestfs
|
||||
License: GPLv2+
|
||||
URL: http://libguestfs.org/
|
||||
@ -13,17 +11,8 @@ Patch0002: 0002-use-installed-packages-instead-of-dnf-downloading.patch
|
||||
Patch9001: add-pie-and-bind_now-flags.patch
|
||||
Patch9002: 9002-fix-cannot-detect-package-manager-on-UnionTech.patch
|
||||
Patch0004: 0001-fix-cannot-detect-package-manager-on-NestOS.patch
|
||||
Patch9003: 9003-fix-cannot-detect-package-manager-on-KylinOS.patch
|
||||
%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: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel
|
||||
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
|
||||
@ -55,21 +44,9 @@ This contains man files for the using of supermin.
|
||||
%prep
|
||||
%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
|
||||
%configure --disable-network-tests
|
||||
%ifarch riscv64
|
||||
make -C init CC="musl-gcc"
|
||||
%elifarch loongarch64
|
||||
%make_build
|
||||
%else
|
||||
make -C init CC="diet gcc"
|
||||
%endif
|
||||
%make_build
|
||||
|
||||
%install
|
||||
@ -92,21 +69,6 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%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
|
||||
- Modify release file name due to release package name change
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user