From 554017ba9dbc901c694c6663a55a6a4291f206db Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Nov 2016 12:44:41 +0000 Subject: [PATCH 01/95] Remove Provides/Obsoletes. --- supermin.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index 96cecf4..d1fdc5e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -93,12 +93,6 @@ Requires: /usr/sbin/mke2fs Requires: e2fsprogs-libs >= 1.42 Requires: findutils -# supermin-helper subpackage is no longer separate (since Fedora 21). -# A single binary (supermin) provides both features. -# Remove this in Fedora 23. -Provides: supermin-helper = %{version}-%{release} -Obsoletes: supermin-helper < 4.1.6-3 - # For automatic RPM dependency generation. # See: http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator Source3: supermin.attr From 33fd119de655e858f86bbcf69a62e057f90fd9d9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 5 Nov 2016 09:50:28 +0000 Subject: [PATCH 02/95] Rebuild for OCaml 4.04.0. --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index d1fdc5e..ca73ed7 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.17 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -172,6 +172,9 @@ make check || { %changelog +* Sat Nov 05 2016 Richard W.M. Jones - 5.1.17-2 +- Rebuild for OCaml 4.04.0. + * Tue Nov 01 2016 Richard W.M. Jones - 5.1.17-1 - New upstream release 5.1.17. - Check signature on the tarball before unpacking it. From c4b0ee62f444401c83f3cdfec31c7e0240ca1302 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 14:14:35 +0000 Subject: [PATCH 03/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index ca73ed7..e49089d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.17 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -172,6 +172,9 @@ make check || { %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 5.1.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Sat Nov 05 2016 Richard W.M. Jones - 5.1.17-2 - Rebuild for OCaml 4.04.0. From f5ad0a15f0d602f9ad6355ee0ad8feaa82778847 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 17 Mar 2017 13:30:25 +0000 Subject: [PATCH 04/95] Drop dependency on hawkey and versioned dependencies on dnf. These were introduced by commit 48b7c2f9a8b2f220b4adb38a3a41b07700bb6082. Hawkey is now a dead package (replaced by libdnf). In any case none of the dependencies are now required because the change from yumdownloader to dnf download was introduced in Fedora 23, which is greater than two Fedora versions ago. --- supermin.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/supermin.spec b/supermin.spec index e49089d..ebf8de5 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.17 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -53,9 +53,8 @@ BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm BuildRequires: rpm-devel -BuildRequires: dnf >= 0.6.5-1.fc23 -BuildRequires: dnf-plugins-core >= 0.1.7-1.fc23 -BuildRequires: hawkey >= 0.5.4-1.fc23 +BuildRequires: dnf +BuildRequires: dnf-plugins-core BuildRequires: /usr/sbin/mke2fs BuildRequires: e2fsprogs-devel BuildRequires: findutils @@ -82,9 +81,8 @@ BuildRequires: grubby BuildRequires: systemd-udev Requires: rpm -Requires: dnf >= 0.6.5-1.fc23 -Requires: dnf-plugins-core >= 0.1.7-1.fc23 -Requires: hawkey >= 0.5.4-1.fc23 +Requires: dnf +Requires: dnf-plugins-core Requires: util-linux-ng Requires: cpio Requires: tar @@ -172,6 +170,9 @@ make check || { %changelog +* Fri Mar 17 2017 Richard W.M. Jones - 5.1.17-4 +- Drop dependency on hawkey and versioned dependencies on dnf. + * Sat Feb 11 2017 Fedora Release Engineering - 5.1.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 3c79fab8c61687ae8615916f16501d5f176af23d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 18 Mar 2017 13:08:01 -0400 Subject: [PATCH 05/95] Enable dietlibc on aarch64 and POWER. --- supermin.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/supermin.spec b/supermin.spec index ebf8de5..fd202d1 100644 --- a/supermin.spec +++ b/supermin.spec @@ -8,7 +8,7 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=1204162 %undefine _hardened_build -# On armv7 and x86, the default is ``--with dietlibc''. +# On architectures that support it, the default is ``--with dietlibc''. # # To use glibc-static instead, do ``--without dietlibc''. This # results in a much larger (about 40 times larger) init binary. @@ -19,7 +19,7 @@ # See also: # https://github.com/libguestfs/supermin/commit/9bb57e1a8d0f3b57eb09f65dd574f702b67e1c2f -%ifarch %{arm} %{ix86} x86_64 s390x +%ifarch aarch64 %{arm} %{ix86} %{power} s390x x86_64 %bcond_without dietlibc %else %bcond_with dietlibc @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.17 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Sat Mar 18 2017 Richard W.M. Jones - 5.1.17-5 +- Enable dietlibc on aarch64 and POWER. + * Fri Mar 17 2017 Richard W.M. Jones - 5.1.17-4 - Drop dependency on hawkey and versioned dependencies on dnf. From 1fda32218d82ab289ce471020ec3add961c85fb8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 13 Jul 2017 11:44:52 +0100 Subject: [PATCH 06/95] New upstream release 5.1.18. Fixes problem with creating incorrect symlinks (RHBZ#1470157). --- .gitignore | 1 + sources | 4 ++-- supermin.spec | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b897074..c4345c0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /supermin-*.tar.gz /x86_64 /supermin-5.1.17.tar.gz.sig +/supermin-5.1.18.tar.gz.sig diff --git a/sources b/sources index e387417..d59c5b9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -af1e287e5d2b335e2df83a836f1d8ed4 supermin-5.1.17.tar.gz -a94c40d6ff5d12dd7d096a482525009e supermin-5.1.17.tar.gz.sig +SHA512 (supermin-5.1.18.tar.gz) = 5e2d1a86359fd334ba6cfea3bd15c7f4d8ee8ec57db55b191e438bd9e1d22e4c317c7e421966abae4f2409e1c6c2b81c3eef5110e823fefc1102a12c79e15c35 +SHA512 (supermin-5.1.18.tar.gz.sig) = 16adab798fcac6e44318c9ffa08a7096b84eda14f13e1febdbdb7dbbea14594a3fb60d9ca2cfb2c9a723a78dd2cddf972f60bde004d90e167acdadaa2b55cc74 diff --git a/supermin.spec b/supermin.spec index fd202d1..a6394bf 100644 --- a/supermin.spec +++ b/supermin.spec @@ -30,8 +30,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.1.17 -Release: 5%{?dist} +Version: 5.1.18 +Release: 1%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,10 @@ make check || { %changelog +* Thu Jul 13 2017 Richard W.M. Jones - 5.1.18-1 +- New upstream release 5.1.18. +- Fixes problem with creating incorrect symlinks (RHBZ#1470157). + * Sat Mar 18 2017 Richard W.M. Jones - 5.1.17-5 - Enable dietlibc on aarch64 and POWER. From ce7226a30f4a453abfcc3a24f9caa998f643ab04 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 19:38:56 +0000 Subject: [PATCH 07/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index a6394bf..7500a6f 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.18 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 5.1.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Thu Jul 13 2017 Richard W.M. Jones - 5.1.18-1 - New upstream release 5.1.18. - Fixes problem with creating incorrect symlinks (RHBZ#1470157). From 2e7b101d9a45c18419c88d479c4f0a0684a26f6c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 08:59:03 +0000 Subject: [PATCH 08/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 7500a6f..b3892ab 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.18 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 5.1.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 5.1.18-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 36f5331e316186f8b5e80367c37f07ee50337355 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Aug 2017 17:30:13 +0100 Subject: [PATCH 09/95] Fix supermin crash with truncated vmlinuz file (RHBZ#1477758). - Include all upstream patches since 5.1.18. --- ...-debugging-of-config-files-creating-.patch | 38 ++++ ...efactor-code-for-locating-the-kernel.patch | 178 ++++++++++++++++++ 0003-kernel-Tweak-debug-messages.patch | 110 +++++++++++ ...nel-Rearrange-the-order-of-functions.patch | 90 +++++++++ ...boot-kernels-using-has_modpath-later.patch | 60 ++++++ ...s_modpath-function-so-it-checks-for-.patch | 42 +++++ ...ow-kernel-version-information-is-fou.patch | 150 +++++++++++++++ ...ow-End_of_file-exception-to-escape-i.patch | 35 ++++ ...naming-to-make-find_kernel_from_-fun.patch | 33 ++++ ...plausibly-small-kernels-in-lib-modul.patch | 45 +++++ supermin.spec | 19 +- 11 files changed, 799 insertions(+), 1 deletion(-) create mode 100644 0001-prepare-Add-some-debugging-of-config-files-creating-.patch create mode 100644 0002-kernel-Refactor-code-for-locating-the-kernel.patch create mode 100644 0003-kernel-Tweak-debug-messages.patch create mode 100644 0004-kernel-Rearrange-the-order-of-functions.patch create mode 100644 0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch create mode 100644 0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch create mode 100644 0007-kernel-Replace-how-kernel-version-information-is-fou.patch create mode 100644 0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch create mode 100644 0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch create mode 100644 0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch diff --git a/0001-prepare-Add-some-debugging-of-config-files-creating-.patch b/0001-prepare-Add-some-debugging-of-config-files-creating-.patch new file mode 100644 index 0000000..6bc83e4 --- /dev/null +++ b/0001-prepare-Add-some-debugging-of-config-files-creating-.patch @@ -0,0 +1,38 @@ +From 8518865218063cb2db1e7a7ab7dfc3fc0a80561c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 29 Jul 2017 10:39:43 +0100 +Subject: [PATCH 01/10] prepare: Add some debugging of config files / creating + base.tar.gz. + +--- + src/mode_prepare.ml | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/mode_prepare.ml b/src/mode_prepare.ml +index e8cf058..7c8221e 100644 +--- a/src/mode_prepare.ml ++++ b/src/mode_prepare.ml +@@ -146,6 +146,10 @@ let prepare debug (copy_kernel, format, host_cpu, + with Sys_error _ -> false + ) config_files in + ++ if debug >= 1 then ++ printf "supermin: there are %d config files\n" ++ (List.length config_files); ++ + (* Put the list of config files into a file, for tar to read. *) + let files_from = tmpdir // "files-from.txt" in + let chan = open_out files_from in +@@ -158,6 +162,7 @@ let prepare debug (copy_kernel, format, host_cpu, + let base = outputdir // "base.tar.gz" in + if debug >= 1 then printf "supermin: writing %s\n%!" base; + let cmd = +- sprintf "tar -C %s -zcf %s -T %s" +- (quote dir) (quote base) (quote files_from) in ++ sprintf "tar%s -C %s -zcf %s -T %s" ++ (if debug >=1 then " -v" else "") ++ (quote dir) (quote base) (quote files_from) in + run_command cmd; +-- +2.13.1 + diff --git a/0002-kernel-Refactor-code-for-locating-the-kernel.patch b/0002-kernel-Refactor-code-for-locating-the-kernel.patch new file mode 100644 index 0000000..b32e42e --- /dev/null +++ b/0002-kernel-Refactor-code-for-locating-the-kernel.patch @@ -0,0 +1,178 @@ +From 137dc8b5a0b7427cd80d774604f2f048259b7926 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 12:19:35 +0100 +Subject: [PATCH 02/10] kernel: Refactor code for locating the kernel. + +Refactor the code for locating the kernel into separate functions, +making clear the purpose of each part of the code. + +This is pure refactoring and doesn't change the meaning of the code. +--- + src/format_ext2_kernel.ml | 126 ++++++++++++++++++++++++++-------------------- + 1 file changed, 72 insertions(+), 54 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 5d1ae66..a12fbd2 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -40,49 +40,21 @@ let patt_of_cpu host_cpu = + List.map (fun model -> sprintf "vmlinu?-*-%s" model) models + + let rec build_kernel debug host_cpu copy_kernel kernel = +- (* Locate the kernel. *) ++ (* Locate the kernel. ++ * SUPERMIN_* environment variables override everything. If those ++ * are not present then we look in /lib/modules and /boot. ++ *) + let kernel_file, kernel_name, kernel_version, modpath = +- try +- let kernel_env = getenv "SUPERMIN_KERNEL" in +- if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" +- kernel_env; +- let kernel_version = +- try +- let v = getenv "SUPERMIN_KERNEL_VERSION" in +- if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; +- v +- with Not_found -> get_kernel_version_from_file kernel_env in +- if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" +- kernel_version; +- let kernel_name = Filename.basename kernel_env in +- let modpath = find_modpath debug kernel_version in +- kernel_env, kernel_name, kernel_version, modpath +- with Not_found -> +- let kernels = +- let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in +- let files = Array.to_list files in +- let kernels = +- List.map ( +- fun f -> +- let modpath = Filename.dirname f in +- f, Filename.basename f, Filename.basename modpath, modpath +- ) files in +- List.sort ( +- fun (_, _, a, _) (_, _, b, _) -> compare_version b a +- ) kernels in +- +- if kernels <> [] then ( +- let kernel = List.hd kernels in +- if debug >= 1 then ( +- let kernel_file, _, _, _ = kernel in +- printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; +- ); +- kernel +- ) else +- find_kernel debug host_cpu kernel in ++ match find_kernel_from_env_vars debug with ++ | Some k -> k ++ | None -> ++ match find_kernel_from_lib_modules debug with ++ | Some k -> k ++ | None -> ++ match find_kernel_from_boot debug host_cpu with ++ | Some k -> k ++ | None -> ++ error_no_kernels host_cpu in + + if debug >= 1 then ( + printf "supermin: kernel: kernel_version %s\n" kernel_version; +@@ -93,7 +65,52 @@ let rec build_kernel debug host_cpu copy_kernel kernel = + + (kernel_version, modpath) + +-and find_kernel debug host_cpu kernel = ++and find_kernel_from_env_vars debug = ++ try ++ let kernel_env = getenv "SUPERMIN_KERNEL" in ++ if debug >= 1 then ++ printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" ++ kernel_env; ++ let kernel_version = ++ try ++ let v = getenv "SUPERMIN_KERNEL_VERSION" in ++ if debug >= 1 then ++ printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; ++ v ++ with Not_found -> get_kernel_version_from_file kernel_env in ++ if debug >= 1 then ++ printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" ++ kernel_version; ++ let kernel_name = Filename.basename kernel_env in ++ let modpath = find_modpath debug kernel_version in ++ Some (kernel_env, kernel_name, kernel_version, modpath) ++ with Not_found -> None ++ ++and find_kernel_from_lib_modules debug = ++ let kernels = ++ let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in ++ let files = Array.to_list files in ++ let kernels = ++ List.map ( ++ fun f -> ++ let modpath = Filename.dirname f in ++ f, Filename.basename f, Filename.basename modpath, modpath ++ ) files in ++ List.sort ( ++ fun (_, _, a, _) (_, _, b, _) -> compare_version b a ++ ) kernels in ++ ++ if kernels <> [] then ( ++ let kernel = List.hd kernels in ++ if debug >= 1 then ( ++ let kernel_file, _, _, _ = kernel in ++ printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; ++ ); ++ Some kernel ++ ) else ++ None ++ ++and find_kernel_from_boot debug host_cpu = + let is_arm = + String.length host_cpu >= 3 && + host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in +@@ -111,19 +128,20 @@ and find_kernel debug host_cpu kernel = + (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) + kernel_filter ["vmlinu?-*"] is_arm all_files in + +- if files = [] then no_kernels host_cpu; +- +- let files = List.sort (fun a b -> compare_version b a) files in +- let kernel_name = List.hd files in +- let kernel_version = get_kernel_version kernel_name in ++ if files = [] then None ++ else ( ++ let files = List.sort (fun a b -> compare_version b a) files in ++ let kernel_name = List.hd files in ++ let kernel_version = get_kernel_version kernel_name in + +- if debug >= 1 then +- printf "supermin: kernel: picked kernel %s\n%!" kernel_name; ++ if debug >= 1 then ++ printf "supermin: kernel: picked kernel %s\n%!" kernel_name; + +- (* Get the kernel modules. *) +- let modpath = find_modpath debug kernel_version in ++ (* Get the kernel modules. *) ++ let modpath = find_modpath debug kernel_version in + +- ("/boot" // kernel_name), kernel_name, kernel_version, modpath ++ Some (("/boot" // kernel_name), kernel_name, kernel_version, modpath) ++ ) + + and kernel_filter patterns is_arm all_files = + let files = +@@ -143,7 +161,7 @@ and kernel_filter patterns is_arm all_files = + ) in + List.filter (fun filename -> has_modpath filename) files + +-and no_kernels host_cpu = ++and error_no_kernels host_cpu = + error "\ + failed to find a suitable kernel (host_cpu=%s). + +-- +2.13.1 + diff --git a/0003-kernel-Tweak-debug-messages.patch b/0003-kernel-Tweak-debug-messages.patch new file mode 100644 index 0000000..c18999f --- /dev/null +++ b/0003-kernel-Tweak-debug-messages.patch @@ -0,0 +1,110 @@ +From 44d0d1d9cd57feb4f6bd31c0530e90f6d7ede2f5 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 12:27:09 +0100 +Subject: [PATCH 03/10] kernel: Tweak debug messages. + +Rework the debug messages so it's clearer in debugging messages how +the kernel was located. Also removes duplicated debugging +information. + +This is cleanup, there is no functional change. +--- + src/format_ext2_kernel.ml | 35 ++++++++++++++--------------------- + 1 file changed, 14 insertions(+), 21 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index a12fbd2..90fa56f 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -45,20 +45,27 @@ let rec build_kernel debug host_cpu copy_kernel kernel = + * are not present then we look in /lib/modules and /boot. + *) + let kernel_file, kernel_name, kernel_version, modpath = ++ if debug >= 1 then ++ printf "supermin: kernel: looking for kernel using environment variables ...\n%!"; + match find_kernel_from_env_vars debug with + | Some k -> k + | None -> ++ if debug >= 1 then ++ printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!"; + match find_kernel_from_lib_modules debug with + | Some k -> k + | None -> ++ if debug >= 1 then ++ printf "supermin: kernel: looking for kernels in /boot ...\n%!"; + match find_kernel_from_boot debug host_cpu with + | Some k -> k + | None -> + error_no_kernels host_cpu in + + if debug >= 1 then ( ++ printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; + printf "supermin: kernel: kernel_version %s\n" kernel_version; +- printf "supermin: kernel: modules %s\n%!" modpath; ++ printf "supermin: kernel: modpath %s\n%!" modpath; + ); + + copy_or_symlink_file copy_kernel kernel_file kernel; +@@ -69,18 +76,14 @@ and find_kernel_from_env_vars debug = + try + let kernel_env = getenv "SUPERMIN_KERNEL" in + if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" +- kernel_env; ++ printf "supermin: kernel: SUPERMIN_KERNEL=%s\n%!" kernel_env; + let kernel_version = + try + let v = getenv "SUPERMIN_KERNEL_VERSION" in + if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; ++ printf "supermin: kernel: SUPERMIN_KERNEL_VERSION=%s\n%!" v; + v + with Not_found -> get_kernel_version_from_file kernel_env in +- if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" +- kernel_version; + let kernel_name = Filename.basename kernel_env in + let modpath = find_modpath debug kernel_version in + Some (kernel_env, kernel_name, kernel_version, modpath) +@@ -100,15 +103,9 @@ and find_kernel_from_lib_modules debug = + fun (_, _, a, _) (_, _, b, _) -> compare_version b a + ) kernels in + +- if kernels <> [] then ( +- let kernel = List.hd kernels in +- if debug >= 1 then ( +- let kernel_file, _, _, _ = kernel in +- printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; +- ); +- Some kernel +- ) else +- None ++ match kernels with ++ | kernel :: _ -> Some kernel ++ | [] -> None + + and find_kernel_from_boot debug host_cpu = + let is_arm = +@@ -134,9 +131,6 @@ and find_kernel_from_boot debug host_cpu = + let kernel_name = List.hd files in + let kernel_version = get_kernel_version kernel_name in + +- if debug >= 1 then +- printf "supermin: kernel: picked kernel %s\n%!" kernel_name; +- + (* Get the kernel modules. *) + let modpath = find_modpath debug kernel_version in + +@@ -176,8 +170,7 @@ and find_modpath debug kernel_version = + try + let modpath = getenv "SUPERMIN_MODULES" in + if debug >= 1 then +- printf "supermin: kernel: SUPERMIN_MODULES environment variable = %s\n%!" +- modpath; ++ printf "supermin: kernel: SUPERMIN_MODULES=%s\n%!" modpath; + modpath + with Not_found -> + let modpath = "/lib/modules/" ^ kernel_version in +-- +2.13.1 + diff --git a/0004-kernel-Rearrange-the-order-of-functions.patch b/0004-kernel-Rearrange-the-order-of-functions.patch new file mode 100644 index 0000000..0844709 --- /dev/null +++ b/0004-kernel-Rearrange-the-order-of-functions.patch @@ -0,0 +1,90 @@ +From cb080ba09e0e2b78cf33d88acd510641118c07ca Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 12:34:47 +0100 +Subject: [PATCH 04/10] kernel: Rearrange the order of functions. + +Rearrange the order of functions more logically. + +Just code motion, no functional change. +--- + src/format_ext2_kernel.ml | 50 +++++++++++++++++++++++------------------------ + 1 file changed, 25 insertions(+), 25 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 90fa56f..e2f8e4b 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -24,21 +24,6 @@ open Ext2fs + open Fnmatch + open Glob + +-let patt_of_cpu host_cpu = +- let models = +- match host_cpu with +- | "mips" | "mips64" -> [host_cpu; "*-malta"] +- | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] +- | "sparc" | "sparc64" -> ["sparc"; "sparc64"] +- | "amd64" | "x86_64" -> ["amd64"; "x86_64"] +- | "parisc" | "parisc64" -> ["hppa"; "hppa64"] +- | "ppc64el" -> ["powerpc64le"] +- | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] +- | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] +- | _ -> [host_cpu] +- in +- List.map (fun model -> sprintf "vmlinu?-*-%s" model) models +- + let rec build_kernel debug host_cpu copy_kernel kernel = + (* Locate the kernel. + * SUPERMIN_* environment variables override everything. If those +@@ -72,6 +57,17 @@ let rec build_kernel debug host_cpu copy_kernel kernel = + + (kernel_version, modpath) + ++and error_no_kernels host_cpu = ++ error "\ ++failed to find a suitable kernel (host_cpu=%s). ++ ++I looked for kernels in /boot and modules in /lib/modules. ++ ++If this is a Xen guest, and you only have Xen domU kernels ++installed, try installing a fullvirt kernel (only for ++supermin use, you shouldn't boot the Xen guest with it)." ++ host_cpu ++ + and find_kernel_from_env_vars debug = + try + let kernel_env = getenv "SUPERMIN_KERNEL" in +@@ -155,16 +151,20 @@ and kernel_filter patterns is_arm all_files = + ) in + List.filter (fun filename -> has_modpath filename) files + +-and error_no_kernels host_cpu = +- error "\ +-failed to find a suitable kernel (host_cpu=%s). +- +-I looked for kernels in /boot and modules in /lib/modules. +- +-If this is a Xen guest, and you only have Xen domU kernels +-installed, try installing a fullvirt kernel (only for +-supermin use, you shouldn't boot the Xen guest with it)." +- host_cpu ++and patt_of_cpu host_cpu = ++ let models = ++ match host_cpu with ++ | "mips" | "mips64" -> [host_cpu; "*-malta"] ++ | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] ++ | "sparc" | "sparc64" -> ["sparc"; "sparc64"] ++ | "amd64" | "x86_64" -> ["amd64"; "x86_64"] ++ | "parisc" | "parisc64" -> ["hppa"; "hppa64"] ++ | "ppc64el" -> ["powerpc64le"] ++ | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] ++ | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] ++ | _ -> [host_cpu] ++ in ++ List.map (fun model -> sprintf "vmlinu?-*-%s" model) models + + and find_modpath debug kernel_version = + try +-- +2.13.1 + diff --git a/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch b/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch new file mode 100644 index 0000000..0896671 --- /dev/null +++ b/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch @@ -0,0 +1,60 @@ +From fb7164c23b4e5161d22eaf266abd3e0bf55e7b1e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 12:47:49 +0100 +Subject: [PATCH 05/10] kernel: Filter /boot kernels using has_modpath later. + +/boot kernels are filtered using the has_modpath function. +This change just moves the test later, which has no effect +here but makes subsequent cleanups simpler. +--- + src/format_ext2_kernel.ml | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index e2f8e4b..c44ae23 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -121,17 +121,22 @@ and find_kernel_from_boot debug host_cpu = + (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) + kernel_filter ["vmlinu?-*"] is_arm all_files in + +- if files = [] then None +- else ( +- let files = List.sort (fun a b -> compare_version b a) files in +- let kernel_name = List.hd files in +- let kernel_version = get_kernel_version kernel_name in ++ let files = List.sort (fun a b -> compare_version b a) files in ++ let kernels = ++ List.map ( ++ fun kernel_name -> ++ let kernel_version = get_kernel_version kernel_name in ++ let kernel_file = "/boot" // kernel_name in ++ let modpath = find_modpath debug kernel_version in ++ (kernel_file, kernel_name, kernel_version, modpath) ++ ) files in + +- (* Get the kernel modules. *) +- let modpath = find_modpath debug kernel_version in ++ let kernels = ++ List.filter (fun (_, kernel_name, _, _) -> has_modpath kernel_name) kernels in + +- Some (("/boot" // kernel_name), kernel_name, kernel_version, modpath) +- ) ++ match kernels with ++ | kernel :: _ -> Some kernel ++ | [] -> None + + and kernel_filter patterns is_arm all_files = + let files = +@@ -149,7 +154,7 @@ and kernel_filter patterns is_arm all_files = + find filename "tegra" = -1 + ) files + ) in +- List.filter (fun filename -> has_modpath filename) files ++ files + + and patt_of_cpu host_cpu = + let models = +-- +2.13.1 + diff --git a/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch b/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch new file mode 100644 index 0000000..65c391a --- /dev/null +++ b/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch @@ -0,0 +1,42 @@ +From 407bf152a24399c78eae114589100ba0923ef70a Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 12:53:54 +0100 +Subject: [PATCH 06/10] kernel: Change has_modpath function so it checks for + modpath // modules.dep. + +--- + src/format_ext2_kernel.ml | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index c44ae23..0bb67fe 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -132,7 +132,7 @@ and find_kernel_from_boot debug host_cpu = + ) files in + + let kernels = +- List.filter (fun (_, kernel_name, _, _) -> has_modpath kernel_name) kernels in ++ List.filter (fun (_, _, _, modpath) -> has_modpath modpath) kernels in + + match kernels with + | kernel :: _ -> Some kernel +@@ -183,12 +183,9 @@ and find_modpath debug kernel_version = + printf "supermin: kernel: picked modules path %s\n%!" modpath; + modpath + +-and has_modpath kernel_name = +- try +- let kv = get_kernel_version kernel_name in +- modules_dep_exists kv +- with +- | Not_found -> false ++and has_modpath modpath = ++ try (stat (modpath // "modules.dep")).st_kind = S_REG ++ with Unix_error _ -> false + + and get_kernel_version kernel_name = + if (string_prefix "vmlinuz-" kernel_name) || +-- +2.13.1 + diff --git a/0007-kernel-Replace-how-kernel-version-information-is-fou.patch b/0007-kernel-Replace-how-kernel-version-information-is-fou.patch new file mode 100644 index 0000000..91dfcfe --- /dev/null +++ b/0007-kernel-Replace-how-kernel-version-information-is-fou.patch @@ -0,0 +1,150 @@ +From c859939113b939b5ad4237e8f4835cd33290357f Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 13:06:41 +0100 +Subject: [PATCH 07/10] kernel: Replace how kernel version information is + found. + +The old code was fairly bogus. In the new code there is one "public" +function: + + val get_kernel_version : bool -> string -> string option + +which takes a full vmlinuz path and returns the kernel version from it +if possible (or None if not). This function first looks at the file +content to see if the version can be extracted, and if that fails +looks at the filename. + +As a side effect of making this change, we also filter out kernels +from /boot where we cannot read the kernel version. +--- + src/format_ext2_kernel.ml | 78 +++++++++++++++++++++++++++++++---------------- + 1 file changed, 51 insertions(+), 27 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 0bb67fe..55c5af9 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -79,7 +79,10 @@ and find_kernel_from_env_vars debug = + if debug >= 1 then + printf "supermin: kernel: SUPERMIN_KERNEL_VERSION=%s\n%!" v; + v +- with Not_found -> get_kernel_version_from_file kernel_env in ++ with Not_found -> ++ match get_kernel_version debug kernel_env with ++ | Some v -> v ++ | None -> raise Not_found in + let kernel_name = Filename.basename kernel_env in + let modpath = find_modpath debug kernel_version in + Some (kernel_env, kernel_name, kernel_version, modpath) +@@ -123,17 +126,17 @@ and find_kernel_from_boot debug host_cpu = + + let files = List.sort (fun a b -> compare_version b a) files in + let kernels = +- List.map ( ++ filter_map ( + fun kernel_name -> +- let kernel_version = get_kernel_version kernel_name in + let kernel_file = "/boot" // kernel_name in +- let modpath = find_modpath debug kernel_version in +- (kernel_file, kernel_name, kernel_version, modpath) ++ match get_kernel_version debug kernel_file with ++ | None -> None ++ | Some kernel_version -> ++ let modpath = find_modpath debug kernel_version in ++ if not (has_modpath modpath) then None ++ else Some (kernel_file, kernel_name, kernel_version, modpath) + ) files in + +- let kernels = +- List.filter (fun (_, _, _, modpath) -> has_modpath modpath) kernels in +- + match kernels with + | kernel :: _ -> Some kernel + | [] -> None +@@ -187,24 +190,43 @@ and has_modpath modpath = + try (stat (modpath // "modules.dep")).st_kind = S_REG + with Unix_error _ -> false + +-and get_kernel_version kernel_name = +- if (string_prefix "vmlinuz-" kernel_name) || +- (string_prefix "vmlinux-" kernel_name) then ( +- let kv = String.sub kernel_name 8 (String.length kernel_name - 8) in +- if modules_dep_exists kv then kv +- else get_kernel_version_from_name kernel_name +- ) else get_kernel_version_from_name kernel_name +- +-and modules_dep_exists kv = +- try (lstat ("/lib/modules/" ^ kv ^ "/modules.dep")).st_kind = S_REG +- with Unix_error _ -> false +- +-and get_kernel_version_from_name kernel_name = +- get_kernel_version_from_file ("/boot" // kernel_name) ++(* Extract the kernel version from a Linux kernel file. ++ * ++ * This first sees if we can get the information from the file ++ * content (see below) and if that fails tries to parse the ++ * filename. ++ *) ++and get_kernel_version debug kernel_file = ++ if debug >= 1 then ++ printf "supermin: kernel: kernel version of %s%!" kernel_file; ++ match get_kernel_version_from_file_content kernel_file with ++ | Some version -> ++ if debug >= 1 then printf " = %s (from content)\n%!" version; ++ Some version ++ | None -> ++ (* Try to work it out from the filename instead. *) ++ let basename = Filename.basename kernel_file in ++ if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename ++ then ( ++ let version = String.sub basename 8 (String.length basename - 8) in ++ (* Does the version look reasonable? *) ++ let modpath = "/lib/modules" // version in ++ if has_modpath modpath then ( ++ if debug >= 1 then printf " = %s (from filename)\n%!" version; ++ Some version ++ ) else ( ++ if debug >= 1 then printf " = error, no modpath\n%!"; ++ None ++ ) ++ ) ++ else ( ++ if debug >= 1 then printf " = error, cannot parse filename\n%!"; ++ None ++ ) + + (* Extract the kernel version from a Linux kernel file. + * +- * Returns a string containing the version or [Not_found] if the ++ * Returns a string containing the version or [None] if the + * file can't be read, is not a Linux kernel, or the version can't + * be found. + * +@@ -217,7 +239,7 @@ and get_kernel_version_from_name kernel_name = + * + * Bugs: probably limited to x86 kernels. + *) +-and get_kernel_version_from_file file = ++and get_kernel_version_from_file_content file = + try + let chan = open_in file in + let buf = read_string chan 514 4 in +@@ -247,10 +269,12 @@ and get_kernel_version_from_file file = + ) + else raise Not_found + in +- loop 0 ++ let version = loop 0 in ++ Some version + with +- | Sys_error _ -> raise Not_found +- | Invalid_argument _ -> raise Not_found ++ | Not_found ++ | Sys_error _ ++ | Invalid_argument _ -> None + + (* Read an unsigned little endian short at a specified offset in a file. *) + and read_leshort chan offset = +-- +2.13.1 + diff --git a/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch b/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch new file mode 100644 index 0000000..bfbdf16 --- /dev/null +++ b/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch @@ -0,0 +1,35 @@ +From 1cb54ab90e813e148e218cb274c97b08b610e3b9 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 13:09:06 +0100 +Subject: [PATCH 08/10] kernel: Don't allow End_of_file exception to escape if + kernel is bogus (RHBZ#1477758). +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the kernel file is truncated (zero length or too short) then +functions such as ‘really_input’ raise End_of_file. Unfortunately +this exception could escape and kill the program. What we want to do +instead is to ignore such kernels. The combination of this commit and +the last commit ignores such kernels if they are found in /boot. + +Reported by Charlie Martinez. +--- + src/format_ext2_kernel.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 55c5af9..e329adb 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -273,6 +273,7 @@ and get_kernel_version_from_file_content file = + Some version + with + | Not_found ++ | End_of_file + | Sys_error _ + | Invalid_argument _ -> None + +-- +2.13.1 + diff --git a/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch b/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch new file mode 100644 index 0000000..a6c0d69 --- /dev/null +++ b/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch @@ -0,0 +1,33 @@ +From bc33663a38bc401a5b5883e253cc93b0d3e67ef2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 13:48:37 +0100 +Subject: [PATCH 09/10] kernel: Simple renaming to make find_kernel_from_* + functions consistent. + +No functional change, just renaming variables. +--- + src/format_ext2_kernel.ml | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index e329adb..44ba035 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -94,9 +94,11 @@ and find_kernel_from_lib_modules debug = + let files = Array.to_list files in + let kernels = + List.map ( +- fun f -> +- let modpath = Filename.dirname f in +- f, Filename.basename f, Filename.basename modpath, modpath ++ fun kernel_file -> ++ let kernel_name = Filename.basename kernel_file in ++ let modpath = Filename.dirname kernel_file in ++ let kernel_version = Filename.basename modpath in ++ kernel_file, kernel_name, kernel_version, modpath + ) files in + List.sort ( + fun (_, _, a, _) (_, _, b, _) -> compare_version b a +-- +2.13.1 + diff --git a/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch b/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch new file mode 100644 index 0000000..bd66692 --- /dev/null +++ b/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch @@ -0,0 +1,45 @@ +From ea3b3dce6bb77dbe57f91044c30ab49693e88e2b Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 3 Aug 2017 13:09:06 +0100 +Subject: [PATCH 10/10] kernel: Reject implausibly small kernels in + /lib/modules (RHBZ#1477758). + +Previous changes will reject truncated / implausibly small kernel +files found under /boot, but because the code that looks for kernels +in /lib/modules works slightly differently it would not work there. +This uses a simple stat check to reject kernels there too. + +Reported by Charlie Martinez. +--- + src/format_ext2_kernel.ml | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 44ba035..d5d529d 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -93,12 +93,16 @@ and find_kernel_from_lib_modules debug = + let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in + let files = Array.to_list files in + let kernels = +- List.map ( ++ filter_map ( + fun kernel_file -> +- let kernel_name = Filename.basename kernel_file in +- let modpath = Filename.dirname kernel_file in +- let kernel_version = Filename.basename modpath in +- kernel_file, kernel_name, kernel_version, modpath ++ let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in ++ if size < 10000 then None ++ else ( ++ let kernel_name = Filename.basename kernel_file in ++ let modpath = Filename.dirname kernel_file in ++ let kernel_version = Filename.basename modpath in ++ Some (kernel_file, kernel_name, kernel_version, modpath) ++ ) + ) files in + List.sort ( + fun (_, _, a, _) (_, _, b, _) -> compare_version b a +-- +2.13.1 + diff --git a/supermin.spec b/supermin.spec index b3892ab..2aba38c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.18 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -49,6 +49,19 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif +# All upstream patches since 5.1.18. +Patch0001: 0001-prepare-Add-some-debugging-of-config-files-creating-.patch +# Fix supermin crash with truncated vmlinuz file (RHBZ#1477758). +Patch0002: 0002-kernel-Refactor-code-for-locating-the-kernel.patch +Patch0003: 0003-kernel-Tweak-debug-messages.patch +Patch0004: 0004-kernel-Rearrange-the-order-of-functions.patch +Patch0005: 0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch +Patch0006: 0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch +Patch0007: 0007-kernel-Replace-how-kernel-version-information-is-fou.patch +Patch0008: 0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch +Patch0009: 0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch +Patch0010: 0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -170,6 +183,10 @@ make check || { %changelog +* Thu Aug 03 2017 Richard W.M. Jones - 5.1.18-4 +- Fix supermin crash with truncated vmlinuz file (RHBZ#1477758). +- Include all upstream patches since 5.1.18. + * Thu Aug 03 2017 Fedora Release Engineering - 5.1.18-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From df8b19ddc030da612ccf3ea01d680f83bcd5ab38 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 10 Aug 2017 20:34:08 +0200 Subject: [PATCH 10/95] Rebuilt for RPM soname bump Signed-off-by: Igor Gnatenko --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 2aba38c..14ed220 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.18 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -183,6 +183,9 @@ make check || { %changelog +* Thu Aug 10 2017 Igor Gnatenko - 5.1.18-5 +- Rebuilt for RPM soname bump + * Thu Aug 03 2017 Richard W.M. Jones - 5.1.18-4 - Fix supermin crash with truncated vmlinuz file (RHBZ#1477758). - Include all upstream patches since 5.1.18. From ef3b041d450f032ed3e44eda10bdaadf50064709 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 19 Sep 2017 14:43:14 +0100 Subject: [PATCH 11/95] New upstream version 5.1.19. Remove all patches, now upstream. --- .gitignore | 3 +- ...-debugging-of-config-files-creating-.patch | 38 ---- ...efactor-code-for-locating-the-kernel.patch | 178 ------------------ 0003-kernel-Tweak-debug-messages.patch | 110 ----------- ...nel-Rearrange-the-order-of-functions.patch | 90 --------- ...boot-kernels-using-has_modpath-later.patch | 60 ------ ...s_modpath-function-so-it-checks-for-.patch | 42 ----- ...ow-kernel-version-information-is-fou.patch | 150 --------------- ...ow-End_of_file-exception-to-escape-i.patch | 35 ---- ...naming-to-make-find_kernel_from_-fun.patch | 33 ---- ...plausibly-small-kernels-in-lib-modul.patch | 45 ----- sources | 4 +- supermin.spec | 21 +-- 13 files changed, 9 insertions(+), 800 deletions(-) delete mode 100644 0001-prepare-Add-some-debugging-of-config-files-creating-.patch delete mode 100644 0002-kernel-Refactor-code-for-locating-the-kernel.patch delete mode 100644 0003-kernel-Tweak-debug-messages.patch delete mode 100644 0004-kernel-Rearrange-the-order-of-functions.patch delete mode 100644 0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch delete mode 100644 0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch delete mode 100644 0007-kernel-Replace-how-kernel-version-information-is-fou.patch delete mode 100644 0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch delete mode 100644 0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch delete mode 100644 0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch diff --git a/.gitignore b/.gitignore index c4345c0..2d30973 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,5 @@ /.build-*.log /clog /supermin-*.tar.gz +/supermin-*.tar.gz.sig /x86_64 -/supermin-5.1.17.tar.gz.sig -/supermin-5.1.18.tar.gz.sig diff --git a/0001-prepare-Add-some-debugging-of-config-files-creating-.patch b/0001-prepare-Add-some-debugging-of-config-files-creating-.patch deleted file mode 100644 index 6bc83e4..0000000 --- a/0001-prepare-Add-some-debugging-of-config-files-creating-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8518865218063cb2db1e7a7ab7dfc3fc0a80561c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 29 Jul 2017 10:39:43 +0100 -Subject: [PATCH 01/10] prepare: Add some debugging of config files / creating - base.tar.gz. - ---- - src/mode_prepare.ml | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/mode_prepare.ml b/src/mode_prepare.ml -index e8cf058..7c8221e 100644 ---- a/src/mode_prepare.ml -+++ b/src/mode_prepare.ml -@@ -146,6 +146,10 @@ let prepare debug (copy_kernel, format, host_cpu, - with Sys_error _ -> false - ) config_files in - -+ if debug >= 1 then -+ printf "supermin: there are %d config files\n" -+ (List.length config_files); -+ - (* Put the list of config files into a file, for tar to read. *) - let files_from = tmpdir // "files-from.txt" in - let chan = open_out files_from in -@@ -158,6 +162,7 @@ let prepare debug (copy_kernel, format, host_cpu, - let base = outputdir // "base.tar.gz" in - if debug >= 1 then printf "supermin: writing %s\n%!" base; - let cmd = -- sprintf "tar -C %s -zcf %s -T %s" -- (quote dir) (quote base) (quote files_from) in -+ sprintf "tar%s -C %s -zcf %s -T %s" -+ (if debug >=1 then " -v" else "") -+ (quote dir) (quote base) (quote files_from) in - run_command cmd; --- -2.13.1 - diff --git a/0002-kernel-Refactor-code-for-locating-the-kernel.patch b/0002-kernel-Refactor-code-for-locating-the-kernel.patch deleted file mode 100644 index b32e42e..0000000 --- a/0002-kernel-Refactor-code-for-locating-the-kernel.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 137dc8b5a0b7427cd80d774604f2f048259b7926 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 12:19:35 +0100 -Subject: [PATCH 02/10] kernel: Refactor code for locating the kernel. - -Refactor the code for locating the kernel into separate functions, -making clear the purpose of each part of the code. - -This is pure refactoring and doesn't change the meaning of the code. ---- - src/format_ext2_kernel.ml | 126 ++++++++++++++++++++++++++-------------------- - 1 file changed, 72 insertions(+), 54 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 5d1ae66..a12fbd2 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -40,49 +40,21 @@ let patt_of_cpu host_cpu = - List.map (fun model -> sprintf "vmlinu?-*-%s" model) models - - let rec build_kernel debug host_cpu copy_kernel kernel = -- (* Locate the kernel. *) -+ (* Locate the kernel. -+ * SUPERMIN_* environment variables override everything. If those -+ * are not present then we look in /lib/modules and /boot. -+ *) - let kernel_file, kernel_name, kernel_version, modpath = -- try -- let kernel_env = getenv "SUPERMIN_KERNEL" in -- if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" -- kernel_env; -- let kernel_version = -- try -- let v = getenv "SUPERMIN_KERNEL_VERSION" in -- if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; -- v -- with Not_found -> get_kernel_version_from_file kernel_env in -- if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" -- kernel_version; -- let kernel_name = Filename.basename kernel_env in -- let modpath = find_modpath debug kernel_version in -- kernel_env, kernel_name, kernel_version, modpath -- with Not_found -> -- let kernels = -- let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in -- let files = Array.to_list files in -- let kernels = -- List.map ( -- fun f -> -- let modpath = Filename.dirname f in -- f, Filename.basename f, Filename.basename modpath, modpath -- ) files in -- List.sort ( -- fun (_, _, a, _) (_, _, b, _) -> compare_version b a -- ) kernels in -- -- if kernels <> [] then ( -- let kernel = List.hd kernels in -- if debug >= 1 then ( -- let kernel_file, _, _, _ = kernel in -- printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; -- ); -- kernel -- ) else -- find_kernel debug host_cpu kernel in -+ match find_kernel_from_env_vars debug with -+ | Some k -> k -+ | None -> -+ match find_kernel_from_lib_modules debug with -+ | Some k -> k -+ | None -> -+ match find_kernel_from_boot debug host_cpu with -+ | Some k -> k -+ | None -> -+ error_no_kernels host_cpu in - - if debug >= 1 then ( - printf "supermin: kernel: kernel_version %s\n" kernel_version; -@@ -93,7 +65,52 @@ let rec build_kernel debug host_cpu copy_kernel kernel = - - (kernel_version, modpath) - --and find_kernel debug host_cpu kernel = -+and find_kernel_from_env_vars debug = -+ try -+ let kernel_env = getenv "SUPERMIN_KERNEL" in -+ if debug >= 1 then -+ printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" -+ kernel_env; -+ let kernel_version = -+ try -+ let v = getenv "SUPERMIN_KERNEL_VERSION" in -+ if debug >= 1 then -+ printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; -+ v -+ with Not_found -> get_kernel_version_from_file kernel_env in -+ if debug >= 1 then -+ printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" -+ kernel_version; -+ let kernel_name = Filename.basename kernel_env in -+ let modpath = find_modpath debug kernel_version in -+ Some (kernel_env, kernel_name, kernel_version, modpath) -+ with Not_found -> None -+ -+and find_kernel_from_lib_modules debug = -+ let kernels = -+ let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in -+ let files = Array.to_list files in -+ let kernels = -+ List.map ( -+ fun f -> -+ let modpath = Filename.dirname f in -+ f, Filename.basename f, Filename.basename modpath, modpath -+ ) files in -+ List.sort ( -+ fun (_, _, a, _) (_, _, b, _) -> compare_version b a -+ ) kernels in -+ -+ if kernels <> [] then ( -+ let kernel = List.hd kernels in -+ if debug >= 1 then ( -+ let kernel_file, _, _, _ = kernel in -+ printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; -+ ); -+ Some kernel -+ ) else -+ None -+ -+and find_kernel_from_boot debug host_cpu = - let is_arm = - String.length host_cpu >= 3 && - host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in -@@ -111,19 +128,20 @@ and find_kernel debug host_cpu kernel = - (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) - kernel_filter ["vmlinu?-*"] is_arm all_files in - -- if files = [] then no_kernels host_cpu; -- -- let files = List.sort (fun a b -> compare_version b a) files in -- let kernel_name = List.hd files in -- let kernel_version = get_kernel_version kernel_name in -+ if files = [] then None -+ else ( -+ let files = List.sort (fun a b -> compare_version b a) files in -+ let kernel_name = List.hd files in -+ let kernel_version = get_kernel_version kernel_name in - -- if debug >= 1 then -- printf "supermin: kernel: picked kernel %s\n%!" kernel_name; -+ if debug >= 1 then -+ printf "supermin: kernel: picked kernel %s\n%!" kernel_name; - -- (* Get the kernel modules. *) -- let modpath = find_modpath debug kernel_version in -+ (* Get the kernel modules. *) -+ let modpath = find_modpath debug kernel_version in - -- ("/boot" // kernel_name), kernel_name, kernel_version, modpath -+ Some (("/boot" // kernel_name), kernel_name, kernel_version, modpath) -+ ) - - and kernel_filter patterns is_arm all_files = - let files = -@@ -143,7 +161,7 @@ and kernel_filter patterns is_arm all_files = - ) in - List.filter (fun filename -> has_modpath filename) files - --and no_kernels host_cpu = -+and error_no_kernels host_cpu = - error "\ - failed to find a suitable kernel (host_cpu=%s). - --- -2.13.1 - diff --git a/0003-kernel-Tweak-debug-messages.patch b/0003-kernel-Tweak-debug-messages.patch deleted file mode 100644 index c18999f..0000000 --- a/0003-kernel-Tweak-debug-messages.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 44d0d1d9cd57feb4f6bd31c0530e90f6d7ede2f5 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 12:27:09 +0100 -Subject: [PATCH 03/10] kernel: Tweak debug messages. - -Rework the debug messages so it's clearer in debugging messages how -the kernel was located. Also removes duplicated debugging -information. - -This is cleanup, there is no functional change. ---- - src/format_ext2_kernel.ml | 35 ++++++++++++++--------------------- - 1 file changed, 14 insertions(+), 21 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index a12fbd2..90fa56f 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -45,20 +45,27 @@ let rec build_kernel debug host_cpu copy_kernel kernel = - * are not present then we look in /lib/modules and /boot. - *) - let kernel_file, kernel_name, kernel_version, modpath = -+ if debug >= 1 then -+ printf "supermin: kernel: looking for kernel using environment variables ...\n%!"; - match find_kernel_from_env_vars debug with - | Some k -> k - | None -> -+ if debug >= 1 then -+ printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!"; - match find_kernel_from_lib_modules debug with - | Some k -> k - | None -> -+ if debug >= 1 then -+ printf "supermin: kernel: looking for kernels in /boot ...\n%!"; - match find_kernel_from_boot debug host_cpu with - | Some k -> k - | None -> - error_no_kernels host_cpu in - - if debug >= 1 then ( -+ printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; - printf "supermin: kernel: kernel_version %s\n" kernel_version; -- printf "supermin: kernel: modules %s\n%!" modpath; -+ printf "supermin: kernel: modpath %s\n%!" modpath; - ); - - copy_or_symlink_file copy_kernel kernel_file kernel; -@@ -69,18 +76,14 @@ and find_kernel_from_env_vars debug = - try - let kernel_env = getenv "SUPERMIN_KERNEL" in - if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" -- kernel_env; -+ printf "supermin: kernel: SUPERMIN_KERNEL=%s\n%!" kernel_env; - let kernel_version = - try - let v = getenv "SUPERMIN_KERNEL_VERSION" in - if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; -+ printf "supermin: kernel: SUPERMIN_KERNEL_VERSION=%s\n%!" v; - v - with Not_found -> get_kernel_version_from_file kernel_env in -- if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" -- kernel_version; - let kernel_name = Filename.basename kernel_env in - let modpath = find_modpath debug kernel_version in - Some (kernel_env, kernel_name, kernel_version, modpath) -@@ -100,15 +103,9 @@ and find_kernel_from_lib_modules debug = - fun (_, _, a, _) (_, _, b, _) -> compare_version b a - ) kernels in - -- if kernels <> [] then ( -- let kernel = List.hd kernels in -- if debug >= 1 then ( -- let kernel_file, _, _, _ = kernel in -- printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; -- ); -- Some kernel -- ) else -- None -+ match kernels with -+ | kernel :: _ -> Some kernel -+ | [] -> None - - and find_kernel_from_boot debug host_cpu = - let is_arm = -@@ -134,9 +131,6 @@ and find_kernel_from_boot debug host_cpu = - let kernel_name = List.hd files in - let kernel_version = get_kernel_version kernel_name in - -- if debug >= 1 then -- printf "supermin: kernel: picked kernel %s\n%!" kernel_name; -- - (* Get the kernel modules. *) - let modpath = find_modpath debug kernel_version in - -@@ -176,8 +170,7 @@ and find_modpath debug kernel_version = - try - let modpath = getenv "SUPERMIN_MODULES" in - if debug >= 1 then -- printf "supermin: kernel: SUPERMIN_MODULES environment variable = %s\n%!" -- modpath; -+ printf "supermin: kernel: SUPERMIN_MODULES=%s\n%!" modpath; - modpath - with Not_found -> - let modpath = "/lib/modules/" ^ kernel_version in --- -2.13.1 - diff --git a/0004-kernel-Rearrange-the-order-of-functions.patch b/0004-kernel-Rearrange-the-order-of-functions.patch deleted file mode 100644 index 0844709..0000000 --- a/0004-kernel-Rearrange-the-order-of-functions.patch +++ /dev/null @@ -1,90 +0,0 @@ -From cb080ba09e0e2b78cf33d88acd510641118c07ca Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 12:34:47 +0100 -Subject: [PATCH 04/10] kernel: Rearrange the order of functions. - -Rearrange the order of functions more logically. - -Just code motion, no functional change. ---- - src/format_ext2_kernel.ml | 50 +++++++++++++++++++++++------------------------ - 1 file changed, 25 insertions(+), 25 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 90fa56f..e2f8e4b 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -24,21 +24,6 @@ open Ext2fs - open Fnmatch - open Glob - --let patt_of_cpu host_cpu = -- let models = -- match host_cpu with -- | "mips" | "mips64" -> [host_cpu; "*-malta"] -- | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] -- | "sparc" | "sparc64" -> ["sparc"; "sparc64"] -- | "amd64" | "x86_64" -> ["amd64"; "x86_64"] -- | "parisc" | "parisc64" -> ["hppa"; "hppa64"] -- | "ppc64el" -> ["powerpc64le"] -- | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] -- | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] -- | _ -> [host_cpu] -- in -- List.map (fun model -> sprintf "vmlinu?-*-%s" model) models -- - let rec build_kernel debug host_cpu copy_kernel kernel = - (* Locate the kernel. - * SUPERMIN_* environment variables override everything. If those -@@ -72,6 +57,17 @@ let rec build_kernel debug host_cpu copy_kernel kernel = - - (kernel_version, modpath) - -+and error_no_kernels host_cpu = -+ error "\ -+failed to find a suitable kernel (host_cpu=%s). -+ -+I looked for kernels in /boot and modules in /lib/modules. -+ -+If this is a Xen guest, and you only have Xen domU kernels -+installed, try installing a fullvirt kernel (only for -+supermin use, you shouldn't boot the Xen guest with it)." -+ host_cpu -+ - and find_kernel_from_env_vars debug = - try - let kernel_env = getenv "SUPERMIN_KERNEL" in -@@ -155,16 +151,20 @@ and kernel_filter patterns is_arm all_files = - ) in - List.filter (fun filename -> has_modpath filename) files - --and error_no_kernels host_cpu = -- error "\ --failed to find a suitable kernel (host_cpu=%s). -- --I looked for kernels in /boot and modules in /lib/modules. -- --If this is a Xen guest, and you only have Xen domU kernels --installed, try installing a fullvirt kernel (only for --supermin use, you shouldn't boot the Xen guest with it)." -- host_cpu -+and patt_of_cpu host_cpu = -+ let models = -+ match host_cpu with -+ | "mips" | "mips64" -> [host_cpu; "*-malta"] -+ | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] -+ | "sparc" | "sparc64" -> ["sparc"; "sparc64"] -+ | "amd64" | "x86_64" -> ["amd64"; "x86_64"] -+ | "parisc" | "parisc64" -> ["hppa"; "hppa64"] -+ | "ppc64el" -> ["powerpc64le"] -+ | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] -+ | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] -+ | _ -> [host_cpu] -+ in -+ List.map (fun model -> sprintf "vmlinu?-*-%s" model) models - - and find_modpath debug kernel_version = - try --- -2.13.1 - diff --git a/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch b/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch deleted file mode 100644 index 0896671..0000000 --- a/0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch +++ /dev/null @@ -1,60 +0,0 @@ -From fb7164c23b4e5161d22eaf266abd3e0bf55e7b1e Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 12:47:49 +0100 -Subject: [PATCH 05/10] kernel: Filter /boot kernels using has_modpath later. - -/boot kernels are filtered using the has_modpath function. -This change just moves the test later, which has no effect -here but makes subsequent cleanups simpler. ---- - src/format_ext2_kernel.ml | 25 +++++++++++++++---------- - 1 file changed, 15 insertions(+), 10 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index e2f8e4b..c44ae23 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -121,17 +121,22 @@ and find_kernel_from_boot debug host_cpu = - (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) - kernel_filter ["vmlinu?-*"] is_arm all_files in - -- if files = [] then None -- else ( -- let files = List.sort (fun a b -> compare_version b a) files in -- let kernel_name = List.hd files in -- let kernel_version = get_kernel_version kernel_name in -+ let files = List.sort (fun a b -> compare_version b a) files in -+ let kernels = -+ List.map ( -+ fun kernel_name -> -+ let kernel_version = get_kernel_version kernel_name in -+ let kernel_file = "/boot" // kernel_name in -+ let modpath = find_modpath debug kernel_version in -+ (kernel_file, kernel_name, kernel_version, modpath) -+ ) files in - -- (* Get the kernel modules. *) -- let modpath = find_modpath debug kernel_version in -+ let kernels = -+ List.filter (fun (_, kernel_name, _, _) -> has_modpath kernel_name) kernels in - -- Some (("/boot" // kernel_name), kernel_name, kernel_version, modpath) -- ) -+ match kernels with -+ | kernel :: _ -> Some kernel -+ | [] -> None - - and kernel_filter patterns is_arm all_files = - let files = -@@ -149,7 +154,7 @@ and kernel_filter patterns is_arm all_files = - find filename "tegra" = -1 - ) files - ) in -- List.filter (fun filename -> has_modpath filename) files -+ files - - and patt_of_cpu host_cpu = - let models = --- -2.13.1 - diff --git a/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch b/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch deleted file mode 100644 index 65c391a..0000000 --- a/0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 407bf152a24399c78eae114589100ba0923ef70a Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 12:53:54 +0100 -Subject: [PATCH 06/10] kernel: Change has_modpath function so it checks for - modpath // modules.dep. - ---- - src/format_ext2_kernel.ml | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index c44ae23..0bb67fe 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -132,7 +132,7 @@ and find_kernel_from_boot debug host_cpu = - ) files in - - let kernels = -- List.filter (fun (_, kernel_name, _, _) -> has_modpath kernel_name) kernels in -+ List.filter (fun (_, _, _, modpath) -> has_modpath modpath) kernels in - - match kernels with - | kernel :: _ -> Some kernel -@@ -183,12 +183,9 @@ and find_modpath debug kernel_version = - printf "supermin: kernel: picked modules path %s\n%!" modpath; - modpath - --and has_modpath kernel_name = -- try -- let kv = get_kernel_version kernel_name in -- modules_dep_exists kv -- with -- | Not_found -> false -+and has_modpath modpath = -+ try (stat (modpath // "modules.dep")).st_kind = S_REG -+ with Unix_error _ -> false - - and get_kernel_version kernel_name = - if (string_prefix "vmlinuz-" kernel_name) || --- -2.13.1 - diff --git a/0007-kernel-Replace-how-kernel-version-information-is-fou.patch b/0007-kernel-Replace-how-kernel-version-information-is-fou.patch deleted file mode 100644 index 91dfcfe..0000000 --- a/0007-kernel-Replace-how-kernel-version-information-is-fou.patch +++ /dev/null @@ -1,150 +0,0 @@ -From c859939113b939b5ad4237e8f4835cd33290357f Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 13:06:41 +0100 -Subject: [PATCH 07/10] kernel: Replace how kernel version information is - found. - -The old code was fairly bogus. In the new code there is one "public" -function: - - val get_kernel_version : bool -> string -> string option - -which takes a full vmlinuz path and returns the kernel version from it -if possible (or None if not). This function first looks at the file -content to see if the version can be extracted, and if that fails -looks at the filename. - -As a side effect of making this change, we also filter out kernels -from /boot where we cannot read the kernel version. ---- - src/format_ext2_kernel.ml | 78 +++++++++++++++++++++++++++++++---------------- - 1 file changed, 51 insertions(+), 27 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 0bb67fe..55c5af9 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -79,7 +79,10 @@ and find_kernel_from_env_vars debug = - if debug >= 1 then - printf "supermin: kernel: SUPERMIN_KERNEL_VERSION=%s\n%!" v; - v -- with Not_found -> get_kernel_version_from_file kernel_env in -+ with Not_found -> -+ match get_kernel_version debug kernel_env with -+ | Some v -> v -+ | None -> raise Not_found in - let kernel_name = Filename.basename kernel_env in - let modpath = find_modpath debug kernel_version in - Some (kernel_env, kernel_name, kernel_version, modpath) -@@ -123,17 +126,17 @@ and find_kernel_from_boot debug host_cpu = - - let files = List.sort (fun a b -> compare_version b a) files in - let kernels = -- List.map ( -+ filter_map ( - fun kernel_name -> -- let kernel_version = get_kernel_version kernel_name in - let kernel_file = "/boot" // kernel_name in -- let modpath = find_modpath debug kernel_version in -- (kernel_file, kernel_name, kernel_version, modpath) -+ match get_kernel_version debug kernel_file with -+ | None -> None -+ | Some kernel_version -> -+ let modpath = find_modpath debug kernel_version in -+ if not (has_modpath modpath) then None -+ else Some (kernel_file, kernel_name, kernel_version, modpath) - ) files in - -- let kernels = -- List.filter (fun (_, _, _, modpath) -> has_modpath modpath) kernels in -- - match kernels with - | kernel :: _ -> Some kernel - | [] -> None -@@ -187,24 +190,43 @@ and has_modpath modpath = - try (stat (modpath // "modules.dep")).st_kind = S_REG - with Unix_error _ -> false - --and get_kernel_version kernel_name = -- if (string_prefix "vmlinuz-" kernel_name) || -- (string_prefix "vmlinux-" kernel_name) then ( -- let kv = String.sub kernel_name 8 (String.length kernel_name - 8) in -- if modules_dep_exists kv then kv -- else get_kernel_version_from_name kernel_name -- ) else get_kernel_version_from_name kernel_name -- --and modules_dep_exists kv = -- try (lstat ("/lib/modules/" ^ kv ^ "/modules.dep")).st_kind = S_REG -- with Unix_error _ -> false -- --and get_kernel_version_from_name kernel_name = -- get_kernel_version_from_file ("/boot" // kernel_name) -+(* Extract the kernel version from a Linux kernel file. -+ * -+ * This first sees if we can get the information from the file -+ * content (see below) and if that fails tries to parse the -+ * filename. -+ *) -+and get_kernel_version debug kernel_file = -+ if debug >= 1 then -+ printf "supermin: kernel: kernel version of %s%!" kernel_file; -+ match get_kernel_version_from_file_content kernel_file with -+ | Some version -> -+ if debug >= 1 then printf " = %s (from content)\n%!" version; -+ Some version -+ | None -> -+ (* Try to work it out from the filename instead. *) -+ let basename = Filename.basename kernel_file in -+ if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename -+ then ( -+ let version = String.sub basename 8 (String.length basename - 8) in -+ (* Does the version look reasonable? *) -+ let modpath = "/lib/modules" // version in -+ if has_modpath modpath then ( -+ if debug >= 1 then printf " = %s (from filename)\n%!" version; -+ Some version -+ ) else ( -+ if debug >= 1 then printf " = error, no modpath\n%!"; -+ None -+ ) -+ ) -+ else ( -+ if debug >= 1 then printf " = error, cannot parse filename\n%!"; -+ None -+ ) - - (* Extract the kernel version from a Linux kernel file. - * -- * Returns a string containing the version or [Not_found] if the -+ * Returns a string containing the version or [None] if the - * file can't be read, is not a Linux kernel, or the version can't - * be found. - * -@@ -217,7 +239,7 @@ and get_kernel_version_from_name kernel_name = - * - * Bugs: probably limited to x86 kernels. - *) --and get_kernel_version_from_file file = -+and get_kernel_version_from_file_content file = - try - let chan = open_in file in - let buf = read_string chan 514 4 in -@@ -247,10 +269,12 @@ and get_kernel_version_from_file file = - ) - else raise Not_found - in -- loop 0 -+ let version = loop 0 in -+ Some version - with -- | Sys_error _ -> raise Not_found -- | Invalid_argument _ -> raise Not_found -+ | Not_found -+ | Sys_error _ -+ | Invalid_argument _ -> None - - (* Read an unsigned little endian short at a specified offset in a file. *) - and read_leshort chan offset = --- -2.13.1 - diff --git a/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch b/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch deleted file mode 100644 index bfbdf16..0000000 --- a/0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1cb54ab90e813e148e218cb274c97b08b610e3b9 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 13:09:06 +0100 -Subject: [PATCH 08/10] kernel: Don't allow End_of_file exception to escape if - kernel is bogus (RHBZ#1477758). -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If the kernel file is truncated (zero length or too short) then -functions such as ‘really_input’ raise End_of_file. Unfortunately -this exception could escape and kill the program. What we want to do -instead is to ignore such kernels. The combination of this commit and -the last commit ignores such kernels if they are found in /boot. - -Reported by Charlie Martinez. ---- - src/format_ext2_kernel.ml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 55c5af9..e329adb 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -273,6 +273,7 @@ and get_kernel_version_from_file_content file = - Some version - with - | Not_found -+ | End_of_file - | Sys_error _ - | Invalid_argument _ -> None - --- -2.13.1 - diff --git a/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch b/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch deleted file mode 100644 index a6c0d69..0000000 --- a/0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch +++ /dev/null @@ -1,33 +0,0 @@ -From bc33663a38bc401a5b5883e253cc93b0d3e67ef2 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 13:48:37 +0100 -Subject: [PATCH 09/10] kernel: Simple renaming to make find_kernel_from_* - functions consistent. - -No functional change, just renaming variables. ---- - src/format_ext2_kernel.ml | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index e329adb..44ba035 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -94,9 +94,11 @@ and find_kernel_from_lib_modules debug = - let files = Array.to_list files in - let kernels = - List.map ( -- fun f -> -- let modpath = Filename.dirname f in -- f, Filename.basename f, Filename.basename modpath, modpath -+ fun kernel_file -> -+ let kernel_name = Filename.basename kernel_file in -+ let modpath = Filename.dirname kernel_file in -+ let kernel_version = Filename.basename modpath in -+ kernel_file, kernel_name, kernel_version, modpath - ) files in - List.sort ( - fun (_, _, a, _) (_, _, b, _) -> compare_version b a --- -2.13.1 - diff --git a/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch b/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch deleted file mode 100644 index bd66692..0000000 --- a/0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ea3b3dce6bb77dbe57f91044c30ab49693e88e2b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 3 Aug 2017 13:09:06 +0100 -Subject: [PATCH 10/10] kernel: Reject implausibly small kernels in - /lib/modules (RHBZ#1477758). - -Previous changes will reject truncated / implausibly small kernel -files found under /boot, but because the code that looks for kernels -in /lib/modules works slightly differently it would not work there. -This uses a simple stat check to reject kernels there too. - -Reported by Charlie Martinez. ---- - src/format_ext2_kernel.ml | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 44ba035..d5d529d 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -93,12 +93,16 @@ and find_kernel_from_lib_modules debug = - let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in - let files = Array.to_list files in - let kernels = -- List.map ( -+ filter_map ( - fun kernel_file -> -- let kernel_name = Filename.basename kernel_file in -- let modpath = Filename.dirname kernel_file in -- let kernel_version = Filename.basename modpath in -- kernel_file, kernel_name, kernel_version, modpath -+ let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in -+ if size < 10000 then None -+ else ( -+ let kernel_name = Filename.basename kernel_file in -+ let modpath = Filename.dirname kernel_file in -+ let kernel_version = Filename.basename modpath in -+ Some (kernel_file, kernel_name, kernel_version, modpath) -+ ) - ) files in - List.sort ( - fun (_, _, a, _) (_, _, b, _) -> compare_version b a --- -2.13.1 - diff --git a/sources b/sources index d59c5b9..9b748f8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.1.18.tar.gz) = 5e2d1a86359fd334ba6cfea3bd15c7f4d8ee8ec57db55b191e438bd9e1d22e4c317c7e421966abae4f2409e1c6c2b81c3eef5110e823fefc1102a12c79e15c35 -SHA512 (supermin-5.1.18.tar.gz.sig) = 16adab798fcac6e44318c9ffa08a7096b84eda14f13e1febdbdb7dbbea14594a3fb60d9ca2cfb2c9a723a78dd2cddf972f60bde004d90e167acdadaa2b55cc74 +SHA512 (supermin-5.1.19.tar.gz) = 31098d419425b0229e5c6287bcaf40942d74c950f17c4656f060042eb665676057823196cbce252d11989f86ec2d9c171d0c5f942817809723f6efc447f1529b +SHA512 (supermin-5.1.19.tar.gz.sig) = c49d891f8b95878e262cba8d1a23855467f1231ce018d5159583adb2fa1ff30c02cab50c3afa05b3adcc1cdc111cb3bb42e6123202d2d804d0d79eb590625eec diff --git a/supermin.spec b/supermin.spec index 14ed220..324c7d3 100644 --- a/supermin.spec +++ b/supermin.spec @@ -30,8 +30,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.1.18 -Release: 5%{?dist} +Version: 5.1.19 +Release: 1%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -49,19 +49,6 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif -# All upstream patches since 5.1.18. -Patch0001: 0001-prepare-Add-some-debugging-of-config-files-creating-.patch -# Fix supermin crash with truncated vmlinuz file (RHBZ#1477758). -Patch0002: 0002-kernel-Refactor-code-for-locating-the-kernel.patch -Patch0003: 0003-kernel-Tweak-debug-messages.patch -Patch0004: 0004-kernel-Rearrange-the-order-of-functions.patch -Patch0005: 0005-kernel-Filter-boot-kernels-using-has_modpath-later.patch -Patch0006: 0006-kernel-Change-has_modpath-function-so-it-checks-for-.patch -Patch0007: 0007-kernel-Replace-how-kernel-version-information-is-fou.patch -Patch0008: 0008-kernel-Don-t-allow-End_of_file-exception-to-escape-i.patch -Patch0009: 0009-kernel-Simple-renaming-to-make-find_kernel_from_-fun.patch -Patch0010: 0010-kernel-Reject-implausibly-small-kernels-in-lib-modul.patch - BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -183,6 +170,10 @@ make check || { %changelog +* Tue Sep 19 2017 Richard W.M. Jones - 5.1.19-1 +- New upstream version 5.1.19. +- Remove all patches, now upstream. + * Thu Aug 10 2017 Igor Gnatenko - 5.1.18-5 - Rebuilt for RPM soname bump From ebbe4e3e77d840e33f3838af15de263165cdcbbe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 18:05:45 +0000 Subject: [PATCH 12/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 324c7d3..a34e85e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.19 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 5.1.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Tue Sep 19 2017 Richard W.M. Jones - 5.1.19-1 - New upstream version 5.1.19. - Remove all patches, now upstream. From 0da9aef77a63c5b250c50a34895ced8d835d588a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Feb 2018 08:22:36 +0000 Subject: [PATCH 13/95] Fix bytes/string problems. --- 0001-Fix-Bytes-String-for-OCaml-4.06.patch | 58 ++++++++++++++++++++++ supermin.spec | 8 ++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-Bytes-String-for-OCaml-4.06.patch diff --git a/0001-Fix-Bytes-String-for-OCaml-4.06.patch b/0001-Fix-Bytes-String-for-OCaml-4.06.patch new file mode 100644 index 0000000..4d1408a --- /dev/null +++ b/0001-Fix-Bytes-String-for-OCaml-4.06.patch @@ -0,0 +1,58 @@ +From 5c5eff66dfaccb212b8906e769e40633d8b8f5e4 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 13 Feb 2018 08:20:52 +0000 +Subject: [PATCH] Fix Bytes/String for OCaml 4.06. + +--- + src/format_ext2_kernel.ml | 4 ++-- + src/mode_build.ml | 10 ++++++---- + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index d5d529d..98bff3a 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -290,9 +290,9 @@ and read_leshort chan offset = + + and read_string chan offset len = + seek_in chan offset; +- let buf = String.create len in ++ let buf = Bytes.create len in + really_input chan buf 0 len; +- buf ++ Bytes.to_string buf + + and copy_or_symlink_file copy_kernel src dest = + if not copy_kernel then +diff --git a/src/mode_build.ml b/src/mode_build.ml +index 95869cb..b5f5fa6 100644 +--- a/src/mode_build.ml ++++ b/src/mode_build.ml +@@ -299,9 +299,10 @@ and update_appliance appliance lines = function + (* Determine the [file_type] of [file], or exit with an error. *) + and get_file_type file = + let chan = open_in file in +- let buf = String.create 512 in +- let len = input chan buf 0 (String.length buf) 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-compressed file *) +@@ -335,8 +336,9 @@ and get_file_content file buf len = + and get_compressed_file_content zcat file = + let cmd = sprintf "%s %s" zcat (quote file) in + let chan_out, chan_in, chan_err = open_process_full cmd [||] in +- let buf = String.create 512 in +- let len = input chan_out buf 0 (String.length buf) in ++ let buf = Bytes.create 512 in ++ let len = input chan_out buf 0 (Bytes.length buf) in ++ let buf = Bytes.to_string buf in + (* We're expecting the subprocess to fail because we close the pipe + * early, so: + *) +-- +2.15.1 + diff --git a/supermin.spec b/supermin.spec index a34e85e..c4dec25 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.19 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -49,6 +49,9 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif +# Upstream patch which fixes byte/string problems. +Patch1: 0001-Fix-Bytes-String-for-OCaml-4.06.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -170,6 +173,9 @@ make check || { %changelog +* Tue Feb 13 2018 Richard W.M. Jones - 5.1.19-3 +- Fix bytes/string problems. + * Fri Feb 09 2018 Fedora Release Engineering - 5.1.19-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From fe852db4a49733de8c599a3f405fde028f6e46f2 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 24 Feb 2018 20:26:10 +0100 Subject: [PATCH 14/95] Reenable hardened build The static linking issue has been fixed with an addition to the GCC specs file in redhat-rpm-config-54-1. --- supermin.spec | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index c4dec25..bd5a8bc 100644 --- a/supermin.spec +++ b/supermin.spec @@ -3,11 +3,6 @@ %global debug_package %{nil} %endif -# _hardened_build breaks building the static 'init' binary. -# https://bugzilla.redhat.com/show_bug.cgi?id=1202091 -# https://bugzilla.redhat.com/show_bug.cgi?id=1204162 -%undefine _hardened_build - # On architectures that support it, the default is ``--with dietlibc''. # # To use glibc-static instead, do ``--without dietlibc''. This @@ -31,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.19 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -173,6 +168,9 @@ make check || { %changelog +* Sat Feb 24 2018 Florian Weimer - 5.1.19-4 +- Reenable hardened build + * Tue Feb 13 2018 Richard W.M. Jones - 5.1.19-3 - Fix bytes/string problems. From e3080572296fc6d5cc5b68cfbfde6bc9c6d73049 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 07:00:28 +0000 Subject: [PATCH 15/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index bd5a8bc..47d712a 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.19 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -168,6 +168,9 @@ make check || { %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 5.1.19-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Sat Feb 24 2018 Florian Weimer - 5.1.19-4 - Reenable hardened build From df888023bce4383591c6df0fa83f59956d245683 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 17 Jan 2019 12:33:24 +0000 Subject: [PATCH 16/95] New upstream version 5.1.20. --- 0001-Fix-Bytes-String-for-OCaml-4.06.patch | 58 ---------------------- sources | 4 +- supermin.spec | 10 ++-- 3 files changed, 7 insertions(+), 65 deletions(-) delete mode 100644 0001-Fix-Bytes-String-for-OCaml-4.06.patch diff --git a/0001-Fix-Bytes-String-for-OCaml-4.06.patch b/0001-Fix-Bytes-String-for-OCaml-4.06.patch deleted file mode 100644 index 4d1408a..0000000 --- a/0001-Fix-Bytes-String-for-OCaml-4.06.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 5c5eff66dfaccb212b8906e769e40633d8b8f5e4 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 13 Feb 2018 08:20:52 +0000 -Subject: [PATCH] Fix Bytes/String for OCaml 4.06. - ---- - src/format_ext2_kernel.ml | 4 ++-- - src/mode_build.ml | 10 ++++++---- - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index d5d529d..98bff3a 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -290,9 +290,9 @@ and read_leshort chan offset = - - and read_string chan offset len = - seek_in chan offset; -- let buf = String.create len in -+ let buf = Bytes.create len in - really_input chan buf 0 len; -- buf -+ Bytes.to_string buf - - and copy_or_symlink_file copy_kernel src dest = - if not copy_kernel then -diff --git a/src/mode_build.ml b/src/mode_build.ml -index 95869cb..b5f5fa6 100644 ---- a/src/mode_build.ml -+++ b/src/mode_build.ml -@@ -299,9 +299,10 @@ and update_appliance appliance lines = function - (* Determine the [file_type] of [file], or exit with an error. *) - and get_file_type file = - let chan = open_in file in -- let buf = String.create 512 in -- let len = input chan buf 0 (String.length buf) 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-compressed file *) -@@ -335,8 +336,9 @@ and get_file_content file buf len = - and get_compressed_file_content zcat file = - let cmd = sprintf "%s %s" zcat (quote file) in - let chan_out, chan_in, chan_err = open_process_full cmd [||] in -- let buf = String.create 512 in -- let len = input chan_out buf 0 (String.length buf) in -+ let buf = Bytes.create 512 in -+ let len = input chan_out buf 0 (Bytes.length buf) in -+ let buf = Bytes.to_string buf in - (* We're expecting the subprocess to fail because we close the pipe - * early, so: - *) --- -2.15.1 - diff --git a/sources b/sources index 9b748f8..d77c08a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.1.19.tar.gz) = 31098d419425b0229e5c6287bcaf40942d74c950f17c4656f060042eb665676057823196cbce252d11989f86ec2d9c171d0c5f942817809723f6efc447f1529b -SHA512 (supermin-5.1.19.tar.gz.sig) = c49d891f8b95878e262cba8d1a23855467f1231ce018d5159583adb2fa1ff30c02cab50c3afa05b3adcc1cdc111cb3bb42e6123202d2d804d0d79eb590625eec +SHA512 (supermin-5.1.20.tar.gz) = ccc9ada98593f91399b323f0beb027185874f82547a1df4274c1206a9b6d4465e98b7aef5618274d41fb902747f6843fd2cc6192a4ea8526811261ac5a16848e +SHA512 (supermin-5.1.20.tar.gz.sig) = e7c46fdf4105ffa3f6e02d6ed0b895a9af71470f5c650d129304187b977516343d17a861a9c53934eee559de374623f100f4736426de37ee78d5f5bc82d56096 diff --git a/supermin.spec b/supermin.spec index 47d712a..fd80f75 100644 --- a/supermin.spec +++ b/supermin.spec @@ -25,8 +25,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.1.19 -Release: 5%{?dist} +Version: 5.1.20 +Release: 1%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -44,9 +44,6 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif -# Upstream patch which fixes byte/string problems. -Patch1: 0001-Fix-Bytes-String-for-OCaml-4.06.patch - BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -168,6 +165,9 @@ make check || { %changelog +* Thu Jan 17 2019 Richard W.M. Jones - 5.1.20-1 +- New upstream version 5.1.20. + * Sat Jul 14 2018 Fedora Release Engineering - 5.1.19-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From d24f9edcaa1adce0672d44d17a3f46fe404e873e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 24 Jan 2019 14:43:22 +0000 Subject: [PATCH 17/95] Add upstream patches to diagnose possible F29 issue. --- ...xtend-the-Multiple_matches-exception.patch | 89 +++++++++++++++++++ ...t-Librpm.Multiple_matches-exceptions.patch | 27 ++++++ supermin.spec | 10 ++- 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 0001-rpm-extend-the-Multiple_matches-exception.patch create mode 100644 0002-Print-Librpm.Multiple_matches-exceptions.patch diff --git a/0001-rpm-extend-the-Multiple_matches-exception.patch b/0001-rpm-extend-the-Multiple_matches-exception.patch new file mode 100644 index 0000000..30a69bb --- /dev/null +++ b/0001-rpm-extend-the-Multiple_matches-exception.patch @@ -0,0 +1,89 @@ +From 42955541dc3aa8ae3361f3bd6eb0ae338f307545 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 23 Jan 2019 12:22:19 +0100 +Subject: [PATCH 1/2] rpm: extend the Multiple_matches exception + +Add the package that raised the issue, so it can be used to provide +better diagnostic. +--- + src/librpm-c.c | 15 ++++++++++----- + src/librpm.ml | 4 ++-- + src/librpm.mli | 2 +- + 3 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/src/librpm-c.c b/src/librpm-c.c +index 3bd25a2..75ca4d7 100644 +--- a/src/librpm-c.c ++++ b/src/librpm-c.c +@@ -66,10 +66,15 @@ librpm_handle_closed (void) + } + + static void +-librpm_raise_multiple_matches (int occurrences) ++librpm_raise_multiple_matches (value pkgv, int occurrences) + { +- caml_raise_with_arg (*caml_named_value ("librpm_multiple_matches"), +- Val_int (occurrences)); ++ CAMLparam1 (pkgv); ++ ++ value args[] = { pkgv, Val_int (occurrences) }; ++ caml_raise_with_args (*caml_named_value ("librpm_multiple_matches"), ++ 2, args); ++ ++ CAMLnoreturn; + } + + #define Librpm_val(v) (*((struct librpm_data *)Data_custom_val(v))) +@@ -296,7 +301,7 @@ supermin_rpm_pkg_requires (value rpmv, value pkgv) + fflush (stdout); + } + if (count != 1) +- librpm_raise_multiple_matches (count); ++ librpm_raise_multiple_matches (pkgv, count); + + h = rpmdbNextIterator (iter); + assert (h != NULL); +@@ -413,7 +418,7 @@ supermin_rpm_pkg_filelist (value rpmv, value pkgv) + fflush (stdout); + } + if (count != 1) +- librpm_raise_multiple_matches (count); ++ librpm_raise_multiple_matches (pkgv, count); + + h = rpmdbNextIterator (iter); + assert (h != NULL); +diff --git a/src/librpm.ml b/src/librpm.ml +index 4eeba77..b6f9ff8 100644 +--- a/src/librpm.ml ++++ b/src/librpm.ml +@@ -23,7 +23,7 @@ external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" + + type t + +-exception Multiple_matches of int ++exception Multiple_matches of string * int + + external rpm_open : ?debug:int -> t = "supermin_rpm_open" + external rpm_close : t -> unit = "supermin_rpm_close" +@@ -49,4 +49,4 @@ external rpm_pkg_whatprovides : t -> string -> string array = "supermin_rpm_pkg_ + external rpm_pkg_filelist : t -> string -> rpmfile_t array = "supermin_rpm_pkg_filelist" + + let () = +- Callback.register_exception "librpm_multiple_matches" (Multiple_matches 0) ++ Callback.register_exception "librpm_multiple_matches" (Multiple_matches ("", 0)) +diff --git a/src/librpm.mli b/src/librpm.mli +index 5229be6..53b4b2c 100644 +--- a/src/librpm.mli ++++ b/src/librpm.mli +@@ -31,7 +31,7 @@ val rpm_vercmp : string -> string -> int + type t + (** The librpm handle. *) + +-exception Multiple_matches of int ++exception Multiple_matches of string * int + + val rpm_open : ?debug:int -> t + (** Open the librpm (transaction set) handle. *) +-- +2.20.1 + diff --git a/0002-Print-Librpm.Multiple_matches-exceptions.patch b/0002-Print-Librpm.Multiple_matches-exceptions.patch new file mode 100644 index 0000000..f13620b --- /dev/null +++ b/0002-Print-Librpm.Multiple_matches-exceptions.patch @@ -0,0 +1,27 @@ +From 36878992ebdd08f0f9b37017f347f5eab18ce9ed Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 23 Jan 2019 12:23:02 +0100 +Subject: [PATCH 2/2] Print Librpm.Multiple_matches exceptions + +Print a better diagnostic for them, so it is more clear which package +is detected as present multiple times. +--- + src/supermin.ml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/supermin.ml b/src/supermin.ml +index f9798f9..71d8b64 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -298,6 +298,8 @@ let () = + error "error: %s: %s: %s" fname (Unix.error_message code) param + | Failure msg -> (* from failwith/failwithf *) + error "failure: %s" msg ++ | Librpm.Multiple_matches (package, count) -> (* from librpm *) ++ error "RPM error: %d occurrences for %s" count package + | Invalid_argument msg -> (* probably should never happen *) + error "internal error: invalid argument: %s" msg + | Assert_failure (file, line, char) -> (* should never happen *) +-- +2.20.1 + diff --git a/supermin.spec b/supermin.spec index fd80f75..5d6a39c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -44,6 +44,11 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif +# Upstream patches to diagnose possible F29 issue: +# https://www.redhat.com/archives/libguestfs/2019-January/thread.html#00168 +Patch1: 0001-rpm-extend-the-Multiple_matches-exception.patch +Patch2: 0002-Print-Librpm.Multiple_matches-exceptions.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -165,6 +170,9 @@ make check || { %changelog +* Thu Jan 24 2019 Richard W.M. Jones - 5.1.20-2 +- Add upstream patches to diagnose possible F29 issue. + * Thu Jan 17 2019 Richard W.M. Jones - 5.1.20-1 - New upstream version 5.1.20. From 485c142139ca8a6e9cb94f0b6604899a50b90625 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 09:00:05 +0000 Subject: [PATCH 18/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 5d6a39c..0526f8c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 5.1.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Thu Jan 24 2019 Richard W.M. Jones - 5.1.20-2 - Add upstream patches to diagnose possible F29 issue. From 13f73711adba185ddf9625a175b05d0067556c53 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 10 Jun 2019 17:42:06 +0200 Subject: [PATCH 19/95] Rebuild for RPM 4.15 Signed-off-by: Igor Gnatenko --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 0526f8c..b5dd79e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Mon Jun 10 15:42:06 CET 2019 Igor Gnatenko - 5.1.20-4 +- Rebuild for RPM 4.15 + * Sun Feb 03 2019 Fedora Release Engineering - 5.1.20-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 8d2c36df46db7bc93d373ade3c30ed887a278f94 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 11 Jun 2019 00:13:23 +0200 Subject: [PATCH 20/95] Rebuild for RPM 4.15 Signed-off-by: Igor Gnatenko --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index b5dd79e..c5d6bf1 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko - 5.1.20-5 +- Rebuild for RPM 4.15 + * Mon Jun 10 15:42:06 CET 2019 Igor Gnatenko - 5.1.20-4 - Rebuild for RPM 4.15 From b07e68e222423d4faf4af2432f1f4ba647bafa08 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 00:35:39 +0000 Subject: [PATCH 21/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index c5d6bf1..595db59 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -170,6 +170,9 @@ make check || { %changelog +* Sat Jul 27 2019 Fedora Release Engineering - 5.1.20-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko - 5.1.20-5 - Rebuild for RPM 4.15 From dc912754847ff7caf5d2a2ee74b1659ed1364619 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 27 Jul 2019 23:57:53 +0100 Subject: [PATCH 22/95] Disable package on i686 because no kernel. --- supermin.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 595db59..18e663b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,13 +26,15 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 ExclusiveArch: x86_64 %endif +ExcludeArch: %{ix86} + URL: http://people.redhat.com/~rjones/supermin/ Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz %if 0%{verify_tarball_signature} @@ -170,6 +172,9 @@ make check || { %changelog +* Sat Jul 27 2019 Richard W.M. Jones - 5.1.20-7 +- Disable package on i686 because no kernel. + * Sat Jul 27 2019 Fedora Release Engineering - 5.1.20-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 37fd86cc25a5088633c531f9874793670d4fbc7d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 28 Jul 2019 10:13:39 +0100 Subject: [PATCH 23/95] Skip tests on armv7, mke2fs is broken there. --- supermin.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supermin.spec b/supermin.spec index 18e663b..ad51634 100644 --- a/supermin.spec +++ b/supermin.spec @@ -20,6 +20,10 @@ %bcond_with dietlibc %endif +# Architectures that cannot run the tests. +# armv7: https://bugzilla.redhat.com/show_bug.cgi?id=1733743 +%global no_test_arches %{arm} + # Whether we should verify tarball signature with GPGv2. %global verify_tarball_signature 1 @@ -146,6 +150,7 @@ install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{_rpmconfigdir}/ %check +%ifnarch %{no_test_arches} # Skip execstack test where it is known to fail. %if 0%{?fedora} <= 20 @@ -159,6 +164,7 @@ make check || { exit 1 } +%endif %files %doc COPYING README examples/build-basic-vm.sh From 0496c3feb9a7e3c221163dc66432648eda878759 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Jul 2019 18:38:03 +0100 Subject: [PATCH 24/95] Revert "Skip tests on armv7, mke2fs is broken there." This reverts commit 37fd86cc25a5088633c531f9874793670d4fbc7d. --- supermin.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index ad51634..18e663b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -20,10 +20,6 @@ %bcond_with dietlibc %endif -# Architectures that cannot run the tests. -# armv7: https://bugzilla.redhat.com/show_bug.cgi?id=1733743 -%global no_test_arches %{arm} - # Whether we should verify tarball signature with GPGv2. %global verify_tarball_signature 1 @@ -150,7 +146,6 @@ install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{_rpmconfigdir}/ %check -%ifnarch %{no_test_arches} # Skip execstack test where it is known to fail. %if 0%{?fedora} <= 20 @@ -164,7 +159,6 @@ make check || { exit 1 } -%endif %files %doc COPYING README examples/build-basic-vm.sh From 09708b9ca8ecf0b84051c76ebe5fabe0135751ef Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Jul 2019 18:39:29 +0100 Subject: [PATCH 25/95] OCaml 4.08.1 (rc2) rebuild. --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 18e663b..fc4bb8b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -172,6 +172,9 @@ make check || { %changelog +* Wed Jul 31 2019 Richard W.M. Jones - 5.1.20-8 +- OCaml 4.08.1 (rc2) rebuild. + * Sat Jul 27 2019 Richard W.M. Jones - 5.1.20-7 - Disable package on i686 because no kernel. From 7a88a126612115eed742860f742155c705d08997 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 27 Nov 2019 11:05:31 +0000 Subject: [PATCH 26/95] Use gpgverify macro instead of explicit gpgv2 command. --- supermin.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/supermin.spec b/supermin.spec index fc4bb8b..4d0ebb4 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -121,8 +121,7 @@ from supermin appliances. %prep %if 0%{verify_tarball_signature} -tmphome="$(mktemp -d)" -gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0} +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %endif %setup -q %autopatch -p1 @@ -172,6 +171,9 @@ make check || { %changelog +* Wed Nov 27 2019 Richard W.M. Jones - 5.1.20-9 +- Use gpgverify macro instead of explicit gpgv2 command. + * Wed Jul 31 2019 Richard W.M. Jones - 5.1.20-8 - OCaml 4.08.1 (rc2) rebuild. From ad7511ce3190410b2651ec3654952f917ae3533f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 28 Nov 2019 13:36:04 +0000 Subject: [PATCH 27/95] Add upstream patch to fix symlinks on recent kernels (RHBZ#1770304). --- ...ymbolic-links-correctly-RHBZ-1770304.patch | 58 +++++++++++++++++++ supermin.spec | 9 ++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch diff --git a/0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch b/0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch new file mode 100644 index 0000000..85bc272 --- /dev/null +++ b/0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch @@ -0,0 +1,58 @@ +From 487e8c964078f823646d3b0584745ab7d0ef99ca Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 26 Nov 2019 09:01:21 +0000 +Subject: [PATCH] ext2: Build symbolic links correctly (RHBZ#1770304). + +We created symlinks in two steps, by creating the empty inode and then +calling ext2fs_symlink to populate it. This created broken symlinks +where the directory name contained a / character, eg: + +lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin +lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib +lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64 +lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin +lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin + +This breaks with Linux >= 5.3.8, most likely because of extra +validation now being done at the VFS layer: + +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/readdir.c?id=8a23eb804ca4f2be909e372cf5a9e7b30ae476cd + +It's unnecessary to create the empty inode since ext2fs_symlink can +create the inode for us perfectly fine if we simply pass ino == 0, and +it creates them correctly too. + +Thanks: Toolybird for identifying the problem and kernel patch. +--- + src/ext2fs-c.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c +index e8ab972..8903f74 100644 +--- a/src/ext2fs-c.c ++++ b/src/ext2fs-c.c +@@ -782,12 +782,6 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) + } + /* Create a symlink. */ + else if (S_ISLNK (statbuf.st_mode)) { +- ext2_ino_t ino; +- ext2_empty_inode (data->fs, dir_ino, dirname, basename, +- statbuf.st_mode, statbuf.st_uid, statbuf.st_gid, +- statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, +- 0, 0, EXT2_FT_SYMLINK, &ino); +- + char *buf = malloc (statbuf.st_size+1); + if (buf == NULL) + caml_raise_out_of_memory (); +@@ -797,7 +791,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) + if (r > statbuf.st_size) + r = statbuf.st_size; + buf[r] = '\0'; +- ext2fs_symlink (data->fs, dir_ino, ino, dest, buf); ++ ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); + free (buf); + } + /* Create directory. */ +-- +2.23.0 + diff --git a/supermin.spec b/supermin.spec index 4d0ebb4..4df1f69 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -51,6 +51,10 @@ Source2: libguestfs.keyring Patch1: 0001-rpm-extend-the-Multiple_matches-exception.patch Patch2: 0002-Print-Librpm.Multiple_matches-exceptions.patch +# Upstream patch to fix symlinks. +# https://bugzilla.redhat.com/show_bug.cgi?id=1770304 +Patch3: 0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -171,6 +175,9 @@ make check || { %changelog +* Thu Nov 28 2019 Richard W.M. Jones - 5.1.20-10 +- Add upstream patch to fix symlinks on recent kernels (RHBZ#1770304). + * Wed Nov 27 2019 Richard W.M. Jones - 5.1.20-9 - Use gpgverify macro instead of explicit gpgv2 command. From 29afe986863f4dfb960bd9261f7f9a774e302e1a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 10 Dec 2019 18:49:01 +0000 Subject: [PATCH 28/95] Add further patch to fix symlinks (RHBZ#1770304). Add all patches since 5.1.20 was released. --- ...xtend-the-Multiple_matches-exception.patch | 4 +- ...t-Librpm.Multiple_matches-exceptions.patch | 4 +- ...mand-mv-to-rename-old-output-directo.patch | 38 ++++++ ...dd-OpenMandriva-support-RHBZ-1694267.patch | 128 ++++++++++++++++++ 0005-rpm-do-not-unpack-parameters.patch | 33 +++++ 0006-rpm-fix-version-comparison.patch | 70 ++++++++++ 0007-rpm-query-the-RPM-architecture.patch | 90 ++++++++++++ ...rpm-fix-package-sorting-RHBZ-1696822.patch | 49 +++++++ ...unused-compare_architecture-function.patch | 66 +++++++++ ...mmy-supermin_rpm_get_arch-implementa.patch | 33 +++++ ...ymbolic-links-correctly-RHBZ-1770304.patch | 2 +- ...ctory-when-adding-symlinks-RHBZ-1770.patch | 42 ++++++ supermin.spec | 27 ++-- 13 files changed, 572 insertions(+), 14 deletions(-) create mode 100644 0003-Use-external-command-mv-to-rename-old-output-directo.patch create mode 100644 0004-Add-OpenMandriva-support-RHBZ-1694267.patch create mode 100644 0005-rpm-do-not-unpack-parameters.patch create mode 100644 0006-rpm-fix-version-comparison.patch create mode 100644 0007-rpm-query-the-RPM-architecture.patch create mode 100644 0008-rpm-fix-package-sorting-RHBZ-1696822.patch create mode 100644 0009-utils-remove-unused-compare_architecture-function.patch create mode 100644 0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch rename 0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch => 0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch (96%) create mode 100644 0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch diff --git a/0001-rpm-extend-the-Multiple_matches-exception.patch b/0001-rpm-extend-the-Multiple_matches-exception.patch index 30a69bb..35516ef 100644 --- a/0001-rpm-extend-the-Multiple_matches-exception.patch +++ b/0001-rpm-extend-the-Multiple_matches-exception.patch @@ -1,7 +1,7 @@ From 42955541dc3aa8ae3361f3bd6eb0ae338f307545 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 23 Jan 2019 12:22:19 +0100 -Subject: [PATCH 1/2] rpm: extend the Multiple_matches exception +Subject: [PATCH 01/12] rpm: extend the Multiple_matches exception Add the package that raised the issue, so it can be used to provide better diagnostic. @@ -85,5 +85,5 @@ index 5229be6..53b4b2c 100644 val rpm_open : ?debug:int -> t (** Open the librpm (transaction set) handle. *) -- -2.20.1 +2.23.0 diff --git a/0002-Print-Librpm.Multiple_matches-exceptions.patch b/0002-Print-Librpm.Multiple_matches-exceptions.patch index f13620b..47ff7f3 100644 --- a/0002-Print-Librpm.Multiple_matches-exceptions.patch +++ b/0002-Print-Librpm.Multiple_matches-exceptions.patch @@ -1,7 +1,7 @@ From 36878992ebdd08f0f9b37017f347f5eab18ce9ed Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 23 Jan 2019 12:23:02 +0100 -Subject: [PATCH 2/2] Print Librpm.Multiple_matches exceptions +Subject: [PATCH 02/12] Print Librpm.Multiple_matches exceptions Print a better diagnostic for them, so it is more clear which package is detected as present multiple times. @@ -23,5 +23,5 @@ index f9798f9..71d8b64 100644 error "internal error: invalid argument: %s" msg | Assert_failure (file, line, char) -> (* should never happen *) -- -2.20.1 +2.23.0 diff --git a/0003-Use-external-command-mv-to-rename-old-output-directo.patch b/0003-Use-external-command-mv-to-rename-old-output-directo.patch new file mode 100644 index 0000000..1806bf5 --- /dev/null +++ b/0003-Use-external-command-mv-to-rename-old-output-directo.patch @@ -0,0 +1,38 @@ +From 6579cf5f72d5de345ae1cc97d0344dfa1771460a Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 28 Jan 2019 22:20:33 +0000 +Subject: [PATCH 03/12] Use external command mv to rename old output directory + (RHBZ#1670191). + +See https://bugzilla.redhat.com/show_bug.cgi?id=1670191#c0 +for explanation. + +Thanks: Sam Eiderman +--- + src/supermin.ml | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/src/supermin.ml b/src/supermin.ml +index 71d8b64..7c7135b3 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -264,12 +264,10 @@ appliance automatically. + + (* Delete the old output directory if it exists. *) + let old_outputdir = +- try +- let old_outputdir = outputdir ^ "." ^ string_random8 () in +- rename outputdir old_outputdir; +- Some old_outputdir +- with +- Unix_error _ -> None in ++ let old_outputdir = outputdir ^ "." ^ string_random8 () in ++ let cmd = sprintf "mv %s %s 2>/dev/null" ++ (quote outputdir) (quote old_outputdir) in ++ if Sys.command cmd == 0 then Some old_outputdir else None in + + if debug >= 1 then + printf "supermin: renaming %s to %s\n%!" new_outputdir outputdir; +-- +2.23.0 + diff --git a/0004-Add-OpenMandriva-support-RHBZ-1694267.patch b/0004-Add-OpenMandriva-support-RHBZ-1694267.patch new file mode 100644 index 0000000..4fa888d --- /dev/null +++ b/0004-Add-OpenMandriva-support-RHBZ-1694267.patch @@ -0,0 +1,128 @@ +From bca633bfd14aeeb8ae1331d468db75d1ef31f9ff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +Date: Tue, 2 Apr 2019 08:28:06 +0100 +Subject: [PATCH 04/12] Add OpenMandriva support (RHBZ#1694267). + +--- + src/ph_rpm.ml | 28 +++++++++++++++++++++++++--- + tests/test-harder.sh | 31 +++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+), 3 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 46b7f1f..3ff5c94 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -50,6 +50,12 @@ let mageia_detect () = + (Os_release.get_id () = "mageia" || + try (stat "/etc/mageia-release").st_kind = S_REG with Unix_error _ -> false) + ++let openmandriva_detect () = ++ Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && ++ ((Config.urpmi <> "no" && Config.fakeroot <> "no") || Config.dnf <> "no") && ++ (Os_release.get_id () = "openmandriva" || ++ try (stat "/etc/openmandriva-release").st_kind = S_REG with Unix_error _ -> false) ++ + let ibm_powerkvm_detect () = + Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && + Config.yumdownloader <> "no" && +@@ -386,17 +392,27 @@ and opensuse_download_all_packages pkgs dir = + + rpm_unpack tdir dir + ++and openmandriva_download_all_packages pkgs dir = ++ let tdir = !settings.tmpdir // string_random8 () in ++ ++ if Config.dnf <> "no" then ++ download_all_packages_with_dnf pkgs dir tdir ++ else (* Config.urpmi <> "no" && Config.fakeroot <> "no" *) ++ download_all_packages_with_urpmi pkgs dir tdir; ++ ++ rpm_unpack tdir dir ++ + and mageia_download_all_packages pkgs dir = + let tdir = !settings.tmpdir // string_random8 () in + + if Config.dnf <> "no" then + download_all_packages_with_dnf pkgs dir tdir + else (* Config.urpmi <> "no" && Config.fakeroot <> "no" *) +- mageia_download_all_packages_with_urpmi pkgs dir tdir; ++ download_all_packages_with_urpmi pkgs dir tdir; + + rpm_unpack tdir dir + +-and mageia_download_all_packages_with_urpmi pkgs dir tdir = ++and download_all_packages_with_urpmi pkgs dir tdir = + let rpms = List.map rpm_package_name (PackageSet.elements pkgs) in + + let cmd = +@@ -484,4 +500,10 @@ let () = + ph_detect = mageia_detect; + ph_download_package = PHDownloadAllPackages mageia_download_all_packages; + } in +- register_package_handler "mageia" "rpm" mageia ++ register_package_handler "mageia" "rpm" mageia; ++ let openmandriva = { ++ fedora with ++ ph_detect = openmandriva_detect; ++ ph_download_package = PHDownloadAllPackages openmandriva_download_all_packages; ++ } in ++ register_package_handler "openmandriva" "rpm" openmandriva +diff --git a/tests/test-harder.sh b/tests/test-harder.sh +index c827f13..aceef21 100755 +--- a/tests/test-harder.sh ++++ b/tests/test-harder.sh +@@ -31,6 +31,7 @@ if [ -f /etc/os-release ]; then + fedora|rhel|centos) distro=redhat ;; + opensuse*|sled|sles) distro=suse ;; + ubuntu) distro=debian ;; ++ openmandriva) distro=openmandriva ;; + esac + elif [ -f /etc/arch-release ]; then + distro=arch +@@ -77,6 +78,9 @@ case $distro in + ibm-powerkvm) + pkgs="augeas hivex tar" + ;; ++ openmandriva) ++ pkgs="augeas hivex rpm" ++ ;; + *) + echo "Unhandled distro '$distro'" + exit 77 +@@ -153,6 +157,33 @@ case $distro in + exit 1 + fi + ;; ++ openmandriva) ++ if [ ! -x $d2/usr/bin/augtool ]; then ++ echo "$0: $distro: augtool binary not installed in chroot" ++ ls -lR $d2 ++ exit 1 ++ fi ++ if [ "$(find $d2/lib* $d2/usr/lib* -name libaugeas.so.0 | wc -l)" -lt 1 ]; then ++ echo "$0: $distro: augeas library not installed in chroot" ++ ls -lR $d2 ++ exit 1 ++ fi ++ if [ ! -x $d2/usr/bin/hivexget ]; then ++ echo "$0: $distro: hivexget binary not installed in chroot" ++ ls -lR $d2 ++ exit 1 ++ fi ++ if [ "$(find $d2/usr/lib* -name libhivex.so.0 | wc -l)" -lt 1 ]; then ++ echo "$0: $distro: hivex library not installed in chroot" ++ ls -lR $d2 ++ exit 1 ++ fi ++ if [ ! -x $d2/bin/rpm ]; then ++ echo "$0: $distro: rpm binary not installed in chroot" ++ ls -lR $d2 ++ exit 1 ++ fi ++ ;; + redhat) + if [ ! -x $d2/usr/bin/augtool ]; then + echo "$0: $distro: augtool binary not installed in chroot" +-- +2.23.0 + diff --git a/0005-rpm-do-not-unpack-parameters.patch b/0005-rpm-do-not-unpack-parameters.patch new file mode 100644 index 0000000..4242c0c --- /dev/null +++ b/0005-rpm-do-not-unpack-parameters.patch @@ -0,0 +1,33 @@ +From 941f72d05302d265af763c7f8ed6b999e4f85eeb Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Apr 2019 11:58:49 +0200 +Subject: [PATCH 05/12] rpm: do not unpack parameters + +They will be used as parameters again soon. + +This has no behaviour changes. +--- + src/ph_rpm.ml | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 3ff5c94..6769e7b 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -144,10 +144,10 @@ let rpm_package_of_string str = + * interested in the highest version with the best + * architecture. + *) +- let cmp { version = v1; arch = a1 } { version = v2; arch = a2 } = +- let i = rpm_vercmp v2 v1 in ++ let cmp pkg1 pkg2 = ++ let i = rpm_vercmp pkg2.version pkg1.version in + if i <> 0 then i +- else compare_architecture a2 a1 ++ else compare_architecture pkg2.arch pkg1.arch + in + let rpms = List.sort cmp rpms in + List.hd rpms +-- +2.23.0 + diff --git a/0006-rpm-fix-version-comparison.patch b/0006-rpm-fix-version-comparison.patch new file mode 100644 index 0000000..d2f646c --- /dev/null +++ b/0006-rpm-fix-version-comparison.patch @@ -0,0 +1,70 @@ +From de075776722741a67b0956f36a6357fcedd66ae0 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Apr 2019 12:13:07 +0200 +Subject: [PATCH 06/12] rpm: fix version comparison + +When comparing two RPMs, also the epoch, and the release must be taken +into account. Hence, add a new helper to get the EVR string of a +package, and use it when sorting each list of installed packages. + +The mapping is done to avoid recreating the EVR strings at every +comparison. +--- + src/ph_rpm.ml | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 6769e7b..a8bcf7c 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -136,21 +136,44 @@ let rpm_of_pkg, pkg_of_rpm = get_memo_functions () + (* Memo of rpm_package_of_string. *) + let rpmh = Hashtbl.create 13 + ++let rpm_to_evr_string rpm = ++ (* In RPM < 4.11 query commands that use the epoch number in the ++ * package name did not work. ++ * ++ * For example: ++ * RHEL 6 (rpm 4.8.0): ++ * $ rpm -q tar-2:1.23-11.el6.x86_64 ++ * package tar-2:1.23-11.el6.x86_64 is not installed ++ * Fedora 20 (rpm 4.11.2): ++ * $ rpm -q tar-2:1.26-30.fc20.x86_64 ++ * tar-1.26-30.fc20.x86_64 ++ * ++ *) ++ let is_rpm_lt_4_11 = ++ !rpm_major < 4 || (!rpm_major = 4 && !rpm_minor < 11) in ++ ++ if is_rpm_lt_4_11 || rpm.epoch = 0 then ++ sprintf "%s-%s" rpm.version rpm.release ++ else ++ sprintf "%d:%s-%s" ++ rpm.epoch rpm.version rpm.release ++ + let rpm_package_of_string str = + let query rpm = + let rpms = Array.to_list (rpm_installed (get_rpm ()) rpm) in ++ let rpms = List.map (fun rpm -> (rpm, rpm_to_evr_string rpm)) rpms in + (* RPM will return multiple hits when either multiple versions or + * multiple arches are installed at the same time. We are only + * interested in the highest version with the best + * architecture. + *) +- let cmp pkg1 pkg2 = +- let i = rpm_vercmp pkg2.version pkg1.version in ++ let cmp (pkg1, evr1) (pkg2, evr2) = ++ let i = rpm_vercmp evr2 evr2 in + if i <> 0 then i + else compare_architecture pkg2.arch pkg1.arch + in + let rpms = List.sort cmp rpms in +- List.hd rpms ++ fst (List.hd rpms) + in + + try +-- +2.23.0 + diff --git a/0007-rpm-query-the-RPM-architecture.patch b/0007-rpm-query-the-RPM-architecture.patch new file mode 100644 index 0000000..d0b4f0e --- /dev/null +++ b/0007-rpm-query-the-RPM-architecture.patch @@ -0,0 +1,90 @@ +From e57e988c39aca015100fb92377dbd8d114c0bece Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Apr 2019 12:26:11 +0200 +Subject: [PATCH 07/12] rpm: query the RPM architecture + +Query the RPM library for the current architecture of RPM, storing it +for later use, and printing it to the debug output. +--- + src/librpm-c.c | 10 ++++++++++ + src/librpm.ml | 1 + + src/librpm.mli | 3 +++ + src/ph_rpm.ml | 8 ++++++-- + 4 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/src/librpm-c.c b/src/librpm-c.c +index 75ca4d7..2e2f048 100644 +--- a/src/librpm-c.c ++++ b/src/librpm-c.c +@@ -132,6 +132,16 @@ supermin_rpm_vercmp (value av, value bv) + return Val_int (rpmvercmp (String_val (av), String_val (bv))); + } + ++value ++supermin_rpm_get_arch (value unit) ++{ ++ const char *str; ++ ++ rpmGetArchInfo (&str, NULL); ++ ++ return caml_copy_string (str); ++} ++ + value + supermin_rpm_open (value debugv) + { +diff --git a/src/librpm.ml b/src/librpm.ml +index b6f9ff8..c987e21 100644 +--- a/src/librpm.ml ++++ b/src/librpm.ml +@@ -20,6 +20,7 @@ external rpm_is_available : unit -> bool = "supermin_rpm_is_available" "noalloc" + + external rpm_version : unit -> string = "supermin_rpm_version" + external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" ++external rpm_get_arch : unit -> string = "supermin_rpm_get_arch" + + type t + +diff --git a/src/librpm.mli b/src/librpm.mli +index 53b4b2c..c0d7bdf 100644 +--- a/src/librpm.mli ++++ b/src/librpm.mli +@@ -28,6 +28,9 @@ val rpm_version : unit -> string + val rpm_vercmp : string -> string -> int + (** Compare two RPM version strings using RPM version compare rules. *) + ++val rpm_get_arch : unit -> string ++(** The current main RPM architecture. *) ++ + type t + (** The librpm handle. *) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index a8bcf7c..e27d226 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -64,7 +64,7 @@ let ibm_powerkvm_detect () = + with Unix_error _ -> false + + let settings = ref no_settings +-let rpm_major, rpm_minor = ref 0, ref 0 ++let rpm_major, rpm_minor, rpm_arch = ref 0, ref 0, ref "" + let zypper_major, zypper_minor, zypper_patch = ref 0, ref 0, ref 0 + let t = ref None + +@@ -93,7 +93,11 @@ let rec rpm_init s = + if !settings.debug >= 1 then + printf "supermin: rpm: detected RPM version %d.%d\n" major minor; + +- t := Some (rpm_open ~debug:!settings.debug) ++ t := Some (rpm_open ~debug:!settings.debug); ++ ++ rpm_arch := rpm_get_arch (); ++ if !settings.debug >= 1 then ++ printf "supermin: rpm: detected RPM architecture %s\n" !rpm_arch + + and opensuse_init s = + rpm_init s; +-- +2.23.0 + diff --git a/0008-rpm-fix-package-sorting-RHBZ-1696822.patch b/0008-rpm-fix-package-sorting-RHBZ-1696822.patch new file mode 100644 index 0000000..d787252 --- /dev/null +++ b/0008-rpm-fix-package-sorting-RHBZ-1696822.patch @@ -0,0 +1,49 @@ +From 72735dd11c83eb59d90e04b3c1e580af43b1ba0a Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Apr 2019 12:38:46 +0200 +Subject: [PATCH 08/12] rpm: fix package sorting (RHBZ#1696822) + +The sorting algorithm for RPMs sorted this way: +- before the packages with the higher versions +- among the packages with the version version, first noarch packages, + then 64bit packages, and then 32bit packages +This was broken in at least two ways: +- the higher installed version may not be of the same host architecture +- if the host architecture is 32bit, and there is a 64bit package of a + 32bit installed one, the 64bit version was preferred + +Instead: +- first sort by architecture, preferring noarch packages, and + packages of the host architecture +- then sort by version + +This way, the higher version of the host architecture is preferred, +otherwise the higher version of any foreign architecture is chosen. +--- + src/ph_rpm.ml | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index e27d226..dbe3bda 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -172,9 +172,14 @@ let rpm_package_of_string str = + * architecture. + *) + let cmp (pkg1, evr1) (pkg2, evr2) = +- let i = rpm_vercmp evr2 evr2 in ++ let weight_of_arch = function ++ | "noarch" -> 100 ++ | a when a = !rpm_arch -> 50 ++ | _ -> 0 ++ in ++ let i = compare (weight_of_arch pkg2.arch) (weight_of_arch pkg1.arch) in + if i <> 0 then i +- else compare_architecture pkg2.arch pkg1.arch ++ else rpm_vercmp evr2 evr2 + in + let rpms = List.sort cmp rpms in + fst (List.hd rpms) +-- +2.23.0 + diff --git a/0009-utils-remove-unused-compare_architecture-function.patch b/0009-utils-remove-unused-compare_architecture-function.patch new file mode 100644 index 0000000..299ea19 --- /dev/null +++ b/0009-utils-remove-unused-compare_architecture-function.patch @@ -0,0 +1,66 @@ +From b2401285cd3e3d42006fc164ef1f046cc35a50c4 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Apr 2019 12:47:52 +0200 +Subject: [PATCH 09/12] utils: remove unused 'compare_architecture' function + +This was used only in the RPM package handler. +--- + src/utils.ml | 27 --------------------------- + src/utils.mli | 3 --- + 2 files changed, 30 deletions(-) + +diff --git a/src/utils.ml b/src/utils.ml +index f85418f..b25df88 100644 +--- a/src/utils.ml ++++ b/src/utils.ml +@@ -172,33 +172,6 @@ and split_version = function + ) in + first :: split_version rest + +-let compare_architecture a1 a2 = +- let index_of_architecture = function +- | "noarch" | "all" -> 100 +- | "i386" | "i486" | "i586" | "i686" | "x86_32" | "x86-32" -> 32 +- | "x86_64" | "x86-64" | "amd64" -> 64 +- | "armel" | "armhf" -> 32 +- | "aarch64" -> 64 +- | a when string_prefix "armv5" a -> 32 +- | a when string_prefix "armv6" a -> 32 +- | a when string_prefix "armv7" a -> 32 +- | a when string_prefix "armv8" a -> 64 +- | "hppa" | "parisc" -> 32 +- | "hppa64" | "parisc64" -> 64 +- | "ppc" | "ppc32" -> 32 +- | a when string_prefix "ppc64" a -> 64 +- | "sparc" | "sparc32" -> 32 +- | "sparc64" -> 64 +- | "ia64" -> 64 +- | "s390" -> 32 +- | "s390x" -> 64 +- | "alpha" -> 64 +- | a -> +- error "missing support for architecture '%s'\nIt may need to be added to supermin." +- a +- in +- compare (index_of_architecture a1) (index_of_architecture a2) +- + (* Parse a size field, eg. "10G". *) + let parse_size = + let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in +diff --git a/src/utils.mli b/src/utils.mli +index 7837dbb..b86586a 100644 +--- a/src/utils.mli ++++ b/src/utils.mli +@@ -86,9 +86,6 @@ val filter_map : ('a -> 'b option) -> 'a list -> 'b list + val compare_version : string -> string -> int + (** Compare two version-like strings. *) + +-val compare_architecture : string -> string -> int +- (** Compare two architecture strings. *) +- + val parse_size : string -> int64 + (** Parse a size field, eg. [10G] *) + +-- +2.23.0 + diff --git a/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch b/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch new file mode 100644 index 0000000..22ffd97 --- /dev/null +++ b/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch @@ -0,0 +1,33 @@ +From c97b3917068597a0e68e88d9a905da766ade40da Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 24 May 2019 13:31:07 +0200 +Subject: [PATCH 10/12] rpm: provide a dummy supermin_rpm_get_arch + implementation + +Make sure supermin builds fine also without the RPM development files. + +Fixes commit e57e988c39aca015100fb92377dbd8d114c0bece. +--- + src/librpm-c.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/librpm-c.c b/src/librpm-c.c +index 2e2f048..523fe0b 100644 +--- a/src/librpm-c.c ++++ b/src/librpm-c.c +@@ -483,6 +483,12 @@ supermin_rpm_vercmp (value av, value bv) + abort (); + } + ++value ++supermin_rpm_get_arch (value unit) ++{ ++ abort (); ++} ++ + value + supermin_rpm_open (value debugv) + { +-- +2.23.0 + diff --git a/0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch b/0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch similarity index 96% rename from 0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch rename to 0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch index 85bc272..bddf338 100644 --- a/0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch +++ b/0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch @@ -1,7 +1,7 @@ From 487e8c964078f823646d3b0584745ab7d0ef99ca Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 26 Nov 2019 09:01:21 +0000 -Subject: [PATCH] ext2: Build symbolic links correctly (RHBZ#1770304). +Subject: [PATCH 11/12] ext2: Build symbolic links correctly (RHBZ#1770304). We created symlinks in two steps, by creating the empty inode and then calling ext2fs_symlink to populate it. This created broken symlinks diff --git a/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch b/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch new file mode 100644 index 0000000..5802837 --- /dev/null +++ b/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch @@ -0,0 +1,42 @@ +From 62d5c774d6c8fcac11e28fcba99754b5478e5088 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 10 Dec 2019 18:43:00 +0000 +Subject: [PATCH 12/12] ext2: Expand directory when adding symlinks + (RHBZ#1770304). + +This produced very weird bugs with missing symlinks under +certain conditions, see: +https://bugzilla.redhat.com/show_bug.cgi?id=1781803 + +Fixes commit 487e8c964078f823646d3b0584745ab7d0ef99ca. +--- + src/ext2fs-c.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c +index 8903f74..0000865 100644 +--- a/src/ext2fs-c.c ++++ b/src/ext2fs-c.c +@@ -791,7 +791,18 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) + if (r > statbuf.st_size) + r = statbuf.st_size; + buf[r] = '\0'; +- ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); ++ symlink_again: ++ err = ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); ++ if (err) { ++ if (err == EXT2_ET_DIR_NO_SPACE) { ++ err = ext2fs_expand_dir (data->fs, dir_ino); ++ if (err) ++ ext2_error_to_exception ("ext2fs_expand_dir", err, dirname); ++ goto symlink_again; ++ } ++ else ++ ext2_error_to_exception ("ext2fs_symlink", err, basename); ++ } + free (buf); + } + /* Create directory. */ +-- +2.23.0 + diff --git a/supermin.spec b/supermin.spec index 4df1f69..d338815 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -46,14 +46,19 @@ Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz Source2: libguestfs.keyring %endif -# Upstream patches to diagnose possible F29 issue: -# https://www.redhat.com/archives/libguestfs/2019-January/thread.html#00168 -Patch1: 0001-rpm-extend-the-Multiple_matches-exception.patch -Patch2: 0002-Print-Librpm.Multiple_matches-exceptions.patch - -# Upstream patch to fix symlinks. -# https://bugzilla.redhat.com/show_bug.cgi?id=1770304 -Patch3: 0001-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch +# Upstream patches since 5.1.20 was released. +Patch0001: 0001-rpm-extend-the-Multiple_matches-exception.patch +Patch0002: 0002-Print-Librpm.Multiple_matches-exceptions.patch +Patch0003: 0003-Use-external-command-mv-to-rename-old-output-directo.patch +Patch0004: 0004-Add-OpenMandriva-support-RHBZ-1694267.patch +Patch0005: 0005-rpm-do-not-unpack-parameters.patch +Patch0006: 0006-rpm-fix-version-comparison.patch +Patch0007: 0007-rpm-query-the-RPM-architecture.patch +Patch0008: 0008-rpm-fix-package-sorting-RHBZ-1696822.patch +Patch0009: 0009-utils-remove-unused-compare_architecture-function.patch +Patch0010: 0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch +Patch0011: 0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch +Patch0012: 0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html @@ -175,6 +180,10 @@ make check || { %changelog +* Tue Dec 10 2019 Richard W.M. Jones - 5.1.20-11 +- Add further patch to fix symlinks (RHBZ#1770304). +- Add all patches since 5.1.20 was released. + * Thu Nov 28 2019 Richard W.M. Jones - 5.1.20-10 - Add upstream patch to fix symlinks on recent kernels (RHBZ#1770304). From 485ec501e0fd5b1f2fbb3a343a2facb10682b83e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 00:42:43 +0000 Subject: [PATCH 29/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index d338815..fe06974 100644 --- a/supermin.spec +++ b/supermin.spec @@ -26,7 +26,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.20 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -180,6 +180,9 @@ make check || { %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 5.1.20-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Tue Dec 10 2019 Richard W.M. Jones - 5.1.20-11 - Add further patch to fix symlinks (RHBZ#1770304). - Add all patches since 5.1.20 was released. From bee2834ecd930309109f92fab066ed54c4424fe3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 10 Mar 2020 10:49:00 +0000 Subject: [PATCH 30/95] New upstream stable version 5.2.0. --- ...xtend-the-Multiple_matches-exception.patch | 89 ------------ ...t-Librpm.Multiple_matches-exceptions.patch | 27 ---- ...mand-mv-to-rename-old-output-directo.patch | 38 ------ ...dd-OpenMandriva-support-RHBZ-1694267.patch | 128 ------------------ 0005-rpm-do-not-unpack-parameters.patch | 33 ----- 0006-rpm-fix-version-comparison.patch | 70 ---------- 0007-rpm-query-the-RPM-architecture.patch | 90 ------------ ...rpm-fix-package-sorting-RHBZ-1696822.patch | 49 ------- ...unused-compare_architecture-function.patch | 66 --------- ...mmy-supermin_rpm_get_arch-implementa.patch | 33 ----- ...ymbolic-links-correctly-RHBZ-1770304.patch | 58 -------- ...ctory-when-adding-symlinks-RHBZ-1770.patch | 42 ------ sources | 4 +- supermin.spec | 35 ++--- 14 files changed, 13 insertions(+), 749 deletions(-) delete mode 100644 0001-rpm-extend-the-Multiple_matches-exception.patch delete mode 100644 0002-Print-Librpm.Multiple_matches-exceptions.patch delete mode 100644 0003-Use-external-command-mv-to-rename-old-output-directo.patch delete mode 100644 0004-Add-OpenMandriva-support-RHBZ-1694267.patch delete mode 100644 0005-rpm-do-not-unpack-parameters.patch delete mode 100644 0006-rpm-fix-version-comparison.patch delete mode 100644 0007-rpm-query-the-RPM-architecture.patch delete mode 100644 0008-rpm-fix-package-sorting-RHBZ-1696822.patch delete mode 100644 0009-utils-remove-unused-compare_architecture-function.patch delete mode 100644 0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch delete mode 100644 0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch delete mode 100644 0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch diff --git a/0001-rpm-extend-the-Multiple_matches-exception.patch b/0001-rpm-extend-the-Multiple_matches-exception.patch deleted file mode 100644 index 35516ef..0000000 --- a/0001-rpm-extend-the-Multiple_matches-exception.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 42955541dc3aa8ae3361f3bd6eb0ae338f307545 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Wed, 23 Jan 2019 12:22:19 +0100 -Subject: [PATCH 01/12] rpm: extend the Multiple_matches exception - -Add the package that raised the issue, so it can be used to provide -better diagnostic. ---- - src/librpm-c.c | 15 ++++++++++----- - src/librpm.ml | 4 ++-- - src/librpm.mli | 2 +- - 3 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/src/librpm-c.c b/src/librpm-c.c -index 3bd25a2..75ca4d7 100644 ---- a/src/librpm-c.c -+++ b/src/librpm-c.c -@@ -66,10 +66,15 @@ librpm_handle_closed (void) - } - - static void --librpm_raise_multiple_matches (int occurrences) -+librpm_raise_multiple_matches (value pkgv, int occurrences) - { -- caml_raise_with_arg (*caml_named_value ("librpm_multiple_matches"), -- Val_int (occurrences)); -+ CAMLparam1 (pkgv); -+ -+ value args[] = { pkgv, Val_int (occurrences) }; -+ caml_raise_with_args (*caml_named_value ("librpm_multiple_matches"), -+ 2, args); -+ -+ CAMLnoreturn; - } - - #define Librpm_val(v) (*((struct librpm_data *)Data_custom_val(v))) -@@ -296,7 +301,7 @@ supermin_rpm_pkg_requires (value rpmv, value pkgv) - fflush (stdout); - } - if (count != 1) -- librpm_raise_multiple_matches (count); -+ librpm_raise_multiple_matches (pkgv, count); - - h = rpmdbNextIterator (iter); - assert (h != NULL); -@@ -413,7 +418,7 @@ supermin_rpm_pkg_filelist (value rpmv, value pkgv) - fflush (stdout); - } - if (count != 1) -- librpm_raise_multiple_matches (count); -+ librpm_raise_multiple_matches (pkgv, count); - - h = rpmdbNextIterator (iter); - assert (h != NULL); -diff --git a/src/librpm.ml b/src/librpm.ml -index 4eeba77..b6f9ff8 100644 ---- a/src/librpm.ml -+++ b/src/librpm.ml -@@ -23,7 +23,7 @@ external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" - - type t - --exception Multiple_matches of int -+exception Multiple_matches of string * int - - external rpm_open : ?debug:int -> t = "supermin_rpm_open" - external rpm_close : t -> unit = "supermin_rpm_close" -@@ -49,4 +49,4 @@ external rpm_pkg_whatprovides : t -> string -> string array = "supermin_rpm_pkg_ - external rpm_pkg_filelist : t -> string -> rpmfile_t array = "supermin_rpm_pkg_filelist" - - let () = -- Callback.register_exception "librpm_multiple_matches" (Multiple_matches 0) -+ Callback.register_exception "librpm_multiple_matches" (Multiple_matches ("", 0)) -diff --git a/src/librpm.mli b/src/librpm.mli -index 5229be6..53b4b2c 100644 ---- a/src/librpm.mli -+++ b/src/librpm.mli -@@ -31,7 +31,7 @@ val rpm_vercmp : string -> string -> int - type t - (** The librpm handle. *) - --exception Multiple_matches of int -+exception Multiple_matches of string * int - - val rpm_open : ?debug:int -> t - (** Open the librpm (transaction set) handle. *) --- -2.23.0 - diff --git a/0002-Print-Librpm.Multiple_matches-exceptions.patch b/0002-Print-Librpm.Multiple_matches-exceptions.patch deleted file mode 100644 index 47ff7f3..0000000 --- a/0002-Print-Librpm.Multiple_matches-exceptions.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 36878992ebdd08f0f9b37017f347f5eab18ce9ed Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Wed, 23 Jan 2019 12:23:02 +0100 -Subject: [PATCH 02/12] Print Librpm.Multiple_matches exceptions - -Print a better diagnostic for them, so it is more clear which package -is detected as present multiple times. ---- - src/supermin.ml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/supermin.ml b/src/supermin.ml -index f9798f9..71d8b64 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -298,6 +298,8 @@ let () = - error "error: %s: %s: %s" fname (Unix.error_message code) param - | Failure msg -> (* from failwith/failwithf *) - error "failure: %s" msg -+ | Librpm.Multiple_matches (package, count) -> (* from librpm *) -+ error "RPM error: %d occurrences for %s" count package - | Invalid_argument msg -> (* probably should never happen *) - error "internal error: invalid argument: %s" msg - | Assert_failure (file, line, char) -> (* should never happen *) --- -2.23.0 - diff --git a/0003-Use-external-command-mv-to-rename-old-output-directo.patch b/0003-Use-external-command-mv-to-rename-old-output-directo.patch deleted file mode 100644 index 1806bf5..0000000 --- a/0003-Use-external-command-mv-to-rename-old-output-directo.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6579cf5f72d5de345ae1cc97d0344dfa1771460a Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 28 Jan 2019 22:20:33 +0000 -Subject: [PATCH 03/12] Use external command mv to rename old output directory - (RHBZ#1670191). - -See https://bugzilla.redhat.com/show_bug.cgi?id=1670191#c0 -for explanation. - -Thanks: Sam Eiderman ---- - src/supermin.ml | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/src/supermin.ml b/src/supermin.ml -index 71d8b64..7c7135b3 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -264,12 +264,10 @@ appliance automatically. - - (* Delete the old output directory if it exists. *) - let old_outputdir = -- try -- let old_outputdir = outputdir ^ "." ^ string_random8 () in -- rename outputdir old_outputdir; -- Some old_outputdir -- with -- Unix_error _ -> None in -+ let old_outputdir = outputdir ^ "." ^ string_random8 () in -+ let cmd = sprintf "mv %s %s 2>/dev/null" -+ (quote outputdir) (quote old_outputdir) in -+ if Sys.command cmd == 0 then Some old_outputdir else None in - - if debug >= 1 then - printf "supermin: renaming %s to %s\n%!" new_outputdir outputdir; --- -2.23.0 - diff --git a/0004-Add-OpenMandriva-support-RHBZ-1694267.patch b/0004-Add-OpenMandriva-support-RHBZ-1694267.patch deleted file mode 100644 index 4fa888d..0000000 --- a/0004-Add-OpenMandriva-support-RHBZ-1694267.patch +++ /dev/null @@ -1,128 +0,0 @@ -From bca633bfd14aeeb8ae1331d468db75d1ef31f9ff Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= -Date: Tue, 2 Apr 2019 08:28:06 +0100 -Subject: [PATCH 04/12] Add OpenMandriva support (RHBZ#1694267). - ---- - src/ph_rpm.ml | 28 +++++++++++++++++++++++++--- - tests/test-harder.sh | 31 +++++++++++++++++++++++++++++++ - 2 files changed, 56 insertions(+), 3 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 46b7f1f..3ff5c94 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -50,6 +50,12 @@ let mageia_detect () = - (Os_release.get_id () = "mageia" || - try (stat "/etc/mageia-release").st_kind = S_REG with Unix_error _ -> false) - -+let openmandriva_detect () = -+ Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && -+ ((Config.urpmi <> "no" && Config.fakeroot <> "no") || Config.dnf <> "no") && -+ (Os_release.get_id () = "openmandriva" || -+ try (stat "/etc/openmandriva-release").st_kind = S_REG with Unix_error _ -> false) -+ - let ibm_powerkvm_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && - Config.yumdownloader <> "no" && -@@ -386,17 +392,27 @@ and opensuse_download_all_packages pkgs dir = - - rpm_unpack tdir dir - -+and openmandriva_download_all_packages pkgs dir = -+ let tdir = !settings.tmpdir // string_random8 () in -+ -+ if Config.dnf <> "no" then -+ download_all_packages_with_dnf pkgs dir tdir -+ else (* Config.urpmi <> "no" && Config.fakeroot <> "no" *) -+ download_all_packages_with_urpmi pkgs dir tdir; -+ -+ rpm_unpack tdir dir -+ - and mageia_download_all_packages pkgs dir = - let tdir = !settings.tmpdir // string_random8 () in - - if Config.dnf <> "no" then - download_all_packages_with_dnf pkgs dir tdir - else (* Config.urpmi <> "no" && Config.fakeroot <> "no" *) -- mageia_download_all_packages_with_urpmi pkgs dir tdir; -+ download_all_packages_with_urpmi pkgs dir tdir; - - rpm_unpack tdir dir - --and mageia_download_all_packages_with_urpmi pkgs dir tdir = -+and download_all_packages_with_urpmi pkgs dir tdir = - let rpms = List.map rpm_package_name (PackageSet.elements pkgs) in - - let cmd = -@@ -484,4 +500,10 @@ let () = - ph_detect = mageia_detect; - ph_download_package = PHDownloadAllPackages mageia_download_all_packages; - } in -- register_package_handler "mageia" "rpm" mageia -+ register_package_handler "mageia" "rpm" mageia; -+ let openmandriva = { -+ fedora with -+ ph_detect = openmandriva_detect; -+ ph_download_package = PHDownloadAllPackages openmandriva_download_all_packages; -+ } in -+ register_package_handler "openmandriva" "rpm" openmandriva -diff --git a/tests/test-harder.sh b/tests/test-harder.sh -index c827f13..aceef21 100755 ---- a/tests/test-harder.sh -+++ b/tests/test-harder.sh -@@ -31,6 +31,7 @@ if [ -f /etc/os-release ]; then - fedora|rhel|centos) distro=redhat ;; - opensuse*|sled|sles) distro=suse ;; - ubuntu) distro=debian ;; -+ openmandriva) distro=openmandriva ;; - esac - elif [ -f /etc/arch-release ]; then - distro=arch -@@ -77,6 +78,9 @@ case $distro in - ibm-powerkvm) - pkgs="augeas hivex tar" - ;; -+ openmandriva) -+ pkgs="augeas hivex rpm" -+ ;; - *) - echo "Unhandled distro '$distro'" - exit 77 -@@ -153,6 +157,33 @@ case $distro in - exit 1 - fi - ;; -+ openmandriva) -+ if [ ! -x $d2/usr/bin/augtool ]; then -+ echo "$0: $distro: augtool binary not installed in chroot" -+ ls -lR $d2 -+ exit 1 -+ fi -+ if [ "$(find $d2/lib* $d2/usr/lib* -name libaugeas.so.0 | wc -l)" -lt 1 ]; then -+ echo "$0: $distro: augeas library not installed in chroot" -+ ls -lR $d2 -+ exit 1 -+ fi -+ if [ ! -x $d2/usr/bin/hivexget ]; then -+ echo "$0: $distro: hivexget binary not installed in chroot" -+ ls -lR $d2 -+ exit 1 -+ fi -+ if [ "$(find $d2/usr/lib* -name libhivex.so.0 | wc -l)" -lt 1 ]; then -+ echo "$0: $distro: hivex library not installed in chroot" -+ ls -lR $d2 -+ exit 1 -+ fi -+ if [ ! -x $d2/bin/rpm ]; then -+ echo "$0: $distro: rpm binary not installed in chroot" -+ ls -lR $d2 -+ exit 1 -+ fi -+ ;; - redhat) - if [ ! -x $d2/usr/bin/augtool ]; then - echo "$0: $distro: augtool binary not installed in chroot" --- -2.23.0 - diff --git a/0005-rpm-do-not-unpack-parameters.patch b/0005-rpm-do-not-unpack-parameters.patch deleted file mode 100644 index 4242c0c..0000000 --- a/0005-rpm-do-not-unpack-parameters.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 941f72d05302d265af763c7f8ed6b999e4f85eeb Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 12 Apr 2019 11:58:49 +0200 -Subject: [PATCH 05/12] rpm: do not unpack parameters - -They will be used as parameters again soon. - -This has no behaviour changes. ---- - src/ph_rpm.ml | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 3ff5c94..6769e7b 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -144,10 +144,10 @@ let rpm_package_of_string str = - * interested in the highest version with the best - * architecture. - *) -- let cmp { version = v1; arch = a1 } { version = v2; arch = a2 } = -- let i = rpm_vercmp v2 v1 in -+ let cmp pkg1 pkg2 = -+ let i = rpm_vercmp pkg2.version pkg1.version in - if i <> 0 then i -- else compare_architecture a2 a1 -+ else compare_architecture pkg2.arch pkg1.arch - in - let rpms = List.sort cmp rpms in - List.hd rpms --- -2.23.0 - diff --git a/0006-rpm-fix-version-comparison.patch b/0006-rpm-fix-version-comparison.patch deleted file mode 100644 index d2f646c..0000000 --- a/0006-rpm-fix-version-comparison.patch +++ /dev/null @@ -1,70 +0,0 @@ -From de075776722741a67b0956f36a6357fcedd66ae0 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 12 Apr 2019 12:13:07 +0200 -Subject: [PATCH 06/12] rpm: fix version comparison - -When comparing two RPMs, also the epoch, and the release must be taken -into account. Hence, add a new helper to get the EVR string of a -package, and use it when sorting each list of installed packages. - -The mapping is done to avoid recreating the EVR strings at every -comparison. ---- - src/ph_rpm.ml | 29 ++++++++++++++++++++++++++--- - 1 file changed, 26 insertions(+), 3 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 6769e7b..a8bcf7c 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -136,21 +136,44 @@ let rpm_of_pkg, pkg_of_rpm = get_memo_functions () - (* Memo of rpm_package_of_string. *) - let rpmh = Hashtbl.create 13 - -+let rpm_to_evr_string rpm = -+ (* In RPM < 4.11 query commands that use the epoch number in the -+ * package name did not work. -+ * -+ * For example: -+ * RHEL 6 (rpm 4.8.0): -+ * $ rpm -q tar-2:1.23-11.el6.x86_64 -+ * package tar-2:1.23-11.el6.x86_64 is not installed -+ * Fedora 20 (rpm 4.11.2): -+ * $ rpm -q tar-2:1.26-30.fc20.x86_64 -+ * tar-1.26-30.fc20.x86_64 -+ * -+ *) -+ let is_rpm_lt_4_11 = -+ !rpm_major < 4 || (!rpm_major = 4 && !rpm_minor < 11) in -+ -+ if is_rpm_lt_4_11 || rpm.epoch = 0 then -+ sprintf "%s-%s" rpm.version rpm.release -+ else -+ sprintf "%d:%s-%s" -+ rpm.epoch rpm.version rpm.release -+ - let rpm_package_of_string str = - let query rpm = - let rpms = Array.to_list (rpm_installed (get_rpm ()) rpm) in -+ let rpms = List.map (fun rpm -> (rpm, rpm_to_evr_string rpm)) rpms in - (* RPM will return multiple hits when either multiple versions or - * multiple arches are installed at the same time. We are only - * interested in the highest version with the best - * architecture. - *) -- let cmp pkg1 pkg2 = -- let i = rpm_vercmp pkg2.version pkg1.version in -+ let cmp (pkg1, evr1) (pkg2, evr2) = -+ let i = rpm_vercmp evr2 evr2 in - if i <> 0 then i - else compare_architecture pkg2.arch pkg1.arch - in - let rpms = List.sort cmp rpms in -- List.hd rpms -+ fst (List.hd rpms) - in - - try --- -2.23.0 - diff --git a/0007-rpm-query-the-RPM-architecture.patch b/0007-rpm-query-the-RPM-architecture.patch deleted file mode 100644 index d0b4f0e..0000000 --- a/0007-rpm-query-the-RPM-architecture.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e57e988c39aca015100fb92377dbd8d114c0bece Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 12 Apr 2019 12:26:11 +0200 -Subject: [PATCH 07/12] rpm: query the RPM architecture - -Query the RPM library for the current architecture of RPM, storing it -for later use, and printing it to the debug output. ---- - src/librpm-c.c | 10 ++++++++++ - src/librpm.ml | 1 + - src/librpm.mli | 3 +++ - src/ph_rpm.ml | 8 ++++++-- - 4 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/src/librpm-c.c b/src/librpm-c.c -index 75ca4d7..2e2f048 100644 ---- a/src/librpm-c.c -+++ b/src/librpm-c.c -@@ -132,6 +132,16 @@ supermin_rpm_vercmp (value av, value bv) - return Val_int (rpmvercmp (String_val (av), String_val (bv))); - } - -+value -+supermin_rpm_get_arch (value unit) -+{ -+ const char *str; -+ -+ rpmGetArchInfo (&str, NULL); -+ -+ return caml_copy_string (str); -+} -+ - value - supermin_rpm_open (value debugv) - { -diff --git a/src/librpm.ml b/src/librpm.ml -index b6f9ff8..c987e21 100644 ---- a/src/librpm.ml -+++ b/src/librpm.ml -@@ -20,6 +20,7 @@ external rpm_is_available : unit -> bool = "supermin_rpm_is_available" "noalloc" - - external rpm_version : unit -> string = "supermin_rpm_version" - external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" -+external rpm_get_arch : unit -> string = "supermin_rpm_get_arch" - - type t - -diff --git a/src/librpm.mli b/src/librpm.mli -index 53b4b2c..c0d7bdf 100644 ---- a/src/librpm.mli -+++ b/src/librpm.mli -@@ -28,6 +28,9 @@ val rpm_version : unit -> string - val rpm_vercmp : string -> string -> int - (** Compare two RPM version strings using RPM version compare rules. *) - -+val rpm_get_arch : unit -> string -+(** The current main RPM architecture. *) -+ - type t - (** The librpm handle. *) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index a8bcf7c..e27d226 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -64,7 +64,7 @@ let ibm_powerkvm_detect () = - with Unix_error _ -> false - - let settings = ref no_settings --let rpm_major, rpm_minor = ref 0, ref 0 -+let rpm_major, rpm_minor, rpm_arch = ref 0, ref 0, ref "" - let zypper_major, zypper_minor, zypper_patch = ref 0, ref 0, ref 0 - let t = ref None - -@@ -93,7 +93,11 @@ let rec rpm_init s = - if !settings.debug >= 1 then - printf "supermin: rpm: detected RPM version %d.%d\n" major minor; - -- t := Some (rpm_open ~debug:!settings.debug) -+ t := Some (rpm_open ~debug:!settings.debug); -+ -+ rpm_arch := rpm_get_arch (); -+ if !settings.debug >= 1 then -+ printf "supermin: rpm: detected RPM architecture %s\n" !rpm_arch - - and opensuse_init s = - rpm_init s; --- -2.23.0 - diff --git a/0008-rpm-fix-package-sorting-RHBZ-1696822.patch b/0008-rpm-fix-package-sorting-RHBZ-1696822.patch deleted file mode 100644 index d787252..0000000 --- a/0008-rpm-fix-package-sorting-RHBZ-1696822.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 72735dd11c83eb59d90e04b3c1e580af43b1ba0a Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 12 Apr 2019 12:38:46 +0200 -Subject: [PATCH 08/12] rpm: fix package sorting (RHBZ#1696822) - -The sorting algorithm for RPMs sorted this way: -- before the packages with the higher versions -- among the packages with the version version, first noarch packages, - then 64bit packages, and then 32bit packages -This was broken in at least two ways: -- the higher installed version may not be of the same host architecture -- if the host architecture is 32bit, and there is a 64bit package of a - 32bit installed one, the 64bit version was preferred - -Instead: -- first sort by architecture, preferring noarch packages, and - packages of the host architecture -- then sort by version - -This way, the higher version of the host architecture is preferred, -otherwise the higher version of any foreign architecture is chosen. ---- - src/ph_rpm.ml | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index e27d226..dbe3bda 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -172,9 +172,14 @@ let rpm_package_of_string str = - * architecture. - *) - let cmp (pkg1, evr1) (pkg2, evr2) = -- let i = rpm_vercmp evr2 evr2 in -+ let weight_of_arch = function -+ | "noarch" -> 100 -+ | a when a = !rpm_arch -> 50 -+ | _ -> 0 -+ in -+ let i = compare (weight_of_arch pkg2.arch) (weight_of_arch pkg1.arch) in - if i <> 0 then i -- else compare_architecture pkg2.arch pkg1.arch -+ else rpm_vercmp evr2 evr2 - in - let rpms = List.sort cmp rpms in - fst (List.hd rpms) --- -2.23.0 - diff --git a/0009-utils-remove-unused-compare_architecture-function.patch b/0009-utils-remove-unused-compare_architecture-function.patch deleted file mode 100644 index 299ea19..0000000 --- a/0009-utils-remove-unused-compare_architecture-function.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b2401285cd3e3d42006fc164ef1f046cc35a50c4 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 12 Apr 2019 12:47:52 +0200 -Subject: [PATCH 09/12] utils: remove unused 'compare_architecture' function - -This was used only in the RPM package handler. ---- - src/utils.ml | 27 --------------------------- - src/utils.mli | 3 --- - 2 files changed, 30 deletions(-) - -diff --git a/src/utils.ml b/src/utils.ml -index f85418f..b25df88 100644 ---- a/src/utils.ml -+++ b/src/utils.ml -@@ -172,33 +172,6 @@ and split_version = function - ) in - first :: split_version rest - --let compare_architecture a1 a2 = -- let index_of_architecture = function -- | "noarch" | "all" -> 100 -- | "i386" | "i486" | "i586" | "i686" | "x86_32" | "x86-32" -> 32 -- | "x86_64" | "x86-64" | "amd64" -> 64 -- | "armel" | "armhf" -> 32 -- | "aarch64" -> 64 -- | a when string_prefix "armv5" a -> 32 -- | a when string_prefix "armv6" a -> 32 -- | a when string_prefix "armv7" a -> 32 -- | a when string_prefix "armv8" a -> 64 -- | "hppa" | "parisc" -> 32 -- | "hppa64" | "parisc64" -> 64 -- | "ppc" | "ppc32" -> 32 -- | a when string_prefix "ppc64" a -> 64 -- | "sparc" | "sparc32" -> 32 -- | "sparc64" -> 64 -- | "ia64" -> 64 -- | "s390" -> 32 -- | "s390x" -> 64 -- | "alpha" -> 64 -- | a -> -- error "missing support for architecture '%s'\nIt may need to be added to supermin." -- a -- in -- compare (index_of_architecture a1) (index_of_architecture a2) -- - (* Parse a size field, eg. "10G". *) - let parse_size = - let const_re = Str.regexp "^\\([.0-9]+\\)\\([bKMG]\\)$" in -diff --git a/src/utils.mli b/src/utils.mli -index 7837dbb..b86586a 100644 ---- a/src/utils.mli -+++ b/src/utils.mli -@@ -86,9 +86,6 @@ val filter_map : ('a -> 'b option) -> 'a list -> 'b list - val compare_version : string -> string -> int - (** Compare two version-like strings. *) - --val compare_architecture : string -> string -> int -- (** Compare two architecture strings. *) -- - val parse_size : string -> int64 - (** Parse a size field, eg. [10G] *) - --- -2.23.0 - diff --git a/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch b/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch deleted file mode 100644 index 22ffd97..0000000 --- a/0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c97b3917068597a0e68e88d9a905da766ade40da Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 24 May 2019 13:31:07 +0200 -Subject: [PATCH 10/12] rpm: provide a dummy supermin_rpm_get_arch - implementation - -Make sure supermin builds fine also without the RPM development files. - -Fixes commit e57e988c39aca015100fb92377dbd8d114c0bece. ---- - src/librpm-c.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/librpm-c.c b/src/librpm-c.c -index 2e2f048..523fe0b 100644 ---- a/src/librpm-c.c -+++ b/src/librpm-c.c -@@ -483,6 +483,12 @@ supermin_rpm_vercmp (value av, value bv) - abort (); - } - -+value -+supermin_rpm_get_arch (value unit) -+{ -+ abort (); -+} -+ - value - supermin_rpm_open (value debugv) - { --- -2.23.0 - diff --git a/0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch b/0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch deleted file mode 100644 index bddf338..0000000 --- a/0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 487e8c964078f823646d3b0584745ab7d0ef99ca Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 26 Nov 2019 09:01:21 +0000 -Subject: [PATCH 11/12] ext2: Build symbolic links correctly (RHBZ#1770304). - -We created symlinks in two steps, by creating the empty inode and then -calling ext2fs_symlink to populate it. This created broken symlinks -where the directory name contained a / character, eg: - -lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin -lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib -lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64 -lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin -lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin - -This breaks with Linux >= 5.3.8, most likely because of extra -validation now being done at the VFS layer: - -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/readdir.c?id=8a23eb804ca4f2be909e372cf5a9e7b30ae476cd - -It's unnecessary to create the empty inode since ext2fs_symlink can -create the inode for us perfectly fine if we simply pass ino == 0, and -it creates them correctly too. - -Thanks: Toolybird for identifying the problem and kernel patch. ---- - src/ext2fs-c.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c -index e8ab972..8903f74 100644 ---- a/src/ext2fs-c.c -+++ b/src/ext2fs-c.c -@@ -782,12 +782,6 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) - } - /* Create a symlink. */ - else if (S_ISLNK (statbuf.st_mode)) { -- ext2_ino_t ino; -- ext2_empty_inode (data->fs, dir_ino, dirname, basename, -- statbuf.st_mode, statbuf.st_uid, statbuf.st_gid, -- statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime, -- 0, 0, EXT2_FT_SYMLINK, &ino); -- - char *buf = malloc (statbuf.st_size+1); - if (buf == NULL) - caml_raise_out_of_memory (); -@@ -797,7 +791,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) - if (r > statbuf.st_size) - r = statbuf.st_size; - buf[r] = '\0'; -- ext2fs_symlink (data->fs, dir_ino, ino, dest, buf); -+ ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); - free (buf); - } - /* Create directory. */ --- -2.23.0 - diff --git a/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch b/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch deleted file mode 100644 index 5802837..0000000 --- a/0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 62d5c774d6c8fcac11e28fcba99754b5478e5088 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 10 Dec 2019 18:43:00 +0000 -Subject: [PATCH 12/12] ext2: Expand directory when adding symlinks - (RHBZ#1770304). - -This produced very weird bugs with missing symlinks under -certain conditions, see: -https://bugzilla.redhat.com/show_bug.cgi?id=1781803 - -Fixes commit 487e8c964078f823646d3b0584745ab7d0ef99ca. ---- - src/ext2fs-c.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c -index 8903f74..0000865 100644 ---- a/src/ext2fs-c.c -+++ b/src/ext2fs-c.c -@@ -791,7 +791,18 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest) - if (r > statbuf.st_size) - r = statbuf.st_size; - buf[r] = '\0'; -- ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); -+ symlink_again: -+ err = ext2fs_symlink (data->fs, dir_ino, 0, basename, buf); -+ if (err) { -+ if (err == EXT2_ET_DIR_NO_SPACE) { -+ err = ext2fs_expand_dir (data->fs, dir_ino); -+ if (err) -+ ext2_error_to_exception ("ext2fs_expand_dir", err, dirname); -+ goto symlink_again; -+ } -+ else -+ ext2_error_to_exception ("ext2fs_symlink", err, basename); -+ } - free (buf); - } - /* Create directory. */ --- -2.23.0 - diff --git a/sources b/sources index d77c08a..cb05cec 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.1.20.tar.gz) = ccc9ada98593f91399b323f0beb027185874f82547a1df4274c1206a9b6d4465e98b7aef5618274d41fb902747f6843fd2cc6192a4ea8526811261ac5a16848e -SHA512 (supermin-5.1.20.tar.gz.sig) = e7c46fdf4105ffa3f6e02d6ed0b895a9af71470f5c650d129304187b977516343d17a861a9c53934eee559de374623f100f4736426de37ee78d5f5bc82d56096 +SHA512 (supermin-5.2.0.tar.gz) = 782d00f95a37ad75833b659300b085b5c7bfa1c795eae9aa57b3c52cab0332d6e6b8e1bddc5b1c0075cc64b60e22b64387771cd9f457568408889244a4628467 +SHA512 (supermin-5.2.0.tar.gz.sig) = 425a1a7277f48bc837d290c43af025f1e39cdd2da2d5460bebe27c9b86c2b8f57a23172c1fa3d45bbb749b1bb96486f59a8363443825f27d86297b22435b46f3 diff --git a/supermin.spec b/supermin.spec index fe06974..c5581dd 100644 --- a/supermin.spec +++ b/supermin.spec @@ -21,12 +21,15 @@ %endif # Whether we should verify tarball signature with GPGv2. -%global verify_tarball_signature 1 +%global verify_tarball_signature %{nil} + +# The source directory. +%global source_directory 5.2-stable Summary: Tool for creating supermin appliances Name: supermin -Version: 5.1.20 -Release: 12%{?dist} +Version: 5.2.0 +Release: 1%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -36,29 +39,10 @@ ExclusiveArch: x86_64 ExcludeArch: %{ix86} URL: http://people.redhat.com/~rjones/supermin/ -Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz -%if 0%{verify_tarball_signature} -Source1: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz.sig -%endif - +Source0: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz +Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz.sig # Keyring used to verify tarball signature. -%if 0%{verify_tarball_signature} Source2: libguestfs.keyring -%endif - -# Upstream patches since 5.1.20 was released. -Patch0001: 0001-rpm-extend-the-Multiple_matches-exception.patch -Patch0002: 0002-Print-Librpm.Multiple_matches-exceptions.patch -Patch0003: 0003-Use-external-command-mv-to-rename-old-output-directo.patch -Patch0004: 0004-Add-OpenMandriva-support-RHBZ-1694267.patch -Patch0005: 0005-rpm-do-not-unpack-parameters.patch -Patch0006: 0006-rpm-fix-version-comparison.patch -Patch0007: 0007-rpm-query-the-RPM-architecture.patch -Patch0008: 0008-rpm-fix-package-sorting-RHBZ-1696822.patch -Patch0009: 0009-utils-remove-unused-compare_architecture-function.patch -Patch0010: 0010-rpm-provide-a-dummy-supermin_rpm_get_arch-implementa.patch -Patch0011: 0011-ext2-Build-symbolic-links-correctly-RHBZ-1770304.patch -Patch0012: 0012-ext2-Expand-directory-when-adding-symlinks-RHBZ-1770.patch BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html @@ -180,6 +164,9 @@ make check || { %changelog +* Tue Mar 10 2020 Richard W.M. Jones - 5.2.0-1 +- New upstream stable version 5.2.0. + * Fri Jan 31 2020 Fedora Release Engineering - 5.1.20-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From ab46d9cdb49efafa9f9c89c02fbec224b2fcea03 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 3 Apr 2020 11:55:42 +0100 Subject: [PATCH 31/95] ppc64le: ibmvscsi driver missing from supermin appliance (RHBZ#1819019). --- ...min-Fix-IBM-Virtual-SCSI-driver-name.patch | 29 +++++++++++++++++++ supermin.spec | 9 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch diff --git a/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch b/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch new file mode 100644 index 0000000..583fabc --- /dev/null +++ b/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch @@ -0,0 +1,29 @@ +From 3f831d30d87658d362e9b4f25fa569937fa1c23f Mon Sep 17 00:00:00 2001 +From: Gustavo Luiz Duarte +Date: Tue, 31 Mar 2020 23:11:44 -0300 +Subject: [PATCH] supermin: Fix IBM Virtual SCSI driver name + +The driver was renamed from ibmvscsic to ibmvscsi on kernel 3.7. +See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9965c2f19be470c452357ae4f6304467cdeada55 + +The old name is kept so supermin works with recent kernels as well as kernel +version older than 3.7. +--- + src/format_ext2_initrd.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml +index b67bb55..38977e6 100644 +--- a/src/format_ext2_initrd.ml ++++ b/src/format_ext2_initrd.ml +@@ -44,6 +44,7 @@ let kmods = [ + "crc*.ko*"; + "libcrc*.ko*"; + "ibmvscsic.ko*"; ++ "ibmvscsi.ko*"; + "libnvdimm.ko*"; + "nd_pmem.ko*"; + "nd_btt.ko*"; +-- +2.24.1 + diff --git a/supermin.spec b/supermin.spec index c5581dd..4d1cef4 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -44,6 +44,10 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# Fix: ppc64le: ibmvscsi driver missing from supermin appliance. +# Upstream patch, fixes RHBZ#1819019 +Patch1: 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -164,6 +168,9 @@ make check || { %changelog +* Fri Apr 03 2020 Richard W.M. Jones - 5.2.0-2 +- ppc64le: ibmvscsi driver missing from supermin appliance (RHBZ#1819019). + * Tue Mar 10 2020 Richard W.M. Jones - 5.2.0-1 - New upstream stable version 5.2.0. From e13f1165c63b6cd719d9c9776cd2822a5de23187 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 11:47:32 +0000 Subject: [PATCH 32/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 4d1cef4..9b371b7 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -168,6 +168,9 @@ make check || { %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 5.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Fri Apr 03 2020 Richard W.M. Jones - 5.2.0-2 - ppc64le: ibmvscsi driver missing from supermin appliance (RHBZ#1819019). From 517a7171c7ecdee52056cc80fbb820568e31dfaf Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Fri, 7 Aug 2020 16:14:21 +0000 Subject: [PATCH 33/95] Use ExclusiveArch: %{kernel_arches} kernel_arches is a new rpm macro variable that is now in the Fedora buildroot as of redhat-rpm-config-167. It lists what architectures the full kernel is built on. Architectures that only have the kernel-header (such as i686) is not listed. Thus, it can be used as a variable so that packages that depend on the kernel, can have a consistent way of listing the architectures. The variable is currently only in Fedora, but is expected to be in RHEL9, and hopefully backported to earlier RHEL versions. This pull request updates the spec to use %{kernel_arches} for ExclusiveArch: --- supermin.spec | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index 9b371b7..4d1345d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,14 +29,10 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ -%if 0%{?rhel} >= 7 -ExclusiveArch: x86_64 -%endif - -ExcludeArch: %{ix86} +ExclusiveArch: %{kernel_arches} URL: http://people.redhat.com/~rjones/supermin/ Source0: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz @@ -168,6 +164,9 @@ make check || { %changelog +* Fri Aug 07 2020 Troy Dawson - 5.2.0-4 +- Use ExclusiveArch: %{kernel_arches} + * Wed Jul 29 2020 Fedora Release Engineering - 5.2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From c8365175e3f2a9de8fffa4af901cfb922957c683 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 23 Nov 2020 08:24:31 +0000 Subject: [PATCH 34/95] Disable dietlibc on RHEL 9. --- supermin.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 4d1345d..6672ab8 100644 --- a/supermin.spec +++ b/supermin.spec @@ -14,11 +14,15 @@ # See also: # https://github.com/libguestfs/supermin/commit/9bb57e1a8d0f3b57eb09f65dd574f702b67e1c2f +%if 0%{?rhel} +%bcond_with dietlibc +%else %ifarch aarch64 %{arm} %{ix86} %{power} s390x x86_64 %bcond_without dietlibc %else %bcond_with dietlibc %endif +%endif # Whether we should verify tarball signature with GPGv2. %global verify_tarball_signature %{nil} @@ -29,7 +33,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -164,6 +168,9 @@ make check || { %changelog +* Mon Nov 23 2020 Richard W.M. Jones - 5.2.0-5 +- Disable dietlibc on RHEL 9. + * Fri Aug 07 2020 Troy Dawson - 5.2.0-4 - Use ExclusiveArch: %{kernel_arches} From a90c9f99bdf9b8032c8ae3a8db2a70f34bdbf1c6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 23 Nov 2020 09:15:47 +0000 Subject: [PATCH 35/95] Tidy up comment, since RHEL is a no-dietlibc platform. --- supermin.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/supermin.spec b/supermin.spec index 6672ab8..51f0e68 100644 --- a/supermin.spec +++ b/supermin.spec @@ -3,13 +3,14 @@ %global debug_package %{nil} %endif -# On architectures that support it, the default is ``--with dietlibc''. +# On platforms and architectures that support it, the default is +# ‘--with dietlibc’. # -# To use glibc-static instead, do ``--without dietlibc''. This -# results in a much larger (about 40 times larger) init binary. +# To use glibc-static instead, do ‘--without dietlibc’. This results +# in a much larger (about 40 times larger) init binary. # # On other platforms, there is no dietlibc, so the default for those -# is ``--without dietlibc''. +# is ‘--without dietlibc’. # # See also: # https://github.com/libguestfs/supermin/commit/9bb57e1a8d0f3b57eb09f65dd574f702b67e1c2f From 024ce8202604774c66e461113fc5e22aecba32c4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 8 Jan 2021 22:05:59 +0000 Subject: [PATCH 36/95] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- supermin.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/supermin.spec b/supermin.spec index 51f0e68..61ec5c5 100644 --- a/supermin.spec +++ b/supermin.spec @@ -49,6 +49,7 @@ Source2: libguestfs.keyring # Upstream patch, fixes RHBZ#1819019 Patch1: 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch +BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm From 661449a5ad2dffab1de0f8c118fdcaf064cd560e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 Jan 2021 12:07:56 +0000 Subject: [PATCH 37/95] Remove inactive strip override (see RHBZ#1915570). --- supermin.spec | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index 61ec5c5..f455c2c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,8 +1,3 @@ -%ifnarch %{ocaml_native_compiler} -%global __strip /bin/true -%global debug_package %{nil} -%endif - # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # @@ -34,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -170,6 +165,9 @@ make check || { %changelog +* Thu Jan 14 2021 Richard W.M. Jones - 5.2.0-6 +- Remove inactive strip override (see RHBZ#1915570). + * Mon Nov 23 2020 Richard W.M. Jones - 5.2.0-5 - Disable dietlibc on RHEL 9. From 690d7f81220b0c3412385c7420832731458dd077 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 21:19:46 +0000 Subject: [PATCH 38/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index f455c2c..5f0624c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.0 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -165,6 +165,9 @@ make check || { %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 5.2.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Thu Jan 14 2021 Richard W.M. Jones - 5.2.0-6 - Remove inactive strip override (see RHBZ#1915570). From 987c3207fca2f71f41090d5f371a9af887bd807b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Feb 2021 09:43:19 +0000 Subject: [PATCH 39/95] New upstream version 5.2.1. --- sources | 4 ++-- supermin.spec | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sources b/sources index cb05cec..5a6b3a7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.2.0.tar.gz) = 782d00f95a37ad75833b659300b085b5c7bfa1c795eae9aa57b3c52cab0332d6e6b8e1bddc5b1c0075cc64b60e22b64387771cd9f457568408889244a4628467 -SHA512 (supermin-5.2.0.tar.gz.sig) = 425a1a7277f48bc837d290c43af025f1e39cdd2da2d5460bebe27c9b86c2b8f57a23172c1fa3d45bbb749b1bb96486f59a8363443825f27d86297b22435b46f3 +SHA512 (supermin-5.2.1.tar.gz) = f10ea404e0b27238ea3c25cb68f44e716aa180a45a420e63c1958768032f0710e8e3e7f1346cda780ea1f916f499499da2c02df4019d91ea3b3a69b75cfda545 +SHA512 (supermin-5.2.1.tar.gz.sig) = bde7907ea61e8bb3e59fac235c7bd8e22ef2e16831b80344c4574fdff873a5fc8b8972716143ee9d9bd745ac99b72f11aa4530a8d184a3f287b3212ef85c7a13 diff --git a/supermin.spec b/supermin.spec index 5f0624c..a26ced0 100644 --- a/supermin.spec +++ b/supermin.spec @@ -28,8 +28,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.2.0 -Release: 7%{?dist} +Version: 5.2.1 +Release: 1%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -165,6 +165,9 @@ make check || { %changelog +* Mon Feb 01 2021 Richard W.M. Jones - 5.2.1-1 +- New upstream version 5.2.1. + * Wed Jan 27 2021 Fedora Release Engineering - 5.2.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From d4841876baee22c6e775bc99c220efddd00999ca Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Feb 2021 09:48:54 +0000 Subject: [PATCH 40/95] Remove patch which is included in 5.2.1. Enable GPG signature verification. --- ...min-Fix-IBM-Virtual-SCSI-driver-name.patch | 29 ------------------- supermin.spec | 6 +--- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch diff --git a/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch b/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch deleted file mode 100644 index 583fabc..0000000 --- a/0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3f831d30d87658d362e9b4f25fa569937fa1c23f Mon Sep 17 00:00:00 2001 -From: Gustavo Luiz Duarte -Date: Tue, 31 Mar 2020 23:11:44 -0300 -Subject: [PATCH] supermin: Fix IBM Virtual SCSI driver name - -The driver was renamed from ibmvscsic to ibmvscsi on kernel 3.7. -See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9965c2f19be470c452357ae4f6304467cdeada55 - -The old name is kept so supermin works with recent kernels as well as kernel -version older than 3.7. ---- - src/format_ext2_initrd.ml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml -index b67bb55..38977e6 100644 ---- a/src/format_ext2_initrd.ml -+++ b/src/format_ext2_initrd.ml -@@ -44,6 +44,7 @@ let kmods = [ - "crc*.ko*"; - "libcrc*.ko*"; - "ibmvscsic.ko*"; -+ "ibmvscsi.ko*"; - "libnvdimm.ko*"; - "nd_pmem.ko*"; - "nd_btt.ko*"; --- -2.24.1 - diff --git a/supermin.spec b/supermin.spec index a26ced0..f94fa2b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -21,7 +21,7 @@ %endif # Whether we should verify tarball signature with GPGv2. -%global verify_tarball_signature %{nil} +%global verify_tarball_signature 1 # The source directory. %global source_directory 5.2-stable @@ -40,10 +40,6 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# Fix: ppc64le: ibmvscsi driver missing from supermin appliance. -# Upstream patch, fixes RHBZ#1819019 -Patch1: 0001-supermin-Fix-IBM-Virtual-SCSI-driver-name.patch - BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html From 084b2b09087fb4444cb17ed4e08d358030ef9b55 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Feb 2021 10:14:26 +0000 Subject: [PATCH 41/95] Add upstream patch for stat field overflow on armv7. --- ...ile-to-avoid-lstat-Value-too-large-f.patch | 180 ++++++++++++++++++ supermin.spec | 3 + 2 files changed, 183 insertions(+) create mode 100644 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch diff --git a/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch b/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch new file mode 100644 index 0000000..c5d4ea3 --- /dev/null +++ b/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch @@ -0,0 +1,180 @@ +From fd9f17c7eb63979af882533a0d234bfc8ca42de3 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 1 Feb 2021 10:07:02 +0000 +Subject: [PATCH] Open Unix.LargeFile to avoid "lstat: Value too large for + defined data type". + +On 32 bit platforms, because OCaml native ints are limited to 31 bits, +there is a trap in the normal Unix.stat, Unix.lstat functions where +any field in the stat struct may overflow. The result is random +errors like: + + supermin: error: lstat: Value too large for defined data type: /tmp/tmp.Ss9aYEBASm/d2/root + +You would probably only see this on armv7. + +The OCaml Unix module has a "LargeFile" submodule which fixes this by +using int64 for some (unfortunately not all) fields. + +For more information see the OCaml sources, file +otherlibs/unix/stat.c, all instances of "EOVERFLOW". +--- + src/format_chroot.ml | 1 + + src/format_ext2.ml | 1 + + src/format_ext2_initrd.ml | 1 + + src/format_ext2_kernel.ml | 5 +++-- + src/mode_build.ml | 1 + + src/package_handler.ml | 1 + + src/ph_dpkg.ml | 1 + + src/ph_pacman.ml | 1 + + src/ph_rpm.ml | 1 + + src/supermin.ml | 1 + + src/utils.ml | 1 + + 11 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/format_chroot.ml b/src/format_chroot.ml +index 346c24b..34606f7 100644 +--- a/src/format_chroot.ml ++++ b/src/format_chroot.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/format_ext2.ml b/src/format_ext2.ml +index 6348c29..e311ea6 100644 +--- a/src/format_ext2.ml ++++ b/src/format_ext2.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml +index 38977e6..6268442 100644 +--- a/src/format_ext2_initrd.ml ++++ b/src/format_ext2_initrd.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 98bff3a..3be4413 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +@@ -95,8 +96,8 @@ and find_kernel_from_lib_modules debug = + let kernels = + filter_map ( + fun kernel_file -> +- let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in +- if size < 10000 then None ++ let size = try (stat kernel_file).st_size with Unix_error _ -> 0L in ++ if size < 10000_L then None + else ( + let kernel_name = Filename.basename kernel_file in + let modpath = Filename.dirname kernel_file in +diff --git a/src/mode_build.ml b/src/mode_build.ml +index ed47366..ff7733e 100644 +--- a/src/mode_build.ml ++++ b/src/mode_build.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/package_handler.ml b/src/package_handler.ml +index 0409438..f0d6db3 100644 +--- a/src/package_handler.ml ++++ b/src/package_handler.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/ph_dpkg.ml b/src/ph_dpkg.ml +index 1e785de..6d4fce1 100644 +--- a/src/ph_dpkg.ml ++++ b/src/ph_dpkg.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml +index 67f7512..50500a5 100644 +--- a/src/ph_pacman.ml ++++ b/src/ph_pacman.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 9745efd..183b5f3 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Utils +diff --git a/src/supermin.ml b/src/supermin.ml +index e923111..9f838d9 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + open Types +diff --git a/src/utils.ml b/src/utils.ml +index b25df88..f5990ef 100644 +--- a/src/utils.ml ++++ b/src/utils.ml +@@ -17,6 +17,7 @@ + *) + + open Unix ++open Unix.LargeFile + open Printf + + let (+^) = Int64.add +-- +2.29.0.rc2 + diff --git a/supermin.spec b/supermin.spec index f94fa2b..7c394c9 100644 --- a/supermin.spec +++ b/supermin.spec @@ -40,6 +40,9 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# Upstream fix for stat field overflow on armv7. +Patch1: 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch + BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html From 3f2b7f0a265a7e10e015eb446ba3faa646279ea3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 7 May 2021 13:28:18 +0100 Subject: [PATCH 42/95] Do not include the package on POWER on RHEL 9 resolves: rhbz#1956934 --- supermin.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 7c394c9..adf2bde 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,10 +29,14 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} +%if 0%{?rhel} +# No qemu-kvm on POWER (RHBZ#1946532). +ExcludeArch: %{power64} +%endif URL: http://people.redhat.com/~rjones/supermin/ Source0: http://download.libguestfs.org/supermin/%{source_directory}/%{name}-%{version}.tar.gz @@ -164,6 +168,10 @@ make check || { %changelog +* Fri May 07 2021 Richard W.M. Jones - 5.2.1-2 +- Do not include the package on POWER on RHEL 9 + resolves: rhbz#1956934 + * Mon Feb 01 2021 Richard W.M. Jones - 5.2.1-1 - New upstream version 5.2.1. From c4dc459160e18e128ae96810663e8499fac30fa1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 2 Jun 2021 10:30:48 +0100 Subject: [PATCH 43/95] Add gating tests (for RHEL 9) --- gating.yaml | 6 ++++++ supermin.spec | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 gating.yaml diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..9234236 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: xen-ci.brew-build.tier1.functional} diff --git a/supermin.spec b/supermin.spec index adf2bde..508b617 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -168,6 +168,9 @@ make check || { %changelog +* Wed Jun 2 10:33:05 BST 2021 Richard W.M. Jones - 5.2.1-3 +- Add gating tests (for RHEL 9) + * Fri May 07 2021 Richard W.M. Jones - 5.2.1-2 - Do not include the package on POWER on RHEL 9 resolves: rhbz#1956934 From eb8e677daa75fb550df63bc05b61672cede3ac79 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 2 Jun 2021 10:36:22 +0100 Subject: [PATCH 44/95] Remove bogus timestamp added by rpmdev-bumpspec --- supermin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 508b617..bb8f766 100644 --- a/supermin.spec +++ b/supermin.spec @@ -168,7 +168,7 @@ make check || { %changelog -* Wed Jun 2 10:33:05 BST 2021 Richard W.M. Jones - 5.2.1-3 +* Wed Jun 2 2021 Richard W.M. Jones - 5.2.1-3 - Add gating tests (for RHEL 9) * Fri May 07 2021 Richard W.M. Jones - 5.2.1-2 From eb5a05494e68e566a585cbc4c957a42070af08c9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 18:34:45 +0000 Subject: [PATCH 45/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index bb8f766..1eccb3d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.2.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -168,6 +168,9 @@ make check || { %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 5.2.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jun 2 2021 Richard W.M. Jones - 5.2.1-3 - Add gating tests (for RHEL 9) From 58de4c8249f5fb54983f775842eb1a6c448c264f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 26 Aug 2021 16:46:08 +0100 Subject: [PATCH 46/95] New upstream development version 5.3.1. --- ...ile-to-avoid-lstat-Value-too-large-f.patch | 180 ------------------ sources | 4 +- supermin.spec | 12 +- 3 files changed, 8 insertions(+), 188 deletions(-) delete mode 100644 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch diff --git a/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch b/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch deleted file mode 100644 index c5d4ea3..0000000 --- a/0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch +++ /dev/null @@ -1,180 +0,0 @@ -From fd9f17c7eb63979af882533a0d234bfc8ca42de3 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 1 Feb 2021 10:07:02 +0000 -Subject: [PATCH] Open Unix.LargeFile to avoid "lstat: Value too large for - defined data type". - -On 32 bit platforms, because OCaml native ints are limited to 31 bits, -there is a trap in the normal Unix.stat, Unix.lstat functions where -any field in the stat struct may overflow. The result is random -errors like: - - supermin: error: lstat: Value too large for defined data type: /tmp/tmp.Ss9aYEBASm/d2/root - -You would probably only see this on armv7. - -The OCaml Unix module has a "LargeFile" submodule which fixes this by -using int64 for some (unfortunately not all) fields. - -For more information see the OCaml sources, file -otherlibs/unix/stat.c, all instances of "EOVERFLOW". ---- - src/format_chroot.ml | 1 + - src/format_ext2.ml | 1 + - src/format_ext2_initrd.ml | 1 + - src/format_ext2_kernel.ml | 5 +++-- - src/mode_build.ml | 1 + - src/package_handler.ml | 1 + - src/ph_dpkg.ml | 1 + - src/ph_pacman.ml | 1 + - src/ph_rpm.ml | 1 + - src/supermin.ml | 1 + - src/utils.ml | 1 + - 11 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/src/format_chroot.ml b/src/format_chroot.ml -index 346c24b..34606f7 100644 ---- a/src/format_chroot.ml -+++ b/src/format_chroot.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/format_ext2.ml b/src/format_ext2.ml -index 6348c29..e311ea6 100644 ---- a/src/format_ext2.ml -+++ b/src/format_ext2.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/format_ext2_initrd.ml b/src/format_ext2_initrd.ml -index 38977e6..6268442 100644 ---- a/src/format_ext2_initrd.ml -+++ b/src/format_ext2_initrd.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 98bff3a..3be4413 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -@@ -95,8 +96,8 @@ and find_kernel_from_lib_modules debug = - let kernels = - filter_map ( - fun kernel_file -> -- let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in -- if size < 10000 then None -+ let size = try (stat kernel_file).st_size with Unix_error _ -> 0L in -+ if size < 10000_L then None - else ( - let kernel_name = Filename.basename kernel_file in - let modpath = Filename.dirname kernel_file in -diff --git a/src/mode_build.ml b/src/mode_build.ml -index ed47366..ff7733e 100644 ---- a/src/mode_build.ml -+++ b/src/mode_build.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/package_handler.ml b/src/package_handler.ml -index 0409438..f0d6db3 100644 ---- a/src/package_handler.ml -+++ b/src/package_handler.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/ph_dpkg.ml b/src/ph_dpkg.ml -index 1e785de..6d4fce1 100644 ---- a/src/ph_dpkg.ml -+++ b/src/ph_dpkg.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml -index 67f7512..50500a5 100644 ---- a/src/ph_pacman.ml -+++ b/src/ph_pacman.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 9745efd..183b5f3 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Utils -diff --git a/src/supermin.ml b/src/supermin.ml -index e923111..9f838d9 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - open Types -diff --git a/src/utils.ml b/src/utils.ml -index b25df88..f5990ef 100644 ---- a/src/utils.ml -+++ b/src/utils.ml -@@ -17,6 +17,7 @@ - *) - - open Unix -+open Unix.LargeFile - open Printf - - let (+^) = Int64.add --- -2.29.0.rc2 - diff --git a/sources b/sources index 5a6b3a7..8c56431 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.2.1.tar.gz) = f10ea404e0b27238ea3c25cb68f44e716aa180a45a420e63c1958768032f0710e8e3e7f1346cda780ea1f916f499499da2c02df4019d91ea3b3a69b75cfda545 -SHA512 (supermin-5.2.1.tar.gz.sig) = bde7907ea61e8bb3e59fac235c7bd8e22ef2e16831b80344c4574fdff873a5fc8b8972716143ee9d9bd745ac99b72f11aa4530a8d184a3f287b3212ef85c7a13 +SHA512 (supermin-5.3.1.tar.gz) = c904f62c46941cd7e1d19abd5e82491c46f40333faac4a131439cb2d95ec78ad38c227dadbbedd83317283b11d29d603fc65d2d5fe095d37bbd89e7e212f3e8a +SHA512 (supermin-5.3.1.tar.gz.sig) = e35f300a206316ab8379261318967330a01cd1b8edd63a4185eb9965c74370a4ddda1a93f8668ff5c6984a01e573d1a761d5f91e3382322e36d8853320993a11 diff --git a/supermin.spec b/supermin.spec index 1eccb3d..d771cce 100644 --- a/supermin.spec +++ b/supermin.spec @@ -24,12 +24,12 @@ %global verify_tarball_signature 1 # The source directory. -%global source_directory 5.2-stable +%global source_directory 5.3-development Summary: Tool for creating supermin appliances Name: supermin -Version: 5.2.1 -Release: 4%{?dist} +Version: 5.3.1 +Release: 1%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -44,9 +44,6 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# Upstream fix for stat field overflow on armv7. -Patch1: 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch - BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html @@ -168,6 +165,9 @@ make check || { %changelog +* Thu Aug 26 2021 Richard W.M. Jones - 5.3.1-1 +- New upstream development version 5.3.1. + * Fri Jul 23 2021 Fedora Release Engineering - 5.2.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 8d0c6850b4205395ef03f6b7e296e56be5738dd8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Nov 2021 09:01:52 +0000 Subject: [PATCH 47/95] Ignore zfcpdump kernel on s390x --- 0001-Ignore-zfcpdump-kernel-on-s390x.patch | 28 ++++++++++++++++++++++ supermin.spec | 9 ++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0001-Ignore-zfcpdump-kernel-on-s390x.patch diff --git a/0001-Ignore-zfcpdump-kernel-on-s390x.patch b/0001-Ignore-zfcpdump-kernel-on-s390x.patch new file mode 100644 index 0000000..e3e4fb1 --- /dev/null +++ b/0001-Ignore-zfcpdump-kernel-on-s390x.patch @@ -0,0 +1,28 @@ +From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 29 Nov 2021 14:40:15 +0000 +Subject: [PATCH] Ignore zfcpdump kernel on s390x + +Reported-by: Sebastian Mitterle +Thanks: Cornelia Huck +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375 +--- + src/format_ext2_kernel.ml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 3be4413..ea69ade 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -157,6 +157,8 @@ and kernel_filter patterns is_arm all_files = + ) all_files in + let files = + List.filter (fun filename -> find filename "xen" = -1) files in ++ let files = ++ List.filter (fun filename -> find filename "zfcpdump" = -1) files in + let files = + if not is_arm then files + else ( +-- +2.32.0 + diff --git a/supermin.spec b/supermin.spec index d771cce..29cf4cf 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -44,6 +44,10 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# Ignore zfcpdump kernel on s390x +# Upstream commit: 9fbe476d4df0b01568d3668e6121cae7c779c8c7 +Patch0001: 0001-Ignore-zfcpdump-kernel-on-s390x.patch + BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html @@ -165,6 +169,9 @@ make check || { %changelog +* Tue Nov 30 2021 Richard W.M. Jones - 5.3.1-2 +- Ignore zfcpdump kernel on s390x + * Thu Aug 26 2021 Richard W.M. Jones - 5.3.1-1 - New upstream development version 5.3.1. From 87c3622fef06d383714da9c45a8f46d6289dfb20 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Nov 2021 11:02:04 +0000 Subject: [PATCH 48/95] Work around incorrect kernel provides on RHEL 9 s390x On RHEL 9 s390x, kernel incorrectly pulls in kernel-zfcpdump-core https://bugzilla.redhat.com/show_bug.cgi?id=2027654 --- supermin.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supermin.spec b/supermin.spec index 29cf4cf..17a5c29 100644 --- a/supermin.spec +++ b/supermin.spec @@ -72,6 +72,14 @@ BuildRequires: gnupg2 # tests to not require these packages. BuildRequires: augeas hivex kernel tar +%if 0%{?rhel} +%ifarch s390x +# On RHEL 9 s390x, kernel incorrectly pulls in kernel-zfcpdump-core +# https://bugzilla.redhat.com/show_bug.cgi?id=2027654 +BuildRequires: kernel-core +%endif +%endif + # For complicated reasons, this is required so that # /bin/kernel-install puts the kernel directly into /boot, instead of # into a /boot/ subdirectory (in Fedora >= 23). Read the From 80d74621ab2538066e92555d2d0f7314b527c898 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 1 Dec 2021 10:40:14 +0000 Subject: [PATCH 49/95] Further fix to ignore zfcpdump kernel on s390x --- 0001-Ignore-zfcpdump-kernel-on-s390x.patch | 2 +- ...re-unbootable-kernels-in-lib-modules.patch | 108 ++++++++++++++++++ supermin.spec | 9 +- 3 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 0002-Ignore-unbootable-kernels-in-lib-modules.patch diff --git a/0001-Ignore-zfcpdump-kernel-on-s390x.patch b/0001-Ignore-zfcpdump-kernel-on-s390x.patch index e3e4fb1..9876d68 100644 --- a/0001-Ignore-zfcpdump-kernel-on-s390x.patch +++ b/0001-Ignore-zfcpdump-kernel-on-s390x.patch @@ -1,7 +1,7 @@ From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 29 Nov 2021 14:40:15 +0000 -Subject: [PATCH] Ignore zfcpdump kernel on s390x +Subject: [PATCH 1/2] Ignore zfcpdump kernel on s390x Reported-by: Sebastian Mitterle Thanks: Cornelia Huck diff --git a/0002-Ignore-unbootable-kernels-in-lib-modules.patch b/0002-Ignore-unbootable-kernels-in-lib-modules.patch new file mode 100644 index 0000000..255ee8e --- /dev/null +++ b/0002-Ignore-unbootable-kernels-in-lib-modules.patch @@ -0,0 +1,108 @@ +From f53868ce875fc17527696a85b48c67fefa3176e7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 1 Dec 2021 10:28:36 +0000 +Subject: [PATCH 2/2] Ignore unbootable kernels in /lib/modules + +The previous commit didn't ignore zfcpdump kernels if found in +/lib/modules because we didn't apply the kernel filter to those paths. + +Also this commit cleans up the code in general, splitting up the +multi-purpose "kernel_filter" function into two parts with clearer +roles. + +Fixes: commit 9fbe476d4df0b01568d3668e6121cae7c779c8c7 +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375 +Reported-by: Yongkui Guo +--- + src/format_ext2_kernel.ml | 44 +++++++++++++++++++++++---------------- + 1 file changed, 26 insertions(+), 18 deletions(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index ea69ade..79d636b 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -38,7 +38,7 @@ let rec build_kernel debug host_cpu copy_kernel kernel = + | None -> + if debug >= 1 then + printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!"; +- match find_kernel_from_lib_modules debug with ++ match find_kernel_from_lib_modules debug host_cpu with + | Some k -> k + | None -> + if debug >= 1 then +@@ -89,10 +89,13 @@ and find_kernel_from_env_vars debug = + Some (kernel_env, kernel_name, kernel_version, modpath) + with Not_found -> None + +-and find_kernel_from_lib_modules debug = ++and find_kernel_from_lib_modules debug host_cpu = ++ let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in ++ let files = Array.to_list files in ++ ++ let files = ignore_unbootable_kernels host_cpu files in ++ + let kernels = +- let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in +- let files = Array.to_list files in + let kernels = + filter_map ( + fun kernel_file -> +@@ -114,22 +117,22 @@ and find_kernel_from_lib_modules debug = + | [] -> None + + and find_kernel_from_boot debug host_cpu = +- let is_arm = +- String.length host_cpu >= 3 && +- host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in +- + let all_files = Sys.readdir "/boot" in + let all_files = Array.to_list all_files in + + (* In original: ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen *) + let patterns = patt_of_cpu host_cpu in +- let files = kernel_filter patterns is_arm all_files in ++ let files = files_matching_globs patterns all_files in ++ let files = ignore_unbootable_kernels host_cpu files in + + let files = + if files <> [] then files +- else ++ else ( + (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) +- kernel_filter ["vmlinu?-*"] is_arm all_files in ++ let files = files_matching_globs ["vmlinu?-*"] all_files in ++ let files = ignore_unbootable_kernels host_cpu files in ++ files ++ ) in + + let files = List.sort (fun a b -> compare_version b a) files in + let kernels = +@@ -148,13 +151,18 @@ and find_kernel_from_boot debug host_cpu = + | kernel :: _ -> Some kernel + | [] -> None + +-and kernel_filter patterns is_arm all_files = +- let files = +- List.filter +- (fun filename -> +- List.exists +- (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns +- ) all_files in ++and files_matching_globs patterns files = ++ List.filter ++ (fun filename -> ++ List.exists ++ (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns ++ ) files ++ ++and ignore_unbootable_kernels host_cpu files = ++ let is_arm = ++ String.length host_cpu >= 3 && ++ host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in ++ + let files = + List.filter (fun filename -> find filename "xen" = -1) files in + let files = +-- +2.32.0 + diff --git a/supermin.spec b/supermin.spec index 17a5c29..2a5cdcf 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -44,9 +44,9 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# Ignore zfcpdump kernel on s390x -# Upstream commit: 9fbe476d4df0b01568d3668e6121cae7c779c8c7 +# Ignore zfcpdump kernel on s390x, upstream in 5.3.2 Patch0001: 0001-Ignore-zfcpdump-kernel-on-s390x.patch +Patch0002: 0002-Ignore-unbootable-kernels-in-lib-modules.patch BuildRequires: make BuildRequires: /usr/bin/pod2man @@ -177,6 +177,9 @@ make check || { %changelog +* Wed Dec 01 2021 Richard W.M. Jones - 5.3.1-3 +- Further fix to ignore zfcpdump kernel on s390x + * Tue Nov 30 2021 Richard W.M. Jones - 5.3.1-2 - Ignore zfcpdump kernel on s390x From 304198ebcf00546558da6ceb12deb8e398b89a3b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 01:58:06 +0000 Subject: [PATCH 50/95] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 2a5cdcf..75f594c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -29,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -177,6 +177,9 @@ make check || { %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 5.3.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Wed Dec 01 2021 Richard W.M. Jones - 5.3.1-3 - Further fix to ignore zfcpdump kernel on s390x From 13688555ee49c0c85c1da2d2de5acec4d8cb11b7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Feb 2022 18:12:39 +0000 Subject: [PATCH 51/95] OCaml 4.13.1 rebuild to remove package notes --- supermin.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 75f594c..60a47b3 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,3 +1,5 @@ +%undefine _package_note_flags + # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # @@ -29,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.1 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -177,6 +179,9 @@ make check || { %changelog +* Fri Feb 04 2022 Richard W.M. Jones - 5.3.1-5 +- OCaml 4.13.1 rebuild to remove package notes + * Sat Jan 22 2022 Fedora Release Engineering - 5.3.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 767dca226a057b60fa522dab16c6d4adf272e999 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 28 Feb 2022 13:07:25 +0000 Subject: [PATCH 52/95] Fix link to dependency generator documentation --- supermin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 60a47b3..64495c3 100644 --- a/supermin.spec +++ b/supermin.spec @@ -102,7 +102,7 @@ Requires: e2fsprogs-libs >= 1.42 Requires: findutils # For automatic RPM dependency generation. -# See: http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator +# See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html Source3: supermin.attr Source4: supermin-find-requires From ac4b685403c9d39f315c31ab94bd07f619df9e8d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Mar 2022 13:32:40 +0000 Subject: [PATCH 53/95] New upstream development version 5.3.2 --- sources | 4 ++-- supermin.spec | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sources b/sources index 8c56431..3bc8f7e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.3.1.tar.gz) = c904f62c46941cd7e1d19abd5e82491c46f40333faac4a131439cb2d95ec78ad38c227dadbbedd83317283b11d29d603fc65d2d5fe095d37bbd89e7e212f3e8a -SHA512 (supermin-5.3.1.tar.gz.sig) = e35f300a206316ab8379261318967330a01cd1b8edd63a4185eb9965c74370a4ddda1a93f8668ff5c6984a01e573d1a761d5f91e3382322e36d8853320993a11 +SHA512 (supermin-5.3.2.tar.gz) = 501731e9cce8bf1f4743eeff4af620813d466da10b664df037575a546b3b8e8697ed9e881dde7d3ba737e6a78536717c1823e22cdc1c92409db78d976a6678b5 +SHA512 (supermin-5.3.2.tar.gz.sig) = 5006481ab4c9a5ef5120654ac36fef3da634e03e0cacf4c27f44a5b37d7a906f3fdf911fde666a8f8dd08fce7e129399dbbb139d8e29c05a54dac9399ce31c9a diff --git a/supermin.spec b/supermin.spec index 64495c3..71fad00 100644 --- a/supermin.spec +++ b/supermin.spec @@ -30,8 +30,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.3.1 -Release: 5%{?dist} +Version: 5.3.2 +Release: 1%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -179,6 +179,9 @@ make check || { %changelog +* Fri Mar 04 2022 Richard W.M. Jones - 5.3.2-1 +- New upstream development version 5.3.2 + * Fri Feb 04 2022 Richard W.M. Jones - 5.3.1-5 - OCaml 4.13.1 rebuild to remove package notes From 20580487687315fd389c5f974a3d7223ee0fe293 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Mar 2022 13:39:22 +0000 Subject: [PATCH 54/95] Remove upstream patches --- 0001-Ignore-zfcpdump-kernel-on-s390x.patch | 28 ----- ...re-unbootable-kernels-in-lib-modules.patch | 108 ------------------ supermin.spec | 4 - 3 files changed, 140 deletions(-) delete mode 100644 0001-Ignore-zfcpdump-kernel-on-s390x.patch delete mode 100644 0002-Ignore-unbootable-kernels-in-lib-modules.patch diff --git a/0001-Ignore-zfcpdump-kernel-on-s390x.patch b/0001-Ignore-zfcpdump-kernel-on-s390x.patch deleted file mode 100644 index 9876d68..0000000 --- a/0001-Ignore-zfcpdump-kernel-on-s390x.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9fbe476d4df0b01568d3668e6121cae7c779c8c7 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 29 Nov 2021 14:40:15 +0000 -Subject: [PATCH 1/2] Ignore zfcpdump kernel on s390x - -Reported-by: Sebastian Mitterle -Thanks: Cornelia Huck -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375 ---- - src/format_ext2_kernel.ml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 3be4413..ea69ade 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -157,6 +157,8 @@ and kernel_filter patterns is_arm all_files = - ) all_files in - let files = - List.filter (fun filename -> find filename "xen" = -1) files in -+ let files = -+ List.filter (fun filename -> find filename "zfcpdump" = -1) files in - let files = - if not is_arm then files - else ( --- -2.32.0 - diff --git a/0002-Ignore-unbootable-kernels-in-lib-modules.patch b/0002-Ignore-unbootable-kernels-in-lib-modules.patch deleted file mode 100644 index 255ee8e..0000000 --- a/0002-Ignore-unbootable-kernels-in-lib-modules.patch +++ /dev/null @@ -1,108 +0,0 @@ -From f53868ce875fc17527696a85b48c67fefa3176e7 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 1 Dec 2021 10:28:36 +0000 -Subject: [PATCH 2/2] Ignore unbootable kernels in /lib/modules - -The previous commit didn't ignore zfcpdump kernels if found in -/lib/modules because we didn't apply the kernel filter to those paths. - -Also this commit cleans up the code in general, splitting up the -multi-purpose "kernel_filter" function into two parts with clearer -roles. - -Fixes: commit 9fbe476d4df0b01568d3668e6121cae7c779c8c7 -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2027375 -Reported-by: Yongkui Guo ---- - src/format_ext2_kernel.ml | 44 +++++++++++++++++++++++---------------- - 1 file changed, 26 insertions(+), 18 deletions(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index ea69ade..79d636b 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -38,7 +38,7 @@ let rec build_kernel debug host_cpu copy_kernel kernel = - | None -> - if debug >= 1 then - printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!"; -- match find_kernel_from_lib_modules debug with -+ match find_kernel_from_lib_modules debug host_cpu with - | Some k -> k - | None -> - if debug >= 1 then -@@ -89,10 +89,13 @@ and find_kernel_from_env_vars debug = - Some (kernel_env, kernel_name, kernel_version, modpath) - with Not_found -> None - --and find_kernel_from_lib_modules debug = -+and find_kernel_from_lib_modules debug host_cpu = -+ let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in -+ let files = Array.to_list files in -+ -+ let files = ignore_unbootable_kernels host_cpu files in -+ - let kernels = -- let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in -- let files = Array.to_list files in - let kernels = - filter_map ( - fun kernel_file -> -@@ -114,22 +117,22 @@ and find_kernel_from_lib_modules debug = - | [] -> None - - and find_kernel_from_boot debug host_cpu = -- let is_arm = -- String.length host_cpu >= 3 && -- host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in -- - let all_files = Sys.readdir "/boot" in - let all_files = Array.to_list all_files in - - (* In original: ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen *) - let patterns = patt_of_cpu host_cpu in -- let files = kernel_filter patterns is_arm all_files in -+ let files = files_matching_globs patterns all_files in -+ let files = ignore_unbootable_kernels host_cpu files in - - let files = - if files <> [] then files -- else -+ else ( - (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) -- kernel_filter ["vmlinu?-*"] is_arm all_files in -+ let files = files_matching_globs ["vmlinu?-*"] all_files in -+ let files = ignore_unbootable_kernels host_cpu files in -+ files -+ ) in - - let files = List.sort (fun a b -> compare_version b a) files in - let kernels = -@@ -148,13 +151,18 @@ and find_kernel_from_boot debug host_cpu = - | kernel :: _ -> Some kernel - | [] -> None - --and kernel_filter patterns is_arm all_files = -- let files = -- List.filter -- (fun filename -> -- List.exists -- (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns -- ) all_files in -+and files_matching_globs patterns files = -+ List.filter -+ (fun filename -> -+ List.exists -+ (fun patt -> fnmatch patt filename [FNM_NOESCAPE]) patterns -+ ) files -+ -+and ignore_unbootable_kernels host_cpu files = -+ let is_arm = -+ String.length host_cpu >= 3 && -+ host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in -+ - let files = - List.filter (fun filename -> find filename "xen" = -1) files in - let files = --- -2.32.0 - diff --git a/supermin.spec b/supermin.spec index 71fad00..7d0e22c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -46,10 +46,6 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# Ignore zfcpdump kernel on s390x, upstream in 5.3.2 -Patch0001: 0001-Ignore-zfcpdump-kernel-on-s390x.patch -Patch0002: 0002-Ignore-unbootable-kernels-in-lib-modules.patch - BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html From aab96d51f3c3fe41200f87a215d4758b7d782894 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 15 May 2022 18:17:52 +0100 Subject: [PATCH 55/95] Move dependency on dnf to -devel subpackage (RHBZ#2086302) --- supermin.spec | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/supermin.spec b/supermin.spec index 7d0e22c..4e48582 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -86,16 +86,16 @@ BuildRequires: grubby # https://bugzilla.redhat.com/show_bug.cgi?id=1331012 BuildRequires: systemd-udev +# This only includes the dependencies needed at runtime, ie. supermin +# --build. For supermin --prepare, dependencies like dnf are placed +# in the -devel subpackage. Requires: rpm -Requires: dnf -Requires: dnf-plugins-core Requires: util-linux-ng Requires: cpio Requires: tar Requires: /usr/sbin/mke2fs # RHBZ#771310 Requires: e2fsprogs-libs >= 1.42 -Requires: findutils # For automatic RPM dependency generation. # See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html @@ -109,18 +109,27 @@ appliances (similar to virtual machines), usually around 100KB in size, which get fully instantiated on-the-fly in a fraction of a second when you need to boot one of them. +Note that if you want to run 'supermin --prepare' you will need the +extra dependencies provided by %{name}-devel. + %package devel Summary: Development tools for %{name} Requires: %{name} = %{version}-%{release} Requires: rpm-build +# Dependencies needed for supermin --prepare +Requires: dnf +Requires: dnf-plugins-core +Requires: findutils + %description devel %{name}-devel contains development tools for %{name}. -It just contains tools for automatic RPM dependency generation -from supermin appliances. +It contains extra dependencies needed for 'supermin --prepare' to +work, as well as tools for automatic RPM dependency generation from +supermin appliances. %prep @@ -175,6 +184,9 @@ make check || { %changelog +* Sun May 15 2022 Richard W.M. Jones - 5.3.2-2 +- Move dependency on dnf to -devel subpackage (RHBZ#2086302) + * Fri Mar 04 2022 Richard W.M. Jones - 5.3.2-1 - New upstream development version 5.3.2 From 0999d4f7115d5b7d23d6f7fdf831cb8ba75ae17a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 18 Jun 2022 15:25:48 +0100 Subject: [PATCH 56/95] OCaml 4.14.0 rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 4e48582..83dc7e5 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -184,6 +184,9 @@ make check || { %changelog +* Sat Jun 18 2022 Richard W.M. Jones - 5.3.2-3 +- OCaml 4.14.0 rebuild + * Sun May 15 2022 Richard W.M. Jones - 5.3.2-2 - Move dependency on dnf to -devel subpackage (RHBZ#2086302) From 1aa63b8ba21cca771b27b3cd1d6db5add6b97ab3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 09:44:53 +0000 Subject: [PATCH 57/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 83dc7e5..be51345 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -184,6 +184,9 @@ make check || { %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 5.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jun 18 2022 Richard W.M. Jones - 5.3.2-3 - OCaml 4.14.0 rebuild From 1951f6acfa2875ca5e877c05024eb5b5bb10d832 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 7 Sep 2022 16:17:36 +0100 Subject: [PATCH 58/95] Include all upstream patches since 5.3.2 Add debugging and accurate exception backtraces (RHBZ#2124571). --- 0001-Fix-for-missing-lib-modules.patch | 44 +++++++++++ ...n-Recognise-Artix-an-Arch-derivative.patch | 24 ++++++ ...-pacman-Fix-database-mtime-detection.patch | 31 ++++++++ ...not-detect-package-manager-on-anolis.patch | 31 ++++++++ ...rnings-about-unchecked-return-values.patch | 29 ++++++++ ...ml-Use-non-deprecated-warning-format.patch | 28 +++++++ ...ings-about-parsing-ints-from-strings.patch | 61 ++++++++++++++++ ...-Use-error-function-instead-of-failw.patch | 28 +++++++ ...-more-warnings-about-parsing-ints-fr.patch | 27 +++++++ 0010-src-Replace-noalloc-with-noalloc.patch | 56 ++++++++++++++ 0011-src-Unconditionally-enable-g-flag.patch | 28 +++++++ ...nd-print-global-exception-backtraces.patch | 73 +++++++++++++++++++ supermin.spec | 20 ++++- 13 files changed, 479 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-for-missing-lib-modules.patch create mode 100644 0002-pacman-Recognise-Artix-an-Arch-derivative.patch create mode 100644 0003-pacman-Fix-database-mtime-detection.patch create mode 100644 0004-fix-cannot-detect-package-manager-on-anolis.patch create mode 100644 0005-init-Ignore-warnings-about-unchecked-return-values.patch create mode 100644 0006-ocaml-Use-non-deprecated-warning-format.patch create mode 100644 0007-src-Fix-warnings-about-parsing-ints-from-strings.patch create mode 100644 0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch create mode 100644 0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch create mode 100644 0010-src-Replace-noalloc-with-noalloc.patch create mode 100644 0011-src-Unconditionally-enable-g-flag.patch create mode 100644 0012-src-Record-and-print-global-exception-backtraces.patch diff --git a/0001-Fix-for-missing-lib-modules.patch b/0001-Fix-for-missing-lib-modules.patch new file mode 100644 index 0000000..f1d5b4e --- /dev/null +++ b/0001-Fix-for-missing-lib-modules.patch @@ -0,0 +1,44 @@ +From 8effa5a686037ba3c2f8c97753f398b73cc54881 Mon Sep 17 00:00:00 2001 +From: George Prekas +Date: Wed, 6 Apr 2022 16:15:15 -0500 +Subject: [PATCH 01/12] Fix for missing /lib/modules. + +Even when supplied with $SUPERMIN_MODULES, supermin tries to access +/lib/modules. This directory does not exist by default in all the +environments. +--- + src/format_ext2.ml | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/src/format_ext2.ml b/src/format_ext2.ml +index e311ea6..484b469 100644 +--- a/src/format_ext2.ml ++++ b/src/format_ext2.ml +@@ -95,8 +95,22 @@ let build_ext2 debug basedir files modpath kernel_version appliance size + printf "supermin: ext2: copying kernel modules\n%!"; + + (* Import the kernel modules. *) +- ext2fs_copy_file_from_host fs "/lib" "/lib"; +- ext2fs_copy_file_from_host fs "/lib/modules" "/lib/modules"; ++ (try ++ ext2fs_copy_file_from_host fs "/lib" "/lib" ++ with Unix_error _ -> ++ (* If /lib doesn't exist on the host, create /lib directory ++ * in the image, populating it with mode etc from host / ++ *) ++ ext2fs_copy_file_from_host fs "/" "/lib" ++ ); ++ ++ (try ++ ext2fs_copy_file_from_host fs "/lib/modules" "/lib/modules" ++ with Unix_error _ -> ++ (* As above, if /lib/modules does not exist on the host. *) ++ ext2fs_copy_file_from_host fs "/" "/lib/modules" ++ ); ++ + ext2fs_copy_dir_recursively_from_host fs + modpath ("/lib/modules/" ^ kernel_version); + +-- +2.37.3 + diff --git a/0002-pacman-Recognise-Artix-an-Arch-derivative.patch b/0002-pacman-Recognise-Artix-an-Arch-derivative.patch new file mode 100644 index 0000000..8549ca1 --- /dev/null +++ b/0002-pacman-Recognise-Artix-an-Arch-derivative.patch @@ -0,0 +1,24 @@ +From e5cd10fc0952da1c51eb7b762fe19d54b2ec1e8d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 29 Apr 2022 15:24:17 +0100 +Subject: [PATCH 02/12] pacman: Recognise Artix, an Arch derivative + +--- + src/ph_pacman.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml +index 376b14b..4a1c669 100644 +--- a/src/ph_pacman.ml ++++ b/src/ph_pacman.ml +@@ -26,6 +26,7 @@ open Package_handler + let pacman_detect () = + Config.pacman <> "no" && Config.fakeroot <> "no" && + (Os_release.get_id () = "arch" || ++ Os_release.get_id () = "artix" || + ((stat "/etc/arch-release").st_kind = S_REG && + Config.pacman_g2 = "no")) (* not Frugalware with pacman-g2 *) + +-- +2.37.3 + diff --git a/0003-pacman-Fix-database-mtime-detection.patch b/0003-pacman-Fix-database-mtime-detection.patch new file mode 100644 index 0000000..7ee65c7 --- /dev/null +++ b/0003-pacman-Fix-database-mtime-detection.patch @@ -0,0 +1,31 @@ +From c9ddb9648b3b810aa50fc238edb5fe55df9643b6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 29 Apr 2022 15:24:41 +0100 +Subject: [PATCH 03/12] pacman: Fix database mtime detection + +There is no "core.db" file on Artix, it may exist on Arch. However +a better way to detect this is to check the mtime of the containing +directory. +--- + src/ph_pacman.ml | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml +index 4a1c669..d9ecb29 100644 +--- a/src/ph_pacman.ml ++++ b/src/ph_pacman.ml +@@ -129,7 +129,10 @@ let pacman_package_name pkg = + pac.name + + let pacman_get_package_database_mtime () = +- (lstat "/var/lib/pacman/sync/core.db" (* XXX? *) ).st_mtime ++ (* This directory changes mtime when packages get installed/reinstalled. ++ * The directory itself contains several *.db files with different names. ++ *) ++ (lstat "/var/lib/pacman/sync/").st_mtime + + let pacman_get_all_requires pkgs = + let cmd = sprintf "\ +-- +2.37.3 + diff --git a/0004-fix-cannot-detect-package-manager-on-anolis.patch b/0004-fix-cannot-detect-package-manager-on-anolis.patch new file mode 100644 index 0000000..da2891f --- /dev/null +++ b/0004-fix-cannot-detect-package-manager-on-anolis.patch @@ -0,0 +1,31 @@ +From b47d2f1fe29557874409295c55971c91379fa756 Mon Sep 17 00:00:00 2001 +From: mahailiang +Date: Fri, 19 Aug 2022 15:41:24 +0800 +Subject: [PATCH 04/12] fix cannot detect package manager on anolis + +--- + 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 549bd9a..f1ea299 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -32,11 +32,12 @@ 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" ] || ++ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "anolis" ] || + 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/openEuler-release").st_kind = S_REG || ++ (stat "/etc/anolis-release").st_kind = S_REG + with Unix_error _ -> false) + + let opensuse_detect () = +-- +2.37.3 + diff --git a/0005-init-Ignore-warnings-about-unchecked-return-values.patch b/0005-init-Ignore-warnings-about-unchecked-return-values.patch new file mode 100644 index 0000000..a26ca50 --- /dev/null +++ b/0005-init-Ignore-warnings-about-unchecked-return-values.patch @@ -0,0 +1,29 @@ +From c89146030ffd0ffdf921917111b88d3b32c5b2b8 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 12:01:36 +0100 +Subject: [PATCH 05/12] init: Ignore warnings about unchecked return values + +--- + init/init.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/init/init.c b/init/init.c +index 60e099e..bc28c69 100644 +--- a/init/init.c ++++ b/init/init.c +@@ -49,6 +49,12 @@ + /* else it's in sys/types.h, included above */ + #endif + ++/* We make several calls to asprintf, chdir, fgets and ignore the ++ * result. Since this is a minimal init system there's nothing we can ++ * do if these calls fail. ++ */ ++#pragma GCC diagnostic ignored "-Wunused-result" ++ + /* Maximum time to wait for the root device to appear (seconds). + * + * On slow machines with lots of disks (Koji running the 255 disk test +-- +2.37.3 + diff --git a/0006-ocaml-Use-non-deprecated-warning-format.patch b/0006-ocaml-Use-non-deprecated-warning-format.patch new file mode 100644 index 0000000..9aa3c07 --- /dev/null +++ b/0006-ocaml-Use-non-deprecated-warning-format.patch @@ -0,0 +1,28 @@ +From 4363354763fe858973af287058d0fa2efe90cdd0 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 12:01:50 +0100 +Subject: [PATCH 06/12] ocaml: Use non-deprecated warning format + +Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, +like 'CDEFLMPSUVXYZ', is deprecated. +Use the equivalent signed form: +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3. +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index c54b63e..0fcc3ad 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -127,7 +127,7 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo) + XOBJECTS = $(SOURCES_ML:.ml=.cmx) + + OCAMLPACKAGES = -package unix,str +-OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ-3 ++OCAMLFLAGS = -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 + + if !HAVE_OCAMLOPT + OBJECTS = $(BOBJECTS) +-- +2.37.3 + diff --git a/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch b/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch new file mode 100644 index 0000000..aeeae63 --- /dev/null +++ b/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch @@ -0,0 +1,61 @@ +From 63b515b375ebf2dbcc7b0b53f2031c3aa63ac8dc Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 12:03:29 +0100 +Subject: [PATCH 07/12] src: Fix warnings about parsing ints from strings + +Warnings of the form: + +90 | Failure "int_of_string" -> + ^^^^^^^^^^^^^^^ +Warning 52 [fragile-literal-pattern]: Code should not depend on the +actual values of this constructor's arguments. They are only for +information and may change in future versions. (See manual section +11.5) +--- + src/ph_pacman.ml | 2 +- + src/ph_rpm.ml | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml +index d9ecb29..44445a6 100644 +--- a/src/ph_pacman.ml ++++ b/src/ph_pacman.ml +@@ -87,7 +87,7 @@ let pacman_package_of_string str = + | _ -> assert false in + epoch, version, release + with +- Failure "int_of_string" -> ++ Failure _ -> + failwith ("failed to parse epoch:version-release field " ^ evr) in + + { name = name; +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index f1ea299..85557fe 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -89,7 +89,7 @@ let rec rpm_init s = + | [x] -> error "unable to parse rpm version string: %s" x + | major :: minor :: _ -> + try int_of_string major, int_of_string minor +- with Failure "int_of_string" -> ++ with Failure _ -> + error "unable to parse rpm version string: non-numeric, %s" version in + rpm_major := major; + rpm_minor := minor; +@@ -120,11 +120,11 @@ and opensuse_init s = + | [x] -> error "unable to parse output of zypper --version: %s" x + | major :: minor :: [] -> + (try int_of_string major, int_of_string minor, 0 +- with Failure "int_of_string" -> ++ with Failure _ -> + error "unable to parse output of zypper --version: non-numeric") + | major :: minor :: patch :: _ -> + (try int_of_string major, int_of_string minor, int_of_string patch +- with Failure "int_of_string" -> ++ with Failure _ -> + error "unable to parse output of zypper --version: non-numeric") in + zypper_major := major; + zypper_minor := minor; +-- +2.37.3 + diff --git a/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch b/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch new file mode 100644 index 0000000..57f4f03 --- /dev/null +++ b/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch @@ -0,0 +1,28 @@ +From b202062325e92bce865ad48b1e6d9f29b01ade6b Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 12:04:46 +0100 +Subject: [PATCH 08/12] src/ph_pacman.ml: Use error function instead of + failwith + +Slightly nicer output and a bit easier to use because it supports +printf-style formatting. +--- + src/ph_pacman.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml +index 44445a6..25ef4fc 100644 +--- a/src/ph_pacman.ml ++++ b/src/ph_pacman.ml +@@ -88,7 +88,7 @@ let pacman_package_of_string str = + epoch, version, release + with + Failure _ -> +- failwith ("failed to parse epoch:version-release field " ^ evr) in ++ error "failed to parse epoch:version-release field: %s " evr in + + { name = name; + epoch = epoch; +-- +2.37.3 + diff --git a/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch b/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch new file mode 100644 index 0000000..c6559ce --- /dev/null +++ b/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch @@ -0,0 +1,27 @@ +From 9b157474961b35e422704d32234d4ca5369acbe8 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 13:57:11 +0100 +Subject: [PATCH 09/12] src/utils.ml: Fix more warnings about parsing ints from + strings + +Updates: commit 63b515b375ebf2dbcc7b0b53f2031c3aa63ac8dc +--- + src/utils.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/utils.ml b/src/utils.ml +index f5990ef..521d49e 100644 +--- a/src/utils.ml ++++ b/src/utils.ml +@@ -162,7 +162,7 @@ and split_version = function + let rest = Str.matched_group 2 str in + let n = + try `Number (int_of_string n) +- with Failure "int_of_string" -> `String n in ++ with Failure _ -> `String n in + n, rest + ) + else if Str.string_match rex_letters str 0 then +-- +2.37.3 + diff --git a/0010-src-Replace-noalloc-with-noalloc.patch b/0010-src-Replace-noalloc-with-noalloc.patch new file mode 100644 index 0000000..caa8d05 --- /dev/null +++ b/0010-src-Replace-noalloc-with-noalloc.patch @@ -0,0 +1,56 @@ +From e3cb3fb2c3e6c29d57db953099878813538281e6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Sep 2022 15:47:00 +0100 +Subject: [PATCH 10/12] src: Replace "noalloc" with [@@noalloc] + +Avoids deprecation warnings like: + +File "librpm.ml", line 19, characters 0-80: +Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc" + +I have checked that this still works with RHEL 7. +--- + src/librpm-c.c | 2 ++ + src/librpm.ml | 4 ++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/librpm-c.c b/src/librpm-c.c +index ea32926..7b2b505 100644 +--- a/src/librpm-c.c ++++ b/src/librpm-c.c +@@ -118,6 +118,7 @@ Val_librpm (struct librpm_data *data) + CAMLreturn (rpmv); + } + ++/* NB: This is a [@@noalloc] call. */ + value + supermin_rpm_is_available (value unit) + { +@@ -130,6 +131,7 @@ supermin_rpm_version (value unit) + return caml_copy_string (RPMVERSION); + } + ++/* NB: This is a [@@noalloc] call. */ + value + supermin_rpm_vercmp (value av, value bv) + { +diff --git a/src/librpm.ml b/src/librpm.ml +index c987e21..0a6c3f7 100644 +--- a/src/librpm.ml ++++ b/src/librpm.ml +@@ -16,10 +16,10 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +-external rpm_is_available : unit -> bool = "supermin_rpm_is_available" "noalloc" ++external rpm_is_available : unit -> bool = "supermin_rpm_is_available" [@@noalloc] + + external rpm_version : unit -> string = "supermin_rpm_version" +-external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" ++external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" [@@noalloc] + external rpm_get_arch : unit -> string = "supermin_rpm_get_arch" + + type t +-- +2.37.3 + diff --git a/0011-src-Unconditionally-enable-g-flag.patch b/0011-src-Unconditionally-enable-g-flag.patch new file mode 100644 index 0000000..9b5c30c --- /dev/null +++ b/0011-src-Unconditionally-enable-g-flag.patch @@ -0,0 +1,28 @@ +From 5d3d21b985b328317537e3d9a540840c5dade940 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 7 Sep 2022 16:12:12 +0100 +Subject: [PATCH 11/12] src: Unconditionally enable -g flag + +It's been possible to use -g with ocamlc for years now, and it's +always useful to compile with debugging enabled. In particular this +is necessary to display accurate backtraces. +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 0fcc3ad..5b07e5d 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -127,7 +127,7 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo) + XOBJECTS = $(SOURCES_ML:.ml=.cmx) + + OCAMLPACKAGES = -package unix,str +-OCAMLFLAGS = -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 ++OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 + + if !HAVE_OCAMLOPT + OBJECTS = $(BOBJECTS) +-- +2.37.3 + diff --git a/0012-src-Record-and-print-global-exception-backtraces.patch b/0012-src-Record-and-print-global-exception-backtraces.patch new file mode 100644 index 0000000..a2fafc6 --- /dev/null +++ b/0012-src-Record-and-print-global-exception-backtraces.patch @@ -0,0 +1,73 @@ +From ae7151cd943907a6044d9e1b82df87a2f805507b Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 7 Sep 2022 16:02:47 +0100 +Subject: [PATCH 12/12] src: Record and print global exception backtraces + +We have a central place to catch global exceptions. Unfortunately the +act of doing that hides the exception if OCAMLRUNPARAM=b was set. + +We almost always want to see where these exceptions are thrown so turn +on exception recording unconditionally and print them. + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=2124571 +--- + src/supermin.ml | 32 +++++++++++++++++++++----------- + 1 file changed, 21 insertions(+), 11 deletions(-) + +diff --git a/src/supermin.ml b/src/supermin.ml +index 9f838d9..659e857 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -1,5 +1,5 @@ + (* supermin 5 +- * Copyright (C) 2009-2014 Red Hat Inc. ++ * Copyright (C) 2009-2022 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -291,22 +291,32 @@ appliance automatically. + package_handler_shutdown () + + let () = +- try main () ++ try ++ Printexc.record_backtrace true; ++ main () + with + | Unix.Unix_error (code, fname, "") -> (* from a syscall *) +- error "error: %s: %s" fname (Unix.error_message code) ++ Printexc.print_backtrace Pervasives.stderr; ++ error "error: %s: %s" fname (Unix.error_message code) + | Unix.Unix_error (code, fname, param) -> (* from a syscall *) +- error "error: %s: %s: %s" fname (Unix.error_message code) param ++ Printexc.print_backtrace Pervasives.stderr; ++ error "error: %s: %s: %s" fname (Unix.error_message code) param + | Failure msg -> (* from failwith/failwithf *) +- error "failure: %s" msg ++ Printexc.print_backtrace Pervasives.stderr; ++ error "failure: %s" msg + | Librpm.Multiple_matches (package, count) -> (* from librpm *) +- error "RPM error: %d occurrences for %s" count package ++ Printexc.print_backtrace Pervasives.stderr; ++ error "RPM error: %d occurrences for %s" count package + | Invalid_argument msg -> (* probably should never happen *) +- error "internal error: invalid argument: %s" msg ++ Printexc.print_backtrace Pervasives.stderr; ++ error "internal error: invalid argument: %s" msg + | Assert_failure (file, line, char) -> (* should never happen *) +- error "internal error: assertion failed at %s, line %d, char %d" +- file line char ++ Printexc.print_backtrace Pervasives.stderr; ++ error "internal error: assertion failed at %s, line %d, char %d" ++ file line char + | Not_found -> (* should never happen *) +- error "internal error: Not_found exception was thrown" ++ Printexc.print_backtrace Pervasives.stderr; ++ error "internal error: Not_found exception was thrown" + | exn -> (* something not matched above *) +- error "exception: %s" (Printexc.to_string exn) ++ Printexc.print_backtrace Pervasives.stderr; ++ error "exception: %s" (Printexc.to_string exn) +-- +2.37.3 + diff --git a/supermin.spec b/supermin.spec index be51345..e02f46e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.2 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -46,6 +46,20 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# All upstream patches since 5.3.2: +Patch: 0001-Fix-for-missing-lib-modules.patch +Patch: 0002-pacman-Recognise-Artix-an-Arch-derivative.patch +Patch: 0003-pacman-Fix-database-mtime-detection.patch +Patch: 0004-fix-cannot-detect-package-manager-on-anolis.patch +Patch: 0005-init-Ignore-warnings-about-unchecked-return-values.patch +Patch: 0006-ocaml-Use-non-deprecated-warning-format.patch +Patch: 0007-src-Fix-warnings-about-parsing-ints-from-strings.patch +Patch: 0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch +Patch: 0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch +Patch: 0010-src-Replace-noalloc-with-noalloc.patch +Patch: 0011-src-Unconditionally-enable-g-flag.patch +Patch: 0012-src-Record-and-print-global-exception-backtraces.patch + BuildRequires: make BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html @@ -184,6 +198,10 @@ make check || { %changelog +* Wed Sep 07 2022 Richard W.M. Jones - 5.3.2-5 +- Include all upstream patches since 5.3.2 +- Add debugging and accurate exception backtraces (RHBZ#2124571). + * Sat Jul 23 2022 Fedora Release Engineering - 5.3.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From c0e4947ad7e9729d495b78690d4e9d6882d3773f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 7 Sep 2022 16:26:53 +0100 Subject: [PATCH 59/95] Unconditionally run autoreconf --- supermin.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supermin.spec b/supermin.spec index e02f46e..5a7783f 100644 --- a/supermin.spec +++ b/supermin.spec @@ -60,7 +60,9 @@ Patch: 0010-src-Replace-noalloc-with-noalloc.patch Patch: 0011-src-Unconditionally-enable-g-flag.patch Patch: 0012-src-Record-and-print-global-exception-backtraces.patch +BuildRequires: gcc BuildRequires: make +BuildRequires: autoconf, automake BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -155,6 +157,7 @@ supermin appliances. %build +autoreconf -fi %configure --disable-network-tests %if %{with dietlibc} From 444d5646191b25dc1d499a8ceacf2bb643ecdc1f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 18 Oct 2022 14:48:32 +0100 Subject: [PATCH 60/95] New upstream development version 5.3.3 --- 0001-Fix-for-missing-lib-modules.patch | 44 ----------- ...n-Recognise-Artix-an-Arch-derivative.patch | 24 ------ ...-pacman-Fix-database-mtime-detection.patch | 31 -------- ...not-detect-package-manager-on-anolis.patch | 31 -------- ...rnings-about-unchecked-return-values.patch | 29 -------- ...ml-Use-non-deprecated-warning-format.patch | 28 ------- ...ings-about-parsing-ints-from-strings.patch | 61 ---------------- ...-Use-error-function-instead-of-failw.patch | 28 ------- ...-more-warnings-about-parsing-ints-fr.patch | 27 ------- 0010-src-Replace-noalloc-with-noalloc.patch | 56 -------------- 0011-src-Unconditionally-enable-g-flag.patch | 28 ------- ...nd-print-global-exception-backtraces.patch | 73 ------------------- sources | 4 +- supermin.spec | 21 ++---- 14 files changed, 7 insertions(+), 478 deletions(-) delete mode 100644 0001-Fix-for-missing-lib-modules.patch delete mode 100644 0002-pacman-Recognise-Artix-an-Arch-derivative.patch delete mode 100644 0003-pacman-Fix-database-mtime-detection.patch delete mode 100644 0004-fix-cannot-detect-package-manager-on-anolis.patch delete mode 100644 0005-init-Ignore-warnings-about-unchecked-return-values.patch delete mode 100644 0006-ocaml-Use-non-deprecated-warning-format.patch delete mode 100644 0007-src-Fix-warnings-about-parsing-ints-from-strings.patch delete mode 100644 0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch delete mode 100644 0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch delete mode 100644 0010-src-Replace-noalloc-with-noalloc.patch delete mode 100644 0011-src-Unconditionally-enable-g-flag.patch delete mode 100644 0012-src-Record-and-print-global-exception-backtraces.patch diff --git a/0001-Fix-for-missing-lib-modules.patch b/0001-Fix-for-missing-lib-modules.patch deleted file mode 100644 index f1d5b4e..0000000 --- a/0001-Fix-for-missing-lib-modules.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8effa5a686037ba3c2f8c97753f398b73cc54881 Mon Sep 17 00:00:00 2001 -From: George Prekas -Date: Wed, 6 Apr 2022 16:15:15 -0500 -Subject: [PATCH 01/12] Fix for missing /lib/modules. - -Even when supplied with $SUPERMIN_MODULES, supermin tries to access -/lib/modules. This directory does not exist by default in all the -environments. ---- - src/format_ext2.ml | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/src/format_ext2.ml b/src/format_ext2.ml -index e311ea6..484b469 100644 ---- a/src/format_ext2.ml -+++ b/src/format_ext2.ml -@@ -95,8 +95,22 @@ let build_ext2 debug basedir files modpath kernel_version appliance size - printf "supermin: ext2: copying kernel modules\n%!"; - - (* Import the kernel modules. *) -- ext2fs_copy_file_from_host fs "/lib" "/lib"; -- ext2fs_copy_file_from_host fs "/lib/modules" "/lib/modules"; -+ (try -+ ext2fs_copy_file_from_host fs "/lib" "/lib" -+ with Unix_error _ -> -+ (* If /lib doesn't exist on the host, create /lib directory -+ * in the image, populating it with mode etc from host / -+ *) -+ ext2fs_copy_file_from_host fs "/" "/lib" -+ ); -+ -+ (try -+ ext2fs_copy_file_from_host fs "/lib/modules" "/lib/modules" -+ with Unix_error _ -> -+ (* As above, if /lib/modules does not exist on the host. *) -+ ext2fs_copy_file_from_host fs "/" "/lib/modules" -+ ); -+ - ext2fs_copy_dir_recursively_from_host fs - modpath ("/lib/modules/" ^ kernel_version); - --- -2.37.3 - diff --git a/0002-pacman-Recognise-Artix-an-Arch-derivative.patch b/0002-pacman-Recognise-Artix-an-Arch-derivative.patch deleted file mode 100644 index 8549ca1..0000000 --- a/0002-pacman-Recognise-Artix-an-Arch-derivative.patch +++ /dev/null @@ -1,24 +0,0 @@ -From e5cd10fc0952da1c51eb7b762fe19d54b2ec1e8d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 29 Apr 2022 15:24:17 +0100 -Subject: [PATCH 02/12] pacman: Recognise Artix, an Arch derivative - ---- - src/ph_pacman.ml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml -index 376b14b..4a1c669 100644 ---- a/src/ph_pacman.ml -+++ b/src/ph_pacman.ml -@@ -26,6 +26,7 @@ open Package_handler - let pacman_detect () = - Config.pacman <> "no" && Config.fakeroot <> "no" && - (Os_release.get_id () = "arch" || -+ Os_release.get_id () = "artix" || - ((stat "/etc/arch-release").st_kind = S_REG && - Config.pacman_g2 = "no")) (* not Frugalware with pacman-g2 *) - --- -2.37.3 - diff --git a/0003-pacman-Fix-database-mtime-detection.patch b/0003-pacman-Fix-database-mtime-detection.patch deleted file mode 100644 index 7ee65c7..0000000 --- a/0003-pacman-Fix-database-mtime-detection.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c9ddb9648b3b810aa50fc238edb5fe55df9643b6 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 29 Apr 2022 15:24:41 +0100 -Subject: [PATCH 03/12] pacman: Fix database mtime detection - -There is no "core.db" file on Artix, it may exist on Arch. However -a better way to detect this is to check the mtime of the containing -directory. ---- - src/ph_pacman.ml | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml -index 4a1c669..d9ecb29 100644 ---- a/src/ph_pacman.ml -+++ b/src/ph_pacman.ml -@@ -129,7 +129,10 @@ let pacman_package_name pkg = - pac.name - - let pacman_get_package_database_mtime () = -- (lstat "/var/lib/pacman/sync/core.db" (* XXX? *) ).st_mtime -+ (* This directory changes mtime when packages get installed/reinstalled. -+ * The directory itself contains several *.db files with different names. -+ *) -+ (lstat "/var/lib/pacman/sync/").st_mtime - - let pacman_get_all_requires pkgs = - let cmd = sprintf "\ --- -2.37.3 - diff --git a/0004-fix-cannot-detect-package-manager-on-anolis.patch b/0004-fix-cannot-detect-package-manager-on-anolis.patch deleted file mode 100644 index da2891f..0000000 --- a/0004-fix-cannot-detect-package-manager-on-anolis.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b47d2f1fe29557874409295c55971c91379fa756 Mon Sep 17 00:00:00 2001 -From: mahailiang -Date: Fri, 19 Aug 2022 15:41:24 +0800 -Subject: [PATCH 04/12] fix cannot detect package manager on anolis - ---- - 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 549bd9a..f1ea299 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -32,11 +32,12 @@ 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" ] || -+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "anolis" ] || - 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/openEuler-release").st_kind = S_REG || -+ (stat "/etc/anolis-release").st_kind = S_REG - with Unix_error _ -> false) - - let opensuse_detect () = --- -2.37.3 - diff --git a/0005-init-Ignore-warnings-about-unchecked-return-values.patch b/0005-init-Ignore-warnings-about-unchecked-return-values.patch deleted file mode 100644 index a26ca50..0000000 --- a/0005-init-Ignore-warnings-about-unchecked-return-values.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c89146030ffd0ffdf921917111b88d3b32c5b2b8 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 12:01:36 +0100 -Subject: [PATCH 05/12] init: Ignore warnings about unchecked return values - ---- - init/init.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/init/init.c b/init/init.c -index 60e099e..bc28c69 100644 ---- a/init/init.c -+++ b/init/init.c -@@ -49,6 +49,12 @@ - /* else it's in sys/types.h, included above */ - #endif - -+/* We make several calls to asprintf, chdir, fgets and ignore the -+ * result. Since this is a minimal init system there's nothing we can -+ * do if these calls fail. -+ */ -+#pragma GCC diagnostic ignored "-Wunused-result" -+ - /* Maximum time to wait for the root device to appear (seconds). - * - * On slow machines with lots of disks (Koji running the 255 disk test --- -2.37.3 - diff --git a/0006-ocaml-Use-non-deprecated-warning-format.patch b/0006-ocaml-Use-non-deprecated-warning-format.patch deleted file mode 100644 index 9aa3c07..0000000 --- a/0006-ocaml-Use-non-deprecated-warning-format.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4363354763fe858973af287058d0fa2efe90cdd0 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 12:01:50 +0100 -Subject: [PATCH 06/12] ocaml: Use non-deprecated warning format - -Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, -like 'CDEFLMPSUVXYZ', is deprecated. -Use the equivalent signed form: +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3. ---- - src/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Makefile.am b/src/Makefile.am -index c54b63e..0fcc3ad 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -127,7 +127,7 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo) - XOBJECTS = $(SOURCES_ML:.ml=.cmx) - - OCAMLPACKAGES = -package unix,str --OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ-3 -+OCAMLFLAGS = -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 - - if !HAVE_OCAMLOPT - OBJECTS = $(BOBJECTS) --- -2.37.3 - diff --git a/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch b/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch deleted file mode 100644 index aeeae63..0000000 --- a/0007-src-Fix-warnings-about-parsing-ints-from-strings.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 63b515b375ebf2dbcc7b0b53f2031c3aa63ac8dc Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 12:03:29 +0100 -Subject: [PATCH 07/12] src: Fix warnings about parsing ints from strings - -Warnings of the form: - -90 | Failure "int_of_string" -> - ^^^^^^^^^^^^^^^ -Warning 52 [fragile-literal-pattern]: Code should not depend on the -actual values of this constructor's arguments. They are only for -information and may change in future versions. (See manual section -11.5) ---- - src/ph_pacman.ml | 2 +- - src/ph_rpm.ml | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml -index d9ecb29..44445a6 100644 ---- a/src/ph_pacman.ml -+++ b/src/ph_pacman.ml -@@ -87,7 +87,7 @@ let pacman_package_of_string str = - | _ -> assert false in - epoch, version, release - with -- Failure "int_of_string" -> -+ Failure _ -> - failwith ("failed to parse epoch:version-release field " ^ evr) in - - { name = name; -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index f1ea299..85557fe 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -89,7 +89,7 @@ let rec rpm_init s = - | [x] -> error "unable to parse rpm version string: %s" x - | major :: minor :: _ -> - try int_of_string major, int_of_string minor -- with Failure "int_of_string" -> -+ with Failure _ -> - error "unable to parse rpm version string: non-numeric, %s" version in - rpm_major := major; - rpm_minor := minor; -@@ -120,11 +120,11 @@ and opensuse_init s = - | [x] -> error "unable to parse output of zypper --version: %s" x - | major :: minor :: [] -> - (try int_of_string major, int_of_string minor, 0 -- with Failure "int_of_string" -> -+ with Failure _ -> - error "unable to parse output of zypper --version: non-numeric") - | major :: minor :: patch :: _ -> - (try int_of_string major, int_of_string minor, int_of_string patch -- with Failure "int_of_string" -> -+ with Failure _ -> - error "unable to parse output of zypper --version: non-numeric") in - zypper_major := major; - zypper_minor := minor; --- -2.37.3 - diff --git a/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch b/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch deleted file mode 100644 index 57f4f03..0000000 --- a/0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b202062325e92bce865ad48b1e6d9f29b01ade6b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 12:04:46 +0100 -Subject: [PATCH 08/12] src/ph_pacman.ml: Use error function instead of - failwith - -Slightly nicer output and a bit easier to use because it supports -printf-style formatting. ---- - src/ph_pacman.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ph_pacman.ml b/src/ph_pacman.ml -index 44445a6..25ef4fc 100644 ---- a/src/ph_pacman.ml -+++ b/src/ph_pacman.ml -@@ -88,7 +88,7 @@ let pacman_package_of_string str = - epoch, version, release - with - Failure _ -> -- failwith ("failed to parse epoch:version-release field " ^ evr) in -+ error "failed to parse epoch:version-release field: %s " evr in - - { name = name; - epoch = epoch; --- -2.37.3 - diff --git a/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch b/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch deleted file mode 100644 index c6559ce..0000000 --- a/0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9b157474961b35e422704d32234d4ca5369acbe8 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 13:57:11 +0100 -Subject: [PATCH 09/12] src/utils.ml: Fix more warnings about parsing ints from - strings - -Updates: commit 63b515b375ebf2dbcc7b0b53f2031c3aa63ac8dc ---- - src/utils.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/utils.ml b/src/utils.ml -index f5990ef..521d49e 100644 ---- a/src/utils.ml -+++ b/src/utils.ml -@@ -162,7 +162,7 @@ and split_version = function - let rest = Str.matched_group 2 str in - let n = - try `Number (int_of_string n) -- with Failure "int_of_string" -> `String n in -+ with Failure _ -> `String n in - n, rest - ) - else if Str.string_match rex_letters str 0 then --- -2.37.3 - diff --git a/0010-src-Replace-noalloc-with-noalloc.patch b/0010-src-Replace-noalloc-with-noalloc.patch deleted file mode 100644 index caa8d05..0000000 --- a/0010-src-Replace-noalloc-with-noalloc.patch +++ /dev/null @@ -1,56 +0,0 @@ -From e3cb3fb2c3e6c29d57db953099878813538281e6 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 2 Sep 2022 15:47:00 +0100 -Subject: [PATCH 10/12] src: Replace "noalloc" with [@@noalloc] - -Avoids deprecation warnings like: - -File "librpm.ml", line 19, characters 0-80: -Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc" - -I have checked that this still works with RHEL 7. ---- - src/librpm-c.c | 2 ++ - src/librpm.ml | 4 ++-- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/librpm-c.c b/src/librpm-c.c -index ea32926..7b2b505 100644 ---- a/src/librpm-c.c -+++ b/src/librpm-c.c -@@ -118,6 +118,7 @@ Val_librpm (struct librpm_data *data) - CAMLreturn (rpmv); - } - -+/* NB: This is a [@@noalloc] call. */ - value - supermin_rpm_is_available (value unit) - { -@@ -130,6 +131,7 @@ supermin_rpm_version (value unit) - return caml_copy_string (RPMVERSION); - } - -+/* NB: This is a [@@noalloc] call. */ - value - supermin_rpm_vercmp (value av, value bv) - { -diff --git a/src/librpm.ml b/src/librpm.ml -index c987e21..0a6c3f7 100644 ---- a/src/librpm.ml -+++ b/src/librpm.ml -@@ -16,10 +16,10 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - --external rpm_is_available : unit -> bool = "supermin_rpm_is_available" "noalloc" -+external rpm_is_available : unit -> bool = "supermin_rpm_is_available" [@@noalloc] - - external rpm_version : unit -> string = "supermin_rpm_version" --external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" "noalloc" -+external rpm_vercmp : string -> string -> int = "supermin_rpm_vercmp" [@@noalloc] - external rpm_get_arch : unit -> string = "supermin_rpm_get_arch" - - type t --- -2.37.3 - diff --git a/0011-src-Unconditionally-enable-g-flag.patch b/0011-src-Unconditionally-enable-g-flag.patch deleted file mode 100644 index 9b5c30c..0000000 --- a/0011-src-Unconditionally-enable-g-flag.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 5d3d21b985b328317537e3d9a540840c5dade940 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 7 Sep 2022 16:12:12 +0100 -Subject: [PATCH 11/12] src: Unconditionally enable -g flag - -It's been possible to use -g with ocamlc for years now, and it's -always useful to compile with debugging enabled. In particular this -is necessary to display accurate backtraces. ---- - src/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Makefile.am b/src/Makefile.am -index 0fcc3ad..5b07e5d 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -127,7 +127,7 @@ BOBJECTS = $(SOURCES_ML:.ml=.cmo) - XOBJECTS = $(SOURCES_ML:.ml=.cmx) - - OCAMLPACKAGES = -package unix,str --OCAMLFLAGS = -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 -+OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 - - if !HAVE_OCAMLOPT - OBJECTS = $(BOBJECTS) --- -2.37.3 - diff --git a/0012-src-Record-and-print-global-exception-backtraces.patch b/0012-src-Record-and-print-global-exception-backtraces.patch deleted file mode 100644 index a2fafc6..0000000 --- a/0012-src-Record-and-print-global-exception-backtraces.patch +++ /dev/null @@ -1,73 +0,0 @@ -From ae7151cd943907a6044d9e1b82df87a2f805507b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 7 Sep 2022 16:02:47 +0100 -Subject: [PATCH 12/12] src: Record and print global exception backtraces - -We have a central place to catch global exceptions. Unfortunately the -act of doing that hides the exception if OCAMLRUNPARAM=b was set. - -We almost always want to see where these exceptions are thrown so turn -on exception recording unconditionally and print them. - -Related: https://bugzilla.redhat.com/show_bug.cgi?id=2124571 ---- - src/supermin.ml | 32 +++++++++++++++++++++----------- - 1 file changed, 21 insertions(+), 11 deletions(-) - -diff --git a/src/supermin.ml b/src/supermin.ml -index 9f838d9..659e857 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -1,5 +1,5 @@ - (* supermin 5 -- * Copyright (C) 2009-2014 Red Hat Inc. -+ * Copyright (C) 2009-2022 Red Hat Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -291,22 +291,32 @@ appliance automatically. - package_handler_shutdown () - - let () = -- try main () -+ try -+ Printexc.record_backtrace true; -+ main () - with - | Unix.Unix_error (code, fname, "") -> (* from a syscall *) -- error "error: %s: %s" fname (Unix.error_message code) -+ Printexc.print_backtrace Pervasives.stderr; -+ error "error: %s: %s" fname (Unix.error_message code) - | Unix.Unix_error (code, fname, param) -> (* from a syscall *) -- error "error: %s: %s: %s" fname (Unix.error_message code) param -+ Printexc.print_backtrace Pervasives.stderr; -+ error "error: %s: %s: %s" fname (Unix.error_message code) param - | Failure msg -> (* from failwith/failwithf *) -- error "failure: %s" msg -+ Printexc.print_backtrace Pervasives.stderr; -+ error "failure: %s" msg - | Librpm.Multiple_matches (package, count) -> (* from librpm *) -- error "RPM error: %d occurrences for %s" count package -+ Printexc.print_backtrace Pervasives.stderr; -+ error "RPM error: %d occurrences for %s" count package - | Invalid_argument msg -> (* probably should never happen *) -- error "internal error: invalid argument: %s" msg -+ Printexc.print_backtrace Pervasives.stderr; -+ error "internal error: invalid argument: %s" msg - | Assert_failure (file, line, char) -> (* should never happen *) -- error "internal error: assertion failed at %s, line %d, char %d" -- file line char -+ Printexc.print_backtrace Pervasives.stderr; -+ error "internal error: assertion failed at %s, line %d, char %d" -+ file line char - | Not_found -> (* should never happen *) -- error "internal error: Not_found exception was thrown" -+ Printexc.print_backtrace Pervasives.stderr; -+ error "internal error: Not_found exception was thrown" - | exn -> (* something not matched above *) -- error "exception: %s" (Printexc.to_string exn) -+ Printexc.print_backtrace Pervasives.stderr; -+ error "exception: %s" (Printexc.to_string exn) --- -2.37.3 - diff --git a/sources b/sources index 3bc8f7e..98c633b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.3.2.tar.gz) = 501731e9cce8bf1f4743eeff4af620813d466da10b664df037575a546b3b8e8697ed9e881dde7d3ba737e6a78536717c1823e22cdc1c92409db78d976a6678b5 -SHA512 (supermin-5.3.2.tar.gz.sig) = 5006481ab4c9a5ef5120654ac36fef3da634e03e0cacf4c27f44a5b37d7a906f3fdf911fde666a8f8dd08fce7e129399dbbb139d8e29c05a54dac9399ce31c9a +SHA512 (supermin-5.3.3.tar.gz) = 39eb687a4e6fbd13d356612f950352848626fe68a14054a62ac7fa1bb3b42be716189b1505bf137331974ea02d75e2e8079f412a133af165cba7767699925f38 +SHA512 (supermin-5.3.3.tar.gz.sig) = e5109e718b06992bde73be913be49cd00358ec835566beb1f207109f54f73dbc6600275e929eb88fea42bda13643ec3ee9bb80032f8a05c37537f28bafb49fad diff --git a/supermin.spec b/supermin.spec index 5a7783f..5d84aac 100644 --- a/supermin.spec +++ b/supermin.spec @@ -30,8 +30,8 @@ Summary: Tool for creating supermin appliances Name: supermin -Version: 5.3.2 -Release: 5%{?dist} +Version: 5.3.3 +Release: 1%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -46,20 +46,6 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# All upstream patches since 5.3.2: -Patch: 0001-Fix-for-missing-lib-modules.patch -Patch: 0002-pacman-Recognise-Artix-an-Arch-derivative.patch -Patch: 0003-pacman-Fix-database-mtime-detection.patch -Patch: 0004-fix-cannot-detect-package-manager-on-anolis.patch -Patch: 0005-init-Ignore-warnings-about-unchecked-return-values.patch -Patch: 0006-ocaml-Use-non-deprecated-warning-format.patch -Patch: 0007-src-Fix-warnings-about-parsing-ints-from-strings.patch -Patch: 0008-src-ph_pacman.ml-Use-error-function-instead-of-failw.patch -Patch: 0009-src-utils.ml-Fix-more-warnings-about-parsing-ints-fr.patch -Patch: 0010-src-Replace-noalloc-with-noalloc.patch -Patch: 0011-src-Unconditionally-enable-g-flag.patch -Patch: 0012-src-Record-and-print-global-exception-backtraces.patch - BuildRequires: gcc BuildRequires: make BuildRequires: autoconf, automake @@ -201,6 +187,9 @@ make check || { %changelog +* Tue Oct 18 2022 Richard W.M. Jones - 5.3.3-1 +- New upstream development version 5.3.3 + * Wed Sep 07 2022 Richard W.M. Jones - 5.3.2-5 - Include all upstream patches since 5.3.2 - Add debugging and accurate exception backtraces (RHBZ#2124571). From aa8ebc6a2e43af9e3ccf08050e61ad72a092ef7c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 04:21:04 +0000 Subject: [PATCH 61/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 5d84aac..3b1460b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -187,6 +187,9 @@ make check || { %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 5.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Tue Oct 18 2022 Richard W.M. Jones - 5.3.3-1 - New upstream development version 5.3.3 From 29efa3fac5ce6559428099ce15598c9fd1ec9e62 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:42:55 +0000 Subject: [PATCH 62/95] Deal with new RPM database location https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr --- ...base-location-in-usr-lib-sysimage-rp.patch | 50 +++++++++++++++++++ supermin.spec | 9 +++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch new file mode 100644 index 0000000..6115707 --- /dev/null +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -0,0 +1,50 @@ +From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 21 Jan 2023 09:38:55 +0000 +Subject: [PATCH] rpm: New RPM database location in /usr/lib/sysimage/rpm + +A few years ago the RPM database was moved from /var to /usr. This is +now feeding through to Linux distros. + +http://lists.rpm.org/pipermail/rpm-maint/2017-October/006723.html +https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr +https://src.fedoraproject.org/rpms/rpm/pull-request/21 +--- + src/ph_rpm.ml | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 85557fe..2c199c1 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -236,12 +236,22 @@ let rpm_package_name pkg = + let rpm = rpm_of_pkg pkg in + rpm.name + ++let rpmdb_locations = [ ++ "/usr/lib/sysimage/rpm/rpmdb.sqlite"; ++ "/var/lib/rpm/rpmdb.sqlite"; ++ "/var/lib/rpm/Packages" ++] ++ ++let find_rpmdb () = ++ let rec loop = function ++ | [] -> error "rpm: cannot locate RPM database; if this is a normal RPM-based Linux distro then this is probably a supermin bug" ++ | db :: rest -> ++ if Sys.file_exists db then db else loop rest ++ in ++ loop rpmdb_locations ++ + let rpm_get_package_database_mtime () = +- (try +- lstat "/var/lib/rpm/rpmdb.sqlite" +- with Unix_error (ENOENT, _, _) -> +- lstat "/var/lib/rpm/Packages" +- ).st_mtime ++ (lstat (find_rpmdb ())).st_mtime + + (* Return the best provider of a particular RPM requirement. + * +-- +2.39.0 + diff --git a/supermin.spec b/supermin.spec index 3b1460b..d162e84 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -46,6 +46,9 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr +Patch1: 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch + BuildRequires: gcc BuildRequires: make BuildRequires: autoconf, automake @@ -187,6 +190,10 @@ make check || { %changelog +* Sat Jan 21 2023 Richard W.M. Jones - 5.3.3-3 +- Deal with new RPM database location +- https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr + * Sat Jan 21 2023 Fedora Release Engineering - 5.3.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 1a507fd40142cc282dc8b63b1f14a31508bf480c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jan 2023 10:35:30 +0000 Subject: [PATCH 63/95] Rebuild OCaml packages for F38 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index d162e84..a71467e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -190,6 +190,9 @@ make check || { %changelog +* Tue Jan 24 2023 Richard W.M. Jones - 5.3.3-4 +- Rebuild OCaml packages for F38 + * Sat Jan 21 2023 Richard W.M. Jones - 5.3.3-3 - Deal with new RPM database location - https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr From 8b8563ecd99cb8276ce231272fd3869128a5d0a6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 May 2023 13:04:13 +0100 Subject: [PATCH 64/95] Rebuild against librpm 10 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index a71467e..092d654 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -190,6 +190,9 @@ make check || { %changelog +* Fri May 19 2023 Richard W.M. Jones - 5.3.3-5 +- Rebuild against librpm 10 + * Tue Jan 24 2023 Richard W.M. Jones - 5.3.3-4 - Rebuild OCaml packages for F38 From 27e02e0188bd08b38b28521d6de3e5f83b5c1f90 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:24:07 +0100 Subject: [PATCH 65/95] Add support for dnf5 (RHBZ#2209412) --- ...base-location-in-usr-lib-sysimage-rp.patch | 4 +- 0002-Add-support-for-OCaml-5.0.patch | 98 ++++++++++++++ ...estore-compatibility-with-OCaml-4.07.patch | 125 ++++++++++++++++++ ...Detect-dnf5-and-omit-missing-options.patch | 58 ++++++++ supermin.spec | 18 ++- 5 files changed, 295 insertions(+), 8 deletions(-) create mode 100644 0002-Add-support-for-OCaml-5.0.patch create mode 100644 0003-Restore-compatibility-with-OCaml-4.07.patch create mode 100644 0004-rpm-Detect-dnf5-and-omit-missing-options.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 6115707..46c94df 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 1/4] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. @@ -46,5 +46,5 @@ index 85557fe..2c199c1 100644 (* Return the best provider of a particular RPM requirement. * -- -2.39.0 +2.40.1 diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch new file mode 100644 index 0000000..fe527a5 --- /dev/null +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -0,0 +1,98 @@ +From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 +From: Kate +Date: Wed, 16 Nov 2022 19:30:01 +0000 +Subject: [PATCH 2/4] Add support for OCaml 5.0 + +--- + src/mode_build.ml | 4 ++-- + src/supermin.ml | 16 ++++++++-------- + src/utils.ml | 4 ++-- + 3 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/mode_build.ml b/src/mode_build.ml +index 7c48295..f81341d 100644 +--- a/src/mode_build.ml ++++ b/src/mode_build.ml +@@ -123,7 +123,7 @@ let rec build debug + (PackageSet.cardinal packages); + if debug >= 2 then ( + List.iter (printf " - %s\n") pretty_packages; +- flush Pervasives.stdout ++ flush Stdlib.stdout + ) + ); + +@@ -207,7 +207,7 @@ let rec build debug + (List.length files); + if debug >= 2 then ( + List.iter (fun { ft_path = path } -> printf " - %s\n" path) files; +- flush Pervasives.stdout ++ flush Stdlib.stdout + ) + ); + +diff --git a/src/supermin.ml b/src/supermin.ml +index 659e857..bef9db6 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -296,27 +296,27 @@ let () = + main () + with + | Unix.Unix_error (code, fname, "") -> (* from a syscall *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "error: %s: %s" fname (Unix.error_message code) + | Unix.Unix_error (code, fname, param) -> (* from a syscall *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "error: %s: %s: %s" fname (Unix.error_message code) param + | Failure msg -> (* from failwith/failwithf *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "failure: %s" msg + | Librpm.Multiple_matches (package, count) -> (* from librpm *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "RPM error: %d occurrences for %s" count package + | Invalid_argument msg -> (* probably should never happen *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "internal error: invalid argument: %s" msg + | Assert_failure (file, line, char) -> (* should never happen *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "internal error: assertion failed at %s, line %d, char %d" + file line char + | Not_found -> (* should never happen *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "internal error: Not_found exception was thrown" + | exn -> (* something not matched above *) +- Printexc.print_backtrace Pervasives.stderr; ++ Printexc.print_backtrace Stdlib.stderr; + error "exception: %s" (Printexc.to_string exn) +diff --git a/src/utils.ml b/src/utils.ml +index 521d49e..ae99294 100644 +--- a/src/utils.ml ++++ b/src/utils.ml +@@ -40,7 +40,7 @@ let dir_exists name = + try (stat name).st_kind = S_DIR + with Unix_error _ -> false + +-let uniq ?(cmp = Pervasives.compare) xs = ++let uniq ?(cmp = Stdlib.compare) xs = + let rec loop acc = function + | [] -> acc + | [x] -> x :: acc +@@ -51,7 +51,7 @@ let uniq ?(cmp = Pervasives.compare) xs = + in + List.rev (loop [] xs) + +-let sort_uniq ?(cmp = Pervasives.compare) xs = ++let sort_uniq ?(cmp = Stdlib.compare) xs = + let xs = List.sort cmp xs in + let xs = uniq ~cmp xs in + xs +-- +2.40.1 + diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch new file mode 100644 index 0000000..6096567 --- /dev/null +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -0,0 +1,125 @@ +From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 +From: Kate +Date: Wed, 16 Nov 2022 19:59:36 +0000 +Subject: [PATCH 3/4] Restore compatibility with OCaml < 4.07 + +--- + src/mode_build.ml | 6 ++++-- + src/supermin.ml | 18 ++++++++++-------- + src/utils.ml | 6 ++++-- + 3 files changed, 18 insertions(+), 12 deletions(-) + +diff --git a/src/mode_build.ml b/src/mode_build.ml +index f81341d..f0e5e09 100644 +--- a/src/mode_build.ml ++++ b/src/mode_build.ml +@@ -16,6 +16,8 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + ++let stdlib_stdout = stdout ++ + open Unix + open Unix.LargeFile + open Printf +@@ -123,7 +125,7 @@ let rec build debug + (PackageSet.cardinal packages); + if debug >= 2 then ( + List.iter (printf " - %s\n") pretty_packages; +- flush Stdlib.stdout ++ flush stdlib_stdout + ) + ); + +@@ -207,7 +209,7 @@ let rec build debug + (List.length files); + if debug >= 2 then ( + List.iter (fun { ft_path = path } -> printf " - %s\n" path) files; +- flush Stdlib.stdout ++ flush stdlib_stdout + ) + ); + +diff --git a/src/supermin.ml b/src/supermin.ml +index bef9db6..d49c1e8 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -16,6 +16,8 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + ++let stdlib_stderr = stderr ++ + open Unix + open Unix.LargeFile + open Printf +@@ -296,27 +298,27 @@ let () = + main () + with + | Unix.Unix_error (code, fname, "") -> (* from a syscall *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "error: %s: %s" fname (Unix.error_message code) + | Unix.Unix_error (code, fname, param) -> (* from a syscall *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "error: %s: %s: %s" fname (Unix.error_message code) param + | Failure msg -> (* from failwith/failwithf *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "failure: %s" msg + | Librpm.Multiple_matches (package, count) -> (* from librpm *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "RPM error: %d occurrences for %s" count package + | Invalid_argument msg -> (* probably should never happen *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "internal error: invalid argument: %s" msg + | Assert_failure (file, line, char) -> (* should never happen *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "internal error: assertion failed at %s, line %d, char %d" + file line char + | Not_found -> (* should never happen *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "internal error: Not_found exception was thrown" + | exn -> (* something not matched above *) +- Printexc.print_backtrace Stdlib.stderr; ++ Printexc.print_backtrace stdlib_stderr; + error "exception: %s" (Printexc.to_string exn) +diff --git a/src/utils.ml b/src/utils.ml +index ae99294..1dc4310 100644 +--- a/src/utils.ml ++++ b/src/utils.ml +@@ -16,6 +16,8 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + ++let stdlib_compare = compare ++ + open Unix + open Unix.LargeFile + open Printf +@@ -40,7 +42,7 @@ let dir_exists name = + try (stat name).st_kind = S_DIR + with Unix_error _ -> false + +-let uniq ?(cmp = Stdlib.compare) xs = ++let uniq ?(cmp = stdlib_compare) xs = + let rec loop acc = function + | [] -> acc + | [x] -> x :: acc +@@ -51,7 +53,7 @@ let uniq ?(cmp = Stdlib.compare) xs = + in + List.rev (loop [] xs) + +-let sort_uniq ?(cmp = Stdlib.compare) xs = ++let sort_uniq ?(cmp = stdlib_compare) xs = + let xs = List.sort cmp xs in + let xs = uniq ~cmp xs in + xs +-- +2.40.1 + diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch new file mode 100644 index 0000000..6a570fd --- /dev/null +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -0,0 +1,58 @@ +From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 30 May 2023 09:12:14 +0100 +Subject: [PATCH 4/4] rpm: Detect dnf5 and omit missing options + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 +--- + src/ph_rpm.ml | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index 2c199c1..3e803c6 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -482,19 +482,38 @@ and download_all_packages_with_dnf pkgs dir tdir = + (* Old dnf didn't create the destdir directory, newer versions do. *) + mkdir tdir 0o700; + ++ (* dnf5 lacks various options so we have to detect it: ++ * https://github.com/rpm-software-management/dnf5/issues/580 ++ * https://github.com/rpm-software-management/dnf5/issues/581 ++ *) ++ let is_dnf5 = is_dnf5 () in ++ let debug_quiet_option = ++ if !settings.debug < 1 then " -q" ++ else if not is_dnf5 then " -v" ++ else "" in ++ + let rpms = pkgs_as_NA_rpms pkgs in + + let cmd = +- sprintf "%s download%s%s --destdir=%s --disableexcludes=all %s" ++ sprintf "%s download%s%s%s --destdir=%s %s" + Config.dnf +- (if !settings.debug >= 1 then " -v" else " -q") ++ debug_quiet_option + (match !settings.packager_config with + | None -> "" + | Some filename -> sprintf " -c %s" (quote filename)) ++ (if not is_dnf5 then " --disableexcludes=all" else "") + (quote tdir) + (quoted_list rpms) in + run_command cmd + ++and is_dnf5 () = ++ let cmd = sprintf "%s --version" Config.dnf in ++ let lines = run_command_get_lines cmd in ++ match lines with ++ | [] -> error "rpm: no output from '%s' command" cmd ++ | line :: _ when find line "version 5" >= 0 -> true ++ | _ -> false ++ + and pkgs_as_NA_rpms pkgs = + let rpms = List.map rpm_of_pkg (PackageSet.elements pkgs) in + List.map ( +-- +2.40.1 + diff --git a/supermin.spec b/supermin.spec index 092d654..643d6d8 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -47,7 +47,12 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam Source2: libguestfs.keyring # https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr -Patch1: 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +Patch: 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +# OCaml 5 compatibility: +Patch: 0002-Add-support-for-OCaml-5.0.patch +Patch: 0003-Restore-compatibility-with-OCaml-4.07.patch +# dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2209412): +Patch: 0004-rpm-Detect-dnf5-and-omit-missing-options.patch BuildRequires: gcc BuildRequires: make @@ -56,8 +61,7 @@ BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm BuildRequires: rpm-devel -BuildRequires: dnf -BuildRequires: dnf-plugins-core +BuildRequires: dnf5 BuildRequires: /usr/sbin/mke2fs BuildRequires: e2fsprogs-devel BuildRequires: findutils @@ -124,8 +128,7 @@ Requires: %{name} = %{version}-%{release} Requires: rpm-build # Dependencies needed for supermin --prepare -Requires: dnf -Requires: dnf-plugins-core +Requires: dnf5 Requires: findutils @@ -190,6 +193,9 @@ make check || { %changelog +* Tue May 30 2023 Richard W.M. Jones - 5.3.3-6 +- Add support for dnf5 (RHBZ#2209412) + * Fri May 19 2023 Richard W.M. Jones - 5.3.3-5 - Rebuild against librpm 10 From 23e3141c9d9963b4b0f7f1e9f3dc5b6b89ab2706 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 10:38:29 +0100 Subject: [PATCH 66/95] Temporarily set DNF=dnf5 --- supermin.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 643d6d8..6400ae3 100644 --- a/supermin.spec +++ b/supermin.spec @@ -150,7 +150,11 @@ supermin appliances. %build autoreconf -fi -%configure --disable-network-tests +# Setting DNF is temporarily required for Rawhide. We should be able +# to remove this later. See: +# https://bugzilla.redhat.com/show_bug.cgi?id=2209412 +# https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5 +%configure DNF=%{_bindir}/dnf5 --disable-network-tests %if %{with dietlibc} make -C init CC="diet gcc" From 5283ce36d894237ec0903ff41c1a4bf16cd97e1d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 May 2023 13:02:07 +0100 Subject: [PATCH 67/95] Further fix for dnf5 (RHBZ#2211386) --- ...base-location-in-usr-lib-sysimage-rp.patch | 4 +-- 0002-Add-support-for-OCaml-5.0.patch | 4 +-- ...estore-compatibility-with-OCaml-4.07.patch | 4 +-- ...Detect-dnf5-and-omit-missing-options.patch | 4 +-- 0005-rpm-Use-dnf-config-instead-of-c.patch | 28 +++++++++++++++++++ supermin.spec | 7 ++++- 6 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 0005-rpm-Use-dnf-config-instead-of-c.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 46c94df..585fa81 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 1/4] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 1/5] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. @@ -46,5 +46,5 @@ index 85557fe..2c199c1 100644 (* Return the best provider of a particular RPM requirement. * -- -2.40.1 +2.37.3 diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch index fe527a5..6372301 100644 --- a/0002-Add-support-for-OCaml-5.0.patch +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -1,7 +1,7 @@ From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 2/4] Add support for OCaml 5.0 +Subject: [PATCH 2/5] Add support for OCaml 5.0 --- src/mode_build.ml | 4 ++-- @@ -94,5 +94,5 @@ index 521d49e..ae99294 100644 let xs = uniq ~cmp xs in xs -- -2.40.1 +2.37.3 diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch index 6096567..6fd79e4 100644 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -1,7 +1,7 @@ From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 3/4] Restore compatibility with OCaml < 4.07 +Subject: [PATCH 3/5] Restore compatibility with OCaml < 4.07 --- src/mode_build.ml | 6 ++++-- @@ -121,5 +121,5 @@ index ae99294..1dc4310 100644 let xs = uniq ~cmp xs in xs -- -2.40.1 +2.37.3 diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch index 6a570fd..9d9d7f1 100644 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -1,7 +1,7 @@ From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 4/4] rpm: Detect dnf5 and omit missing options +Subject: [PATCH 4/5] rpm: Detect dnf5 and omit missing options Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 --- @@ -54,5 +54,5 @@ index 2c199c1..3e803c6 100644 let rpms = List.map rpm_of_pkg (PackageSet.elements pkgs) in List.map ( -- -2.40.1 +2.37.3 diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch new file mode 100644 index 0000000..a9badb1 --- /dev/null +++ b/0005-rpm-Use-dnf-config-instead-of-c.patch @@ -0,0 +1,28 @@ +From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 31 May 2023 12:52:13 +0100 +Subject: [PATCH 5/5] rpm: Use dnf --config instead of -c + +dnf5 does not support -c. dnf4 supports either. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2211386 +--- + 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 3e803c6..e94f35f 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -500,7 +500,7 @@ and download_all_packages_with_dnf pkgs dir tdir = + debug_quiet_option + (match !settings.packager_config with + | None -> "" +- | Some filename -> sprintf " -c %s" (quote filename)) ++ | Some filename -> sprintf " --config=%s" (quote filename)) + (if not is_dnf5 then " --disableexcludes=all" else "") + (quote tdir) + (quoted_list rpms) in +-- +2.37.3 + diff --git a/supermin.spec b/supermin.spec index 6400ae3..3400731 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ ExclusiveArch: %{kernel_arches} @@ -53,6 +53,8 @@ Patch: 0002-Add-support-for-OCaml-5.0.patch Patch: 0003-Restore-compatibility-with-OCaml-4.07.patch # dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2209412): Patch: 0004-rpm-Detect-dnf5-and-omit-missing-options.patch +# dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2211386) +Patch: 0005-rpm-Use-dnf-config-instead-of-c.patch BuildRequires: gcc BuildRequires: make @@ -197,6 +199,9 @@ make check || { %changelog +* Wed May 31 2023 Richard W.M. Jones - 5.3.3-7 +- Further fix for dnf5 (RHBZ#2211386) + * Tue May 30 2023 Richard W.M. Jones - 5.3.3-6 - Add support for dnf5 (RHBZ#2209412) From a020f9a10e43367b11ff6561e56edf71fdff92fb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 5 Jun 2023 16:02:00 +0100 Subject: [PATCH 68/95] Migrated to SPDX license --- supermin.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/supermin.spec b/supermin.spec index 3400731..de651ef 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,8 +31,8 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 7%{?dist} -License: GPLv2+ +Release: 8%{?dist} +License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} %if 0%{?rhel} @@ -199,6 +199,9 @@ make check || { %changelog +* Mon Jun 05 2023 Richard W.M. Jones - 5.3.3-8 +- Migrated to SPDX license + * Wed May 31 2023 Richard W.M. Jones - 5.3.3-7 - Further fix for dnf5 (RHBZ#2211386) From 1ae35926e566771a1231c38d4c5f688d725665dd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 13:10:51 +0100 Subject: [PATCH 69/95] Fix --if-newer --- ...base-location-in-usr-lib-sysimage-rp.patch | 2 +- 0002-Add-support-for-OCaml-5.0.patch | 2 +- ...estore-compatibility-with-OCaml-4.07.patch | 2 +- ...Detect-dnf5-and-omit-missing-options.patch | 2 +- 0005-rpm-Use-dnf-config-instead-of-c.patch | 2 +- ...ugging-of-the-supermin-if-newer-calc.patch | 56 +++++++++++++++++++ 0007-src-Fix-if-newer-copy-kernel.patch | 39 +++++++++++++ supermin.spec | 8 ++- 8 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch create mode 100644 0007-src-Fix-if-newer-copy-kernel.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 585fa81..1c5e464 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 1/5] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 1/7] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch index 6372301..01fc281 100644 --- a/0002-Add-support-for-OCaml-5.0.patch +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -1,7 +1,7 @@ From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 2/5] Add support for OCaml 5.0 +Subject: [PATCH 2/7] Add support for OCaml 5.0 --- src/mode_build.ml | 4 ++-- diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch index 6fd79e4..ae5fa78 100644 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -1,7 +1,7 @@ From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 3/5] Restore compatibility with OCaml < 4.07 +Subject: [PATCH 3/7] Restore compatibility with OCaml < 4.07 --- src/mode_build.ml | 6 ++++-- diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch index 9d9d7f1..81fe831 100644 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -1,7 +1,7 @@ From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 4/5] rpm: Detect dnf5 and omit missing options +Subject: [PATCH 4/7] rpm: Detect dnf5 and omit missing options Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 --- diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch index a9badb1..614dd68 100644 --- a/0005-rpm-Use-dnf-config-instead-of-c.patch +++ b/0005-rpm-Use-dnf-config-instead-of-c.patch @@ -1,7 +1,7 @@ From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 May 2023 12:52:13 +0100 -Subject: [PATCH 5/5] rpm: Use dnf --config instead of -c +Subject: [PATCH 5/7] rpm: Use dnf --config instead of -c dnf5 does not support -c. dnf4 supports either. diff --git a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch new file mode 100644 index 0000000..6fa0426 --- /dev/null +++ b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch @@ -0,0 +1,56 @@ +From 8dd37da1b5979842b0db44b44655eeaf621f7ac9 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 12 Jun 2023 12:51:56 +0100 +Subject: [PATCH 6/7] src: Improved debugging of the supermin if-newer + calculation + +Also I expanded the code to make it easier to read. There is no +change to the calculation intended. +--- + src/supermin.ml | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +diff --git a/src/supermin.ml b/src/supermin.ml +index d49c1e8..c30c73c 100644 +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -241,10 +241,33 @@ appliance automatically. + try + let outputs = Mode_build.get_outputs args inputs in + let outputs = List.map ((//) outputdir) outputs in +- let odates = List.map (fun d -> (lstat d).st_mtime) (outputdir :: outputs) in +- let idates = List.map (fun d -> (lstat d).st_mtime) inputs in ++ let outputs = outputdir :: outputs in ++ let odates = List.map (fun f -> (lstat f).st_mtime) outputs in ++ if debug >= 2 then ( ++ List.iter ( ++ fun f -> ++ printf "supermin: if-newer: output %s => %.2f\n" ++ f (lstat f).st_mtime ++ ) outputs; ++ ); ++ let idates = List.map (fun f -> (lstat f).st_mtime) inputs in ++ if debug >= 2 then ( ++ List.iter ( ++ fun f -> ++ printf "supermin: if-newer: input %s => %.2f\n" ++ f (lstat f).st_mtime ++ ) inputs; ++ ); + let pdate = (get_package_handler ()).ph_get_package_database_mtime () in +- if List.for_all (fun idate -> List.for_all (fun odate -> idate < odate) odates) (pdate :: idates) then ( ++ if debug >= 2 then ( ++ printf "supermin: if-newer: package database date: %.2f\n" pdate; ++ ); ++ let older = ++ List.for_all ( ++ fun idate -> ++ List.for_all (fun odate -> idate < odate) odates ++ ) (pdate :: idates) in ++ if older then ( + if debug >= 1 then + printf "supermin: if-newer: output does not need rebuilding\n%!"; + exit 0 +-- +2.37.3 + diff --git a/0007-src-Fix-if-newer-copy-kernel.patch b/0007-src-Fix-if-newer-copy-kernel.patch new file mode 100644 index 0000000..19117db --- /dev/null +++ b/0007-src-Fix-if-newer-copy-kernel.patch @@ -0,0 +1,39 @@ +From 8c38641042e274a713a18daf7fc85584ca0fc9bb Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 12 Jun 2023 13:02:37 +0100 +Subject: [PATCH 7/7] src: Fix --if-newer --copy-kernel + +We previously copied the kernel into the appliance using 'cp -p' which +preserves the datestamps of the installed kernel. This can confuse +the --if-newer calculation, if for example the package database is +newer than the date on the installed kernel (which quite often is the +case). This makes it think that the appliance is always older than +the package database, thus forcing a rebuild. + +We can fix this using 'cp' instead of 'cp -p'. We don't need the +permissions and datestamps on the copied kernel to be preserved anyway +(in fact, it could cause problems if the permissions are restrictive). + +Fixes: commit 30de2cb603cdde33524a66d5466f6a9b986ce8a6 +--- + src/format_ext2_kernel.ml | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index c592703..6d2e699 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -311,6 +311,9 @@ and copy_or_symlink_file copy_kernel src dest = + if not copy_kernel then + symlink src dest + else ( +- let cmd = sprintf "cp -p %s %s" (quote src) (quote dest) in ++ (* NB: Do not use -p here, we want the kernel to appear newer ++ * so that --if-newer works. ++ *) ++ let cmd = sprintf "cp %s %s" (quote src) (quote dest) in + run_command cmd + ) +-- +2.37.3 + diff --git a/supermin.spec b/supermin.spec index de651ef..5cab75b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -31,7 +31,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 8%{?dist} +Release: 9%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -55,6 +55,9 @@ Patch: 0003-Restore-compatibility-with-OCaml-4.07.patch Patch: 0004-rpm-Detect-dnf5-and-omit-missing-options.patch # dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2211386) Patch: 0005-rpm-Use-dnf-config-instead-of-c.patch +# Fix --if-newer +Patch: 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch +Patch: 0007-src-Fix-if-newer-copy-kernel.patch BuildRequires: gcc BuildRequires: make @@ -199,6 +202,9 @@ make check || { %changelog +* Mon Jun 12 2023 Richard W.M. Jones - 5.3.3-9 +- Fix --if-newer + * Mon Jun 05 2023 Richard W.M. Jones - 5.3.3-8 - Migrated to SPDX license From 0190d0f55f7d818bd41b3e9c0e68f4cc2839d6ab Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 10 Jul 2023 15:49:18 -0600 Subject: [PATCH 70/95] OCaml 5.0.0 rebuild --- supermin.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/supermin.spec b/supermin.spec index 5cab75b..0488ebd 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,5 +1,3 @@ -%undefine _package_note_flags - # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # @@ -31,7 +29,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 9%{?dist} +Release: 10%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -202,6 +200,9 @@ make check || { %changelog +* Mon Jul 10 2023 Jerry James - 5.3.3-10 +- OCaml 5.0.0 rebuild + * Mon Jun 12 2023 Richard W.M. Jones - 5.3.3-9 - Fix --if-newer From 4e7d4fef4cc6e68ce916346362160914c0b5a473 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 11:36:26 +0100 Subject: [PATCH 71/95] ExcludeArch i686 (https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SPML7CUBSZNI36NLXGVHEG7DNHU3EWOJ/) --- supermin.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supermin.spec b/supermin.spec index 0488ebd..bbd77b0 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,3 +1,6 @@ +# OCaml packages not built on i686 since OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} + # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # From e1702f8c284a8dfa55f78b097efa2ec6cf8be196 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 23:20:40 +0100 Subject: [PATCH 72/95] OCaml 5.0 rebuild for Fedora 39 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index bbd77b0..fc0c1ae 100644 --- a/supermin.spec +++ b/supermin.spec @@ -32,7 +32,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 10%{?dist} +Release: 11%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -203,6 +203,9 @@ make check || { %changelog +* Tue Jul 11 2023 Richard W.M. Jones - 5.3.3-11 +- OCaml 5.0 rebuild for Fedora 39 + * Mon Jul 10 2023 Jerry James - 5.3.3-10 - OCaml 5.0.0 rebuild From 61395e3f5a0fdbbea28ec03c6befcf482cb96792 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 11:34:00 +0100 Subject: [PATCH 73/95] Disable stripping on bytecode platforms as that breaks the binary. --- supermin.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/supermin.spec b/supermin.spec index fc0c1ae..a3d03f4 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,6 +1,14 @@ # OCaml packages not built on i686 since OCaml 5 / Fedora 39. ExcludeArch: %{ix86} +# Stripping breaks bytecode binaries. We also have to disable LTO +# because of https://bugzilla.redhat.com/1915570 +%ifnarch %{ocaml_native_compiler} +%global __strip /bin/true +%global _lto_cflags %nil +%global debug_package %{nil} +%endif + # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # @@ -32,7 +40,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 11%{?dist} +Release: 12%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -203,8 +211,9 @@ make check || { %changelog -* Tue Jul 11 2023 Richard W.M. Jones - 5.3.3-11 +* Tue Jul 11 2023 Richard W.M. Jones - 5.3.3-12 - OCaml 5.0 rebuild for Fedora 39 +- Disable stripping on bytecode platforms as that breaks the binary. * Mon Jul 10 2023 Jerry James - 5.3.3-10 - OCaml 5.0.0 rebuild From 1addc80aac332f202ee707ffadcbc9c6d5b102dc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 22:42:41 +0100 Subject: [PATCH 74/95] Reenable stripping --- ...base-location-in-usr-lib-sysimage-rp.patch | 2 +- 0002-Add-support-for-OCaml-5.0.patch | 2 +- ...estore-compatibility-with-OCaml-4.07.patch | 2 +- ...Detect-dnf5-and-omit-missing-options.patch | 2 +- 0005-rpm-Use-dnf-config-instead-of-c.patch | 2 +- ...ugging-of-the-supermin-if-newer-calc.patch | 2 +- 0007-src-Fix-if-newer-copy-kernel.patch | 2 +- ...m-Reenable-disable_excludes-for-dnf5.patch | 29 ++++++++++++++++ ...utput-complete-exe-instead-of-custom.patch | 33 +++++++++++++++++++ supermin.spec | 17 ++++------ 10 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 0008-rpm-Reenable-disable_excludes-for-dnf5.patch create mode 100644 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 1c5e464..13951d2 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 1/7] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 1/9] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch index 01fc281..22d5916 100644 --- a/0002-Add-support-for-OCaml-5.0.patch +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -1,7 +1,7 @@ From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 2/7] Add support for OCaml 5.0 +Subject: [PATCH 2/9] Add support for OCaml 5.0 --- src/mode_build.ml | 4 ++-- diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch index ae5fa78..7a8dcec 100644 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -1,7 +1,7 @@ From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 3/7] Restore compatibility with OCaml < 4.07 +Subject: [PATCH 3/9] Restore compatibility with OCaml < 4.07 --- src/mode_build.ml | 6 ++++-- diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch index 81fe831..780769c 100644 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -1,7 +1,7 @@ From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 4/7] rpm: Detect dnf5 and omit missing options +Subject: [PATCH 4/9] rpm: Detect dnf5 and omit missing options Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 --- diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch index 614dd68..1c7892e 100644 --- a/0005-rpm-Use-dnf-config-instead-of-c.patch +++ b/0005-rpm-Use-dnf-config-instead-of-c.patch @@ -1,7 +1,7 @@ From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 May 2023 12:52:13 +0100 -Subject: [PATCH 5/7] rpm: Use dnf --config instead of -c +Subject: [PATCH 5/9] rpm: Use dnf --config instead of -c dnf5 does not support -c. dnf4 supports either. diff --git a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch index 6fa0426..11a4c81 100644 --- a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch +++ b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch @@ -1,7 +1,7 @@ From 8dd37da1b5979842b0db44b44655eeaf621f7ac9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 12:51:56 +0100 -Subject: [PATCH 6/7] src: Improved debugging of the supermin if-newer +Subject: [PATCH 6/9] src: Improved debugging of the supermin if-newer calculation Also I expanded the code to make it easier to read. There is no diff --git a/0007-src-Fix-if-newer-copy-kernel.patch b/0007-src-Fix-if-newer-copy-kernel.patch index 19117db..287ccfb 100644 --- a/0007-src-Fix-if-newer-copy-kernel.patch +++ b/0007-src-Fix-if-newer-copy-kernel.patch @@ -1,7 +1,7 @@ From 8c38641042e274a713a18daf7fc85584ca0fc9bb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 13:02:37 +0100 -Subject: [PATCH 7/7] src: Fix --if-newer --copy-kernel +Subject: [PATCH 7/9] src: Fix --if-newer --copy-kernel We previously copied the kernel into the appliance using 'cp -p' which preserves the datestamps of the installed kernel. This can confuse diff --git a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch new file mode 100644 index 0000000..eedf2d8 --- /dev/null +++ b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch @@ -0,0 +1,29 @@ +From 2f3eae350aa89b8067201a8bb24ff830d0fd919c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 22 Jun 2023 08:35:51 +0100 +Subject: [PATCH 8/9] rpm: Reenable disable_excludes for dnf5 + +Updates: commit 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 +Thanks: Jan Kolarik +Link: https://github.com/rpm-software-management/dnf5/issues/581#issuecomment-1600682713 +--- + src/ph_rpm.ml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml +index e94f35f..783d1bb 100644 +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -501,7 +501,8 @@ and download_all_packages_with_dnf pkgs dir tdir = + (match !settings.packager_config with + | None -> "" + | Some filename -> sprintf " --config=%s" (quote filename)) +- (if not is_dnf5 then " --disableexcludes=all" else "") ++ (if not is_dnf5 then " --disableexcludes=all" ++ else " --setopt=disable_excludes=*") + (quote tdir) + (quoted_list rpms) in + run_command cmd +-- +2.37.3 + diff --git a/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch b/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch new file mode 100644 index 0000000..514b5b5 --- /dev/null +++ b/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch @@ -0,0 +1,33 @@ +From dc80dbbef60d5d81a7d4321683a8c7305dc04972 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 12 Jul 2023 22:37:58 +0100 +Subject: [PATCH 9/9] ocamlc: Use -output-complete-exe instead of -custom + +This prevents bytecode executables from being broken by strip and +similar tools. Note this is incompatible with OCaml < 4.10 (so breaks +RHEL 8). However this only affects bytecode builds which we prefer +not to use in RHEL. I left the old option in the Makefile so that it +could be uncommented by someone using older OCaml + bytecode. We need +this for OCaml 5.0 since that drops native backends (temporarily) for +riscv64, s390x and ppc64le. +--- + src/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 5b07e5d..5a1c671 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -132,7 +132,8 @@ OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 + if !HAVE_OCAMLOPT + OBJECTS = $(BOBJECTS) + BEST = c +-OCAMLFLAGS += -custom ++#OCAMLFLAGS += -custom # for OCaml < 4.10 ++OCAMLFLAGS += -output-complete-exe + else + OBJECTS = $(XOBJECTS) + BEST = opt +-- +2.37.3 + diff --git a/supermin.spec b/supermin.spec index a3d03f4..cab5b85 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,14 +1,6 @@ # OCaml packages not built on i686 since OCaml 5 / Fedora 39. ExcludeArch: %{ix86} -# Stripping breaks bytecode binaries. We also have to disable LTO -# because of https://bugzilla.redhat.com/1915570 -%ifnarch %{ocaml_native_compiler} -%global __strip /bin/true -%global _lto_cflags %nil -%global debug_package %{nil} -%endif - # On platforms and architectures that support it, the default is # ‘--with dietlibc’. # @@ -40,7 +32,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 12%{?dist} +Release: 13%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -67,6 +59,10 @@ Patch: 0005-rpm-Use-dnf-config-instead-of-c.patch # Fix --if-newer Patch: 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch Patch: 0007-src-Fix-if-newer-copy-kernel.patch +# Reenable disable_excludes for dnf5 +Patch: 0008-rpm-Reenable-disable_excludes-for-dnf5.patch +# Fix bytecode builds so they resist stripping +Patch: 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch BuildRequires: gcc BuildRequires: make @@ -211,9 +207,8 @@ make check || { %changelog -* Tue Jul 11 2023 Richard W.M. Jones - 5.3.3-12 +* Wed Jul 12 2023 Richard W.M. Jones - 5.3.3-13 - OCaml 5.0 rebuild for Fedora 39 -- Disable stripping on bytecode platforms as that breaks the binary. * Mon Jul 10 2023 Jerry James - 5.3.3-10 - OCaml 5.0.0 rebuild From 47169f1699caa8cab4ee9132c9b29b3cd35cd386 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 22:53:51 +0100 Subject: [PATCH 75/95] Reenable stripping (further fix) --- ...base-location-in-usr-lib-sysimage-rp.patch | 2 +- 0002-Add-support-for-OCaml-5.0.patch | 2 +- ...estore-compatibility-with-OCaml-4.07.patch | 2 +- ...Detect-dnf5-and-omit-missing-options.patch | 2 +- 0005-rpm-Use-dnf-config-instead-of-c.patch | 2 +- ...ugging-of-the-supermin-if-newer-calc.patch | 2 +- 0007-src-Fix-if-newer-copy-kernel.patch | 2 +- ...m-Reenable-disable_excludes-for-dnf5.patch | 2 +- ...utput-complete-exe-instead-of-custom.patch | 2 +- ...ly-output-complete-exe-to-final-link.patch | 42 +++++++++++++++++++ supermin.spec | 1 + 11 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 13951d2..2ae9ef2 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 1/9] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 01/10] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch index 22d5916..68a06aa 100644 --- a/0002-Add-support-for-OCaml-5.0.patch +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -1,7 +1,7 @@ From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 2/9] Add support for OCaml 5.0 +Subject: [PATCH 02/10] Add support for OCaml 5.0 --- src/mode_build.ml | 4 ++-- diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch index 7a8dcec..746e72c 100644 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -1,7 +1,7 @@ From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 3/9] Restore compatibility with OCaml < 4.07 +Subject: [PATCH 03/10] Restore compatibility with OCaml < 4.07 --- src/mode_build.ml | 6 ++++-- diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch index 780769c..3efc582 100644 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -1,7 +1,7 @@ From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 4/9] rpm: Detect dnf5 and omit missing options +Subject: [PATCH 04/10] rpm: Detect dnf5 and omit missing options Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 --- diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch index 1c7892e..d9b2b79 100644 --- a/0005-rpm-Use-dnf-config-instead-of-c.patch +++ b/0005-rpm-Use-dnf-config-instead-of-c.patch @@ -1,7 +1,7 @@ From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 May 2023 12:52:13 +0100 -Subject: [PATCH 5/9] rpm: Use dnf --config instead of -c +Subject: [PATCH 05/10] rpm: Use dnf --config instead of -c dnf5 does not support -c. dnf4 supports either. diff --git a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch index 11a4c81..2b0be0e 100644 --- a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch +++ b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch @@ -1,7 +1,7 @@ From 8dd37da1b5979842b0db44b44655eeaf621f7ac9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 12:51:56 +0100 -Subject: [PATCH 6/9] src: Improved debugging of the supermin if-newer +Subject: [PATCH 06/10] src: Improved debugging of the supermin if-newer calculation Also I expanded the code to make it easier to read. There is no diff --git a/0007-src-Fix-if-newer-copy-kernel.patch b/0007-src-Fix-if-newer-copy-kernel.patch index 287ccfb..fa11fe5 100644 --- a/0007-src-Fix-if-newer-copy-kernel.patch +++ b/0007-src-Fix-if-newer-copy-kernel.patch @@ -1,7 +1,7 @@ From 8c38641042e274a713a18daf7fc85584ca0fc9bb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 13:02:37 +0100 -Subject: [PATCH 7/9] src: Fix --if-newer --copy-kernel +Subject: [PATCH 07/10] src: Fix --if-newer --copy-kernel We previously copied the kernel into the appliance using 'cp -p' which preserves the datestamps of the installed kernel. This can confuse diff --git a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch index eedf2d8..a59c9c7 100644 --- a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch +++ b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch @@ -1,7 +1,7 @@ From 2f3eae350aa89b8067201a8bb24ff830d0fd919c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 08:35:51 +0100 -Subject: [PATCH 8/9] rpm: Reenable disable_excludes for dnf5 +Subject: [PATCH 08/10] rpm: Reenable disable_excludes for dnf5 Updates: commit 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Thanks: Jan Kolarik diff --git a/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch b/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch index 514b5b5..dec8e75 100644 --- a/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch +++ b/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch @@ -1,7 +1,7 @@ From dc80dbbef60d5d81a7d4321683a8c7305dc04972 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 22:37:58 +0100 -Subject: [PATCH 9/9] ocamlc: Use -output-complete-exe instead of -custom +Subject: [PATCH 09/10] ocamlc: Use -output-complete-exe instead of -custom This prevents bytecode executables from being broken by strip and similar tools. Note this is incompatible with OCaml < 4.10 (so breaks diff --git a/0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch b/0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch new file mode 100644 index 0000000..693527d --- /dev/null +++ b/0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch @@ -0,0 +1,42 @@ +From 59a8ffc40db94a38879d9c923520e0bd70ffa271 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 12 Jul 2023 22:51:43 +0100 +Subject: [PATCH 10/10] ocamlc: Only supply -output-complete-exe to final link + +Add a separate variable to store link flags, and use that to supply +-output-complete-exe. Apparently ocamlc ignores -custom in the wrong +place. + +Fixes: dc80dbbef60d5d81a7d4321683a8c7305dc04972 +--- + src/Makefile.am | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 5a1c671..1268aa5 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -132,8 +132,8 @@ OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 + if !HAVE_OCAMLOPT + OBJECTS = $(BOBJECTS) + BEST = c +-#OCAMLFLAGS += -custom # for OCaml < 4.10 +-OCAMLFLAGS += -output-complete-exe ++#OCAMLLINKFLAGS = -custom # for OCaml < 4.10 ++OCAMLLINKFLAGS = -output-complete-exe + else + OBJECTS = $(XOBJECTS) + BEST = opt +@@ -143,7 +143,8 @@ supermin_DEPENDENCIES = $(OBJECTS) + + supermin_LINK = \ + ./supermin-link.sh \ +- $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \ ++ $(OCAMLFIND) $(BEST) $(OCAMLLINKFLAGS) $(OCAMLFLAGS) \ ++ $(OCAMLPACKAGES) \ + $(OBJECTS) -o $@ + + .mli.cmi: +-- +2.37.3 + diff --git a/supermin.spec b/supermin.spec index cab5b85..83bccaa 100644 --- a/supermin.spec +++ b/supermin.spec @@ -63,6 +63,7 @@ Patch: 0007-src-Fix-if-newer-copy-kernel.patch Patch: 0008-rpm-Reenable-disable_excludes-for-dnf5.patch # Fix bytecode builds so they resist stripping Patch: 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch +Patch: 0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch BuildRequires: gcc BuildRequires: make From 191d0e7909985ed373e885c98bd60f95dac1b3ff Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 02:51:21 +0000 Subject: [PATCH 76/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 83bccaa..b1c3e0b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -32,7 +32,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 13%{?dist} +Release: 14%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -208,6 +208,9 @@ make check || { %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 5.3.3-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jul 12 2023 Richard W.M. Jones - 5.3.3-13 - OCaml 5.0 rebuild for Fedora 39 From b394af62b0292e4243354236eb984218be48499f Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 2 Aug 2023 16:48:18 -0400 Subject: [PATCH 77/95] Defer dnf5 until Fedora 41 https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/EYE2JY537OM7GFW46EK7YIBLHJ52USAZ/ --- supermin.spec | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/supermin.spec b/supermin.spec index b1c3e0b..2c99fc1 100644 --- a/supermin.spec +++ b/supermin.spec @@ -23,6 +23,12 @@ ExcludeArch: %{ix86} %endif %endif +%if 0%{?fedora} > 40 || 0%{?rhel} > 10 +%bcond_without dnf5 +%else +%bcond_with dnf5 +%endif + # Whether we should verify tarball signature with GPGv2. %global verify_tarball_signature 1 @@ -32,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 14%{?dist} +Release: 15%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -72,7 +78,12 @@ BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm BuildRequires: rpm-devel +%if %{with dnf5} BuildRequires: dnf5 +%else +BuildRequires: dnf +BuildRequires: dnf-plugins-core +%endif BuildRequires: /usr/sbin/mke2fs BuildRequires: e2fsprogs-devel BuildRequires: findutils @@ -139,7 +150,12 @@ Requires: %{name} = %{version}-%{release} Requires: rpm-build # Dependencies needed for supermin --prepare +%if %{with dnf5} Requires: dnf5 +%else +Requires: dnf +Requires: dnf-plugins-core +%endif Requires: findutils @@ -165,7 +181,7 @@ autoreconf -fi # to remove this later. See: # https://bugzilla.redhat.com/show_bug.cgi?id=2209412 # https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5 -%configure DNF=%{_bindir}/dnf5 --disable-network-tests +%configure %{?with_dnf5:DNF=%{_bindir}/dnf5} --disable-network-tests %if %{with dietlibc} make -C init CC="diet gcc" @@ -208,6 +224,9 @@ make check || { %changelog +* Wed Aug 02 2023 Yaakov Selkowitz - 5.3.3-15 +- Defer dnf5 until Fedora 41 + * Sat Jul 22 2023 Fedora Release Engineering - 5.3.3-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 6f9f7bfc2ee8622d921e5ab3228cc4e4ed2d4dd3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 5 Oct 2023 14:59:46 +0100 Subject: [PATCH 78/95] OCaml 5.1 rebuild for Fedora 40 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 2c99fc1..24548fd 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 15%{?dist} +Release: 16%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -224,6 +224,9 @@ make check || { %changelog +* Thu Oct 05 2023 Richard W.M. Jones - 5.3.3-16 +- OCaml 5.1 rebuild for Fedora 40 + * Wed Aug 02 2023 Yaakov Selkowitz - 5.3.3-15 - Defer dnf5 until Fedora 41 From 2417d4becfeec7070b53645bbcb5d0f57f4444f5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 10 Nov 2023 11:03:54 +0000 Subject: [PATCH 79/95] Fix RISC-V gzip compressed kernels --- ...base-location-in-usr-lib-sysimage-rp.patch | 4 +- 0002-Add-support-for-OCaml-5.0.patch | 4 +- ...estore-compatibility-with-OCaml-4.07.patch | 4 +- ...Detect-dnf5-and-omit-missing-options.patch | 4 +- 0005-rpm-Use-dnf-config-instead-of-c.patch | 4 +- ...ugging-of-the-supermin-if-newer-calc.patch | 4 +- 0007-src-Fix-if-newer-copy-kernel.patch | 4 +- ...m-Reenable-disable_excludes-for-dnf5.patch | 4 +- ...kernel.ml-Fix-kernel-filtering-for-a.patch | 26 +++++++ ...utput-complete-exe-instead-of-custom.patch | 4 +- ...ly-output-complete-exe-to-final-link.patch | 4 +- ...kernel.ml-Rename-function-file-kerne.patch | 36 ++++++++++ 0013-src-Uncompress-kernel-on-RISC-V.patch | 72 +++++++++++++++++++ supermin.spec | 14 +++- 14 files changed, 165 insertions(+), 23 deletions(-) create mode 100644 0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch rename 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch => 0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch (93%) rename 0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch => 0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch (94%) create mode 100644 0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch create mode 100644 0013-src-Uncompress-kernel-on-RISC-V.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch index 2ae9ef2..ffd86f0 100644 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch @@ -1,7 +1,7 @@ From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 01/10] rpm: New RPM database location in /usr/lib/sysimage/rpm +Subject: [PATCH 01/13] rpm: New RPM database location in /usr/lib/sysimage/rpm A few years ago the RPM database was moved from /var to /usr. This is now feeding through to Linux distros. @@ -46,5 +46,5 @@ index 85557fe..2c199c1 100644 (* Return the best provider of a particular RPM requirement. * -- -2.37.3 +2.42.0 diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch index 68a06aa..03325a1 100644 --- a/0002-Add-support-for-OCaml-5.0.patch +++ b/0002-Add-support-for-OCaml-5.0.patch @@ -1,7 +1,7 @@ From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 02/10] Add support for OCaml 5.0 +Subject: [PATCH 02/13] Add support for OCaml 5.0 --- src/mode_build.ml | 4 ++-- @@ -94,5 +94,5 @@ index 521d49e..ae99294 100644 let xs = uniq ~cmp xs in xs -- -2.37.3 +2.42.0 diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch index 746e72c..ad99e23 100644 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ b/0003-Restore-compatibility-with-OCaml-4.07.patch @@ -1,7 +1,7 @@ From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 03/10] Restore compatibility with OCaml < 4.07 +Subject: [PATCH 03/13] Restore compatibility with OCaml < 4.07 --- src/mode_build.ml | 6 ++++-- @@ -121,5 +121,5 @@ index ae99294..1dc4310 100644 let xs = uniq ~cmp xs in xs -- -2.37.3 +2.42.0 diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch index 3efc582..9c28148 100644 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch @@ -1,7 +1,7 @@ From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 04/10] rpm: Detect dnf5 and omit missing options +Subject: [PATCH 04/13] rpm: Detect dnf5 and omit missing options Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 --- @@ -54,5 +54,5 @@ index 2c199c1..3e803c6 100644 let rpms = List.map rpm_of_pkg (PackageSet.elements pkgs) in List.map ( -- -2.37.3 +2.42.0 diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch index d9b2b79..667cccf 100644 --- a/0005-rpm-Use-dnf-config-instead-of-c.patch +++ b/0005-rpm-Use-dnf-config-instead-of-c.patch @@ -1,7 +1,7 @@ From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 May 2023 12:52:13 +0100 -Subject: [PATCH 05/10] rpm: Use dnf --config instead of -c +Subject: [PATCH 05/13] rpm: Use dnf --config instead of -c dnf5 does not support -c. dnf4 supports either. @@ -24,5 +24,5 @@ index 3e803c6..e94f35f 100644 (quote tdir) (quoted_list rpms) in -- -2.37.3 +2.42.0 diff --git a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch index 2b0be0e..6ab70b6 100644 --- a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch +++ b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch @@ -1,7 +1,7 @@ From 8dd37da1b5979842b0db44b44655eeaf621f7ac9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 12:51:56 +0100 -Subject: [PATCH 06/10] src: Improved debugging of the supermin if-newer +Subject: [PATCH 06/13] src: Improved debugging of the supermin if-newer calculation Also I expanded the code to make it easier to read. There is no @@ -52,5 +52,5 @@ index d49c1e8..c30c73c 100644 printf "supermin: if-newer: output does not need rebuilding\n%!"; exit 0 -- -2.37.3 +2.42.0 diff --git a/0007-src-Fix-if-newer-copy-kernel.patch b/0007-src-Fix-if-newer-copy-kernel.patch index fa11fe5..1758fc3 100644 --- a/0007-src-Fix-if-newer-copy-kernel.patch +++ b/0007-src-Fix-if-newer-copy-kernel.patch @@ -1,7 +1,7 @@ From 8c38641042e274a713a18daf7fc85584ca0fc9bb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 12 Jun 2023 13:02:37 +0100 -Subject: [PATCH 07/10] src: Fix --if-newer --copy-kernel +Subject: [PATCH 07/13] src: Fix --if-newer --copy-kernel We previously copied the kernel into the appliance using 'cp -p' which preserves the datestamps of the installed kernel. This can confuse @@ -35,5 +35,5 @@ index c592703..6d2e699 100644 run_command cmd ) -- -2.37.3 +2.42.0 diff --git a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch index a59c9c7..d8fb554 100644 --- a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch +++ b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch @@ -1,7 +1,7 @@ From 2f3eae350aa89b8067201a8bb24ff830d0fd919c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 08:35:51 +0100 -Subject: [PATCH 08/10] rpm: Reenable disable_excludes for dnf5 +Subject: [PATCH 08/13] rpm: Reenable disable_excludes for dnf5 Updates: commit 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Thanks: Jan Kolarik @@ -25,5 +25,5 @@ index e94f35f..783d1bb 100644 (quoted_list rpms) in run_command cmd -- -2.37.3 +2.42.0 diff --git a/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch b/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch new file mode 100644 index 0000000..70f22bc --- /dev/null +++ b/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch @@ -0,0 +1,26 @@ +From 4b3922feb65150f3423d0877038c5ba6e16d910c Mon Sep 17 00:00:00 2001 +From: Simon Fischer <1522981+Fischer-Simon@users.noreply.github.com> +Date: Wed, 12 Jul 2023 17:10:53 +0200 +Subject: [PATCH 09/13] src/format_ext2_kernel.ml: Fix kernel filtering for + aarch64 architecture + +Add appropriate globs for arm based kernels. The file names end in -arm64 but the architecture is named aarch64. +--- + src/format_ext2_kernel.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml +index 6d2e699..4589552 100644 +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -187,6 +187,7 @@ and patt_of_cpu host_cpu = + | "amd64" | "x86_64" -> ["amd64"; "x86_64"] + | "parisc" | "parisc64" -> ["hppa"; "hppa64"] + | "ppc64el" -> ["powerpc64le"] ++ | "aarch64" -> ["aarch64"; "arm64"] + | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] + | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] + | _ -> [host_cpu] +-- +2.42.0 + diff --git a/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch b/0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch similarity index 93% rename from 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch rename to 0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch index dec8e75..6c34134 100644 --- a/0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch +++ b/0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch @@ -1,7 +1,7 @@ From dc80dbbef60d5d81a7d4321683a8c7305dc04972 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 22:37:58 +0100 -Subject: [PATCH 09/10] ocamlc: Use -output-complete-exe instead of -custom +Subject: [PATCH 10/13] ocamlc: Use -output-complete-exe instead of -custom This prevents bytecode executables from being broken by strip and similar tools. Note this is incompatible with OCaml < 4.10 (so breaks @@ -29,5 +29,5 @@ index 5b07e5d..5a1c671 100644 OBJECTS = $(XOBJECTS) BEST = opt -- -2.37.3 +2.42.0 diff --git a/0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch b/0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch similarity index 94% rename from 0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch rename to 0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch index 693527d..e4f9621 100644 --- a/0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch +++ b/0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch @@ -1,7 +1,7 @@ From 59a8ffc40db94a38879d9c923520e0bd70ffa271 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 22:51:43 +0100 -Subject: [PATCH 10/10] ocamlc: Only supply -output-complete-exe to final link +Subject: [PATCH 11/13] ocamlc: Only supply -output-complete-exe to final link Add a separate variable to store link flags, and use that to supply -output-complete-exe. Apparently ocamlc ignores -custom in the wrong @@ -38,5 +38,5 @@ index 5a1c671..1268aa5 100644 .mli.cmi: -- -2.37.3 +2.42.0 diff --git a/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch b/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch new file mode 100644 index 0000000..63b7e5d --- /dev/null +++ b/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch @@ -0,0 +1,36 @@ +From 9a0d078dc35fde7a715666bce6c765ed5fe5e916 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +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 + diff --git a/0013-src-Uncompress-kernel-on-RISC-V.patch b/0013-src-Uncompress-kernel-on-RISC-V.patch new file mode 100644 index 0000000..32abb93 --- /dev/null +++ b/0013-src-Uncompress-kernel-on-RISC-V.patch @@ -0,0 +1,72 @@ +From 5230e2c3cd07e82bd6431e871e239f7056bf25ad Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +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 + diff --git a/supermin.spec b/supermin.spec index 24548fd..d432237 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 16%{?dist} +Release: 17%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -67,9 +67,14 @@ Patch: 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch Patch: 0007-src-Fix-if-newer-copy-kernel.patch # Reenable disable_excludes for dnf5 Patch: 0008-rpm-Reenable-disable_excludes-for-dnf5.patch +# Fix kernel filtering on aarch64 +Patch: 0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch # Fix bytecode builds so they resist stripping -Patch: 0009-ocamlc-Use-output-complete-exe-instead-of-custom.patch -Patch: 0010-ocamlc-Only-supply-output-complete-exe-to-final-link.patch +Patch: 0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch +Patch: 0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch +# Fix RISC-V gzip compressed kernels +Patch: 0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch +Patch: 0013-src-Uncompress-kernel-on-RISC-V.patch BuildRequires: gcc BuildRequires: make @@ -224,6 +229,9 @@ make check || { %changelog +* Fri Nov 10 2023 Richard W.M. Jones - 5.3.3-17 +- Fix RISC-V gzip compressed kernels + * Thu Oct 05 2023 Richard W.M. Jones - 5.3.3-16 - OCaml 5.1 rebuild for Fedora 40 From a3f30e63dc36a5c7255644133c2686213d96cafa Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 12 Dec 2023 14:02:50 +0000 Subject: [PATCH 80/95] OCaml 5.1.1 rebuild for Fedora 40 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index d432237..2b9729d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 17%{?dist} +Release: 18%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -229,6 +229,9 @@ make check || { %changelog +* Tue Dec 12 2023 Richard W.M. Jones - 5.3.3-18 +- OCaml 5.1.1 rebuild for Fedora 40 + * Fri Nov 10 2023 Richard W.M. Jones - 5.3.3-17 - Fix RISC-V gzip compressed kernels From e50448eed693b86ac2627c160771c8cc7dc65675 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 18 Dec 2023 13:45:35 +0000 Subject: [PATCH 81/95] OCaml 5.1.1 + s390x code gen fix for Fedora 40 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 2b9729d..086cf8d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.3 -Release: 18%{?dist} +Release: 19%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -229,6 +229,9 @@ make check || { %changelog +* Mon Dec 18 2023 Richard W.M. Jones - 5.3.3-19 +- OCaml 5.1.1 + s390x code gen fix for Fedora 40 + * Tue Dec 12 2023 Richard W.M. Jones - 5.3.3-18 - OCaml 5.1.1 rebuild for Fedora 40 From 61460d5d8f023181268a0757f8d657570dff5507 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Jan 2024 12:25:53 +0000 Subject: [PATCH 82/95] New upstream version 5.3.4 Remove patches which are now all upstream. --- ...base-location-in-usr-lib-sysimage-rp.patch | 50 ------- 0002-Add-support-for-OCaml-5.0.patch | 98 -------------- ...estore-compatibility-with-OCaml-4.07.patch | 125 ------------------ ...Detect-dnf5-and-omit-missing-options.patch | 58 -------- 0005-rpm-Use-dnf-config-instead-of-c.patch | 28 ---- ...ugging-of-the-supermin-if-newer-calc.patch | 56 -------- 0007-src-Fix-if-newer-copy-kernel.patch | 39 ------ ...m-Reenable-disable_excludes-for-dnf5.patch | 29 ---- ...kernel.ml-Fix-kernel-filtering-for-a.patch | 26 ---- ...utput-complete-exe-instead-of-custom.patch | 33 ----- ...ly-output-complete-exe-to-final-link.patch | 42 ------ ...kernel.ml-Rename-function-file-kerne.patch | 36 ----- 0013-src-Uncompress-kernel-on-RISC-V.patch | 72 ---------- sources | 4 +- supermin.spec | 31 +---- 15 files changed, 8 insertions(+), 719 deletions(-) delete mode 100644 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch delete mode 100644 0002-Add-support-for-OCaml-5.0.patch delete mode 100644 0003-Restore-compatibility-with-OCaml-4.07.patch delete mode 100644 0004-rpm-Detect-dnf5-and-omit-missing-options.patch delete mode 100644 0005-rpm-Use-dnf-config-instead-of-c.patch delete mode 100644 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch delete mode 100644 0007-src-Fix-if-newer-copy-kernel.patch delete mode 100644 0008-rpm-Reenable-disable_excludes-for-dnf5.patch delete mode 100644 0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch delete mode 100644 0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch delete mode 100644 0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch delete mode 100644 0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch delete mode 100644 0013-src-Uncompress-kernel-on-RISC-V.patch diff --git a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch b/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch deleted file mode 100644 index ffd86f0..0000000 --- a/0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 86fd6f3e86ab99d54a22b475aecccfc19bdff07e Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 21 Jan 2023 09:38:55 +0000 -Subject: [PATCH 01/13] rpm: New RPM database location in /usr/lib/sysimage/rpm - -A few years ago the RPM database was moved from /var to /usr. This is -now feeding through to Linux distros. - -http://lists.rpm.org/pipermail/rpm-maint/2017-October/006723.html -https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr -https://src.fedoraproject.org/rpms/rpm/pull-request/21 ---- - src/ph_rpm.ml | 20 +++++++++++++++----- - 1 file changed, 15 insertions(+), 5 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 85557fe..2c199c1 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -236,12 +236,22 @@ let rpm_package_name pkg = - let rpm = rpm_of_pkg pkg in - rpm.name - -+let rpmdb_locations = [ -+ "/usr/lib/sysimage/rpm/rpmdb.sqlite"; -+ "/var/lib/rpm/rpmdb.sqlite"; -+ "/var/lib/rpm/Packages" -+] -+ -+let find_rpmdb () = -+ let rec loop = function -+ | [] -> error "rpm: cannot locate RPM database; if this is a normal RPM-based Linux distro then this is probably a supermin bug" -+ | db :: rest -> -+ if Sys.file_exists db then db else loop rest -+ in -+ loop rpmdb_locations -+ - let rpm_get_package_database_mtime () = -- (try -- lstat "/var/lib/rpm/rpmdb.sqlite" -- with Unix_error (ENOENT, _, _) -> -- lstat "/var/lib/rpm/Packages" -- ).st_mtime -+ (lstat (find_rpmdb ())).st_mtime - - (* Return the best provider of a particular RPM requirement. - * --- -2.42.0 - diff --git a/0002-Add-support-for-OCaml-5.0.patch b/0002-Add-support-for-OCaml-5.0.patch deleted file mode 100644 index 03325a1..0000000 --- a/0002-Add-support-for-OCaml-5.0.patch +++ /dev/null @@ -1,98 +0,0 @@ -From f8774efbe02d3651cde449333cf108e79adba48c Mon Sep 17 00:00:00 2001 -From: Kate -Date: Wed, 16 Nov 2022 19:30:01 +0000 -Subject: [PATCH 02/13] Add support for OCaml 5.0 - ---- - src/mode_build.ml | 4 ++-- - src/supermin.ml | 16 ++++++++-------- - src/utils.ml | 4 ++-- - 3 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/src/mode_build.ml b/src/mode_build.ml -index 7c48295..f81341d 100644 ---- a/src/mode_build.ml -+++ b/src/mode_build.ml -@@ -123,7 +123,7 @@ let rec build debug - (PackageSet.cardinal packages); - if debug >= 2 then ( - List.iter (printf " - %s\n") pretty_packages; -- flush Pervasives.stdout -+ flush Stdlib.stdout - ) - ); - -@@ -207,7 +207,7 @@ let rec build debug - (List.length files); - if debug >= 2 then ( - List.iter (fun { ft_path = path } -> printf " - %s\n" path) files; -- flush Pervasives.stdout -+ flush Stdlib.stdout - ) - ); - -diff --git a/src/supermin.ml b/src/supermin.ml -index 659e857..bef9db6 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -296,27 +296,27 @@ let () = - main () - with - | Unix.Unix_error (code, fname, "") -> (* from a syscall *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "error: %s: %s" fname (Unix.error_message code) - | Unix.Unix_error (code, fname, param) -> (* from a syscall *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "error: %s: %s: %s" fname (Unix.error_message code) param - | Failure msg -> (* from failwith/failwithf *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "failure: %s" msg - | Librpm.Multiple_matches (package, count) -> (* from librpm *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "RPM error: %d occurrences for %s" count package - | Invalid_argument msg -> (* probably should never happen *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "internal error: invalid argument: %s" msg - | Assert_failure (file, line, char) -> (* should never happen *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "internal error: assertion failed at %s, line %d, char %d" - file line char - | Not_found -> (* should never happen *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "internal error: Not_found exception was thrown" - | exn -> (* something not matched above *) -- Printexc.print_backtrace Pervasives.stderr; -+ Printexc.print_backtrace Stdlib.stderr; - error "exception: %s" (Printexc.to_string exn) -diff --git a/src/utils.ml b/src/utils.ml -index 521d49e..ae99294 100644 ---- a/src/utils.ml -+++ b/src/utils.ml -@@ -40,7 +40,7 @@ let dir_exists name = - try (stat name).st_kind = S_DIR - with Unix_error _ -> false - --let uniq ?(cmp = Pervasives.compare) xs = -+let uniq ?(cmp = Stdlib.compare) xs = - let rec loop acc = function - | [] -> acc - | [x] -> x :: acc -@@ -51,7 +51,7 @@ let uniq ?(cmp = Pervasives.compare) xs = - in - List.rev (loop [] xs) - --let sort_uniq ?(cmp = Pervasives.compare) xs = -+let sort_uniq ?(cmp = Stdlib.compare) xs = - let xs = List.sort cmp xs in - let xs = uniq ~cmp xs in - xs --- -2.42.0 - diff --git a/0003-Restore-compatibility-with-OCaml-4.07.patch b/0003-Restore-compatibility-with-OCaml-4.07.patch deleted file mode 100644 index ad99e23..0000000 --- a/0003-Restore-compatibility-with-OCaml-4.07.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 3efe663421d94376694f292ca1fcf2732a82149f Mon Sep 17 00:00:00 2001 -From: Kate -Date: Wed, 16 Nov 2022 19:59:36 +0000 -Subject: [PATCH 03/13] Restore compatibility with OCaml < 4.07 - ---- - src/mode_build.ml | 6 ++++-- - src/supermin.ml | 18 ++++++++++-------- - src/utils.ml | 6 ++++-- - 3 files changed, 18 insertions(+), 12 deletions(-) - -diff --git a/src/mode_build.ml b/src/mode_build.ml -index f81341d..f0e5e09 100644 ---- a/src/mode_build.ml -+++ b/src/mode_build.ml -@@ -16,6 +16,8 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -+let stdlib_stdout = stdout -+ - open Unix - open Unix.LargeFile - open Printf -@@ -123,7 +125,7 @@ let rec build debug - (PackageSet.cardinal packages); - if debug >= 2 then ( - List.iter (printf " - %s\n") pretty_packages; -- flush Stdlib.stdout -+ flush stdlib_stdout - ) - ); - -@@ -207,7 +209,7 @@ let rec build debug - (List.length files); - if debug >= 2 then ( - List.iter (fun { ft_path = path } -> printf " - %s\n" path) files; -- flush Stdlib.stdout -+ flush stdlib_stdout - ) - ); - -diff --git a/src/supermin.ml b/src/supermin.ml -index bef9db6..d49c1e8 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -16,6 +16,8 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -+let stdlib_stderr = stderr -+ - open Unix - open Unix.LargeFile - open Printf -@@ -296,27 +298,27 @@ let () = - main () - with - | Unix.Unix_error (code, fname, "") -> (* from a syscall *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "error: %s: %s" fname (Unix.error_message code) - | Unix.Unix_error (code, fname, param) -> (* from a syscall *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "error: %s: %s: %s" fname (Unix.error_message code) param - | Failure msg -> (* from failwith/failwithf *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "failure: %s" msg - | Librpm.Multiple_matches (package, count) -> (* from librpm *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "RPM error: %d occurrences for %s" count package - | Invalid_argument msg -> (* probably should never happen *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "internal error: invalid argument: %s" msg - | Assert_failure (file, line, char) -> (* should never happen *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "internal error: assertion failed at %s, line %d, char %d" - file line char - | Not_found -> (* should never happen *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "internal error: Not_found exception was thrown" - | exn -> (* something not matched above *) -- Printexc.print_backtrace Stdlib.stderr; -+ Printexc.print_backtrace stdlib_stderr; - error "exception: %s" (Printexc.to_string exn) -diff --git a/src/utils.ml b/src/utils.ml -index ae99294..1dc4310 100644 ---- a/src/utils.ml -+++ b/src/utils.ml -@@ -16,6 +16,8 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -+let stdlib_compare = compare -+ - open Unix - open Unix.LargeFile - open Printf -@@ -40,7 +42,7 @@ let dir_exists name = - try (stat name).st_kind = S_DIR - with Unix_error _ -> false - --let uniq ?(cmp = Stdlib.compare) xs = -+let uniq ?(cmp = stdlib_compare) xs = - let rec loop acc = function - | [] -> acc - | [x] -> x :: acc -@@ -51,7 +53,7 @@ let uniq ?(cmp = Stdlib.compare) xs = - in - List.rev (loop [] xs) - --let sort_uniq ?(cmp = Stdlib.compare) xs = -+let sort_uniq ?(cmp = stdlib_compare) xs = - let xs = List.sort cmp xs in - let xs = uniq ~cmp xs in - xs --- -2.42.0 - diff --git a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch b/0004-rpm-Detect-dnf5-and-omit-missing-options.patch deleted file mode 100644 index 9c28148..0000000 --- a/0004-rpm-Detect-dnf5-and-omit-missing-options.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 30 May 2023 09:12:14 +0100 -Subject: [PATCH 04/13] rpm: Detect dnf5 and omit missing options - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2209412 ---- - src/ph_rpm.ml | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index 2c199c1..3e803c6 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -482,19 +482,38 @@ and download_all_packages_with_dnf pkgs dir tdir = - (* Old dnf didn't create the destdir directory, newer versions do. *) - mkdir tdir 0o700; - -+ (* dnf5 lacks various options so we have to detect it: -+ * https://github.com/rpm-software-management/dnf5/issues/580 -+ * https://github.com/rpm-software-management/dnf5/issues/581 -+ *) -+ let is_dnf5 = is_dnf5 () in -+ let debug_quiet_option = -+ if !settings.debug < 1 then " -q" -+ else if not is_dnf5 then " -v" -+ else "" in -+ - let rpms = pkgs_as_NA_rpms pkgs in - - let cmd = -- sprintf "%s download%s%s --destdir=%s --disableexcludes=all %s" -+ sprintf "%s download%s%s%s --destdir=%s %s" - Config.dnf -- (if !settings.debug >= 1 then " -v" else " -q") -+ debug_quiet_option - (match !settings.packager_config with - | None -> "" - | Some filename -> sprintf " -c %s" (quote filename)) -+ (if not is_dnf5 then " --disableexcludes=all" else "") - (quote tdir) - (quoted_list rpms) in - run_command cmd - -+and is_dnf5 () = -+ let cmd = sprintf "%s --version" Config.dnf in -+ let lines = run_command_get_lines cmd in -+ match lines with -+ | [] -> error "rpm: no output from '%s' command" cmd -+ | line :: _ when find line "version 5" >= 0 -> true -+ | _ -> false -+ - and pkgs_as_NA_rpms pkgs = - let rpms = List.map rpm_of_pkg (PackageSet.elements pkgs) in - List.map ( --- -2.42.0 - diff --git a/0005-rpm-Use-dnf-config-instead-of-c.patch b/0005-rpm-Use-dnf-config-instead-of-c.patch deleted file mode 100644 index 667cccf..0000000 --- a/0005-rpm-Use-dnf-config-instead-of-c.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 057ea99a3211057d2cb2c9971afe56e0a85e0f78 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 31 May 2023 12:52:13 +0100 -Subject: [PATCH 05/13] rpm: Use dnf --config instead of -c - -dnf5 does not support -c. dnf4 supports either. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2211386 ---- - 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 3e803c6..e94f35f 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -500,7 +500,7 @@ and download_all_packages_with_dnf pkgs dir tdir = - debug_quiet_option - (match !settings.packager_config with - | None -> "" -- | Some filename -> sprintf " -c %s" (quote filename)) -+ | Some filename -> sprintf " --config=%s" (quote filename)) - (if not is_dnf5 then " --disableexcludes=all" else "") - (quote tdir) - (quoted_list rpms) in --- -2.42.0 - diff --git a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch b/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch deleted file mode 100644 index 6ab70b6..0000000 --- a/0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 8dd37da1b5979842b0db44b44655eeaf621f7ac9 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 12 Jun 2023 12:51:56 +0100 -Subject: [PATCH 06/13] src: Improved debugging of the supermin if-newer - calculation - -Also I expanded the code to make it easier to read. There is no -change to the calculation intended. ---- - src/supermin.ml | 29 ++++++++++++++++++++++++++--- - 1 file changed, 26 insertions(+), 3 deletions(-) - -diff --git a/src/supermin.ml b/src/supermin.ml -index d49c1e8..c30c73c 100644 ---- a/src/supermin.ml -+++ b/src/supermin.ml -@@ -241,10 +241,33 @@ appliance automatically. - try - let outputs = Mode_build.get_outputs args inputs in - let outputs = List.map ((//) outputdir) outputs in -- let odates = List.map (fun d -> (lstat d).st_mtime) (outputdir :: outputs) in -- let idates = List.map (fun d -> (lstat d).st_mtime) inputs in -+ let outputs = outputdir :: outputs in -+ let odates = List.map (fun f -> (lstat f).st_mtime) outputs in -+ if debug >= 2 then ( -+ List.iter ( -+ fun f -> -+ printf "supermin: if-newer: output %s => %.2f\n" -+ f (lstat f).st_mtime -+ ) outputs; -+ ); -+ let idates = List.map (fun f -> (lstat f).st_mtime) inputs in -+ if debug >= 2 then ( -+ List.iter ( -+ fun f -> -+ printf "supermin: if-newer: input %s => %.2f\n" -+ f (lstat f).st_mtime -+ ) inputs; -+ ); - let pdate = (get_package_handler ()).ph_get_package_database_mtime () in -- if List.for_all (fun idate -> List.for_all (fun odate -> idate < odate) odates) (pdate :: idates) then ( -+ if debug >= 2 then ( -+ printf "supermin: if-newer: package database date: %.2f\n" pdate; -+ ); -+ let older = -+ List.for_all ( -+ fun idate -> -+ List.for_all (fun odate -> idate < odate) odates -+ ) (pdate :: idates) in -+ if older then ( - if debug >= 1 then - printf "supermin: if-newer: output does not need rebuilding\n%!"; - exit 0 --- -2.42.0 - diff --git a/0007-src-Fix-if-newer-copy-kernel.patch b/0007-src-Fix-if-newer-copy-kernel.patch deleted file mode 100644 index 1758fc3..0000000 --- a/0007-src-Fix-if-newer-copy-kernel.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 8c38641042e274a713a18daf7fc85584ca0fc9bb Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 12 Jun 2023 13:02:37 +0100 -Subject: [PATCH 07/13] src: Fix --if-newer --copy-kernel - -We previously copied the kernel into the appliance using 'cp -p' which -preserves the datestamps of the installed kernel. This can confuse -the --if-newer calculation, if for example the package database is -newer than the date on the installed kernel (which quite often is the -case). This makes it think that the appliance is always older than -the package database, thus forcing a rebuild. - -We can fix this using 'cp' instead of 'cp -p'. We don't need the -permissions and datestamps on the copied kernel to be preserved anyway -(in fact, it could cause problems if the permissions are restrictive). - -Fixes: commit 30de2cb603cdde33524a66d5466f6a9b986ce8a6 ---- - src/format_ext2_kernel.ml | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index c592703..6d2e699 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -311,6 +311,9 @@ and copy_or_symlink_file copy_kernel src dest = - if not copy_kernel then - symlink src dest - else ( -- let cmd = sprintf "cp -p %s %s" (quote src) (quote dest) in -+ (* NB: Do not use -p here, we want the kernel to appear newer -+ * so that --if-newer works. -+ *) -+ let cmd = sprintf "cp %s %s" (quote src) (quote dest) in - run_command cmd - ) --- -2.42.0 - diff --git a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch b/0008-rpm-Reenable-disable_excludes-for-dnf5.patch deleted file mode 100644 index d8fb554..0000000 --- a/0008-rpm-Reenable-disable_excludes-for-dnf5.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 2f3eae350aa89b8067201a8bb24ff830d0fd919c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 22 Jun 2023 08:35:51 +0100 -Subject: [PATCH 08/13] rpm: Reenable disable_excludes for dnf5 - -Updates: commit 92d5d7e8c27088fa3fb8e5e6e9c5b8d3209053d6 -Thanks: Jan Kolarik -Link: https://github.com/rpm-software-management/dnf5/issues/581#issuecomment-1600682713 ---- - src/ph_rpm.ml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml -index e94f35f..783d1bb 100644 ---- a/src/ph_rpm.ml -+++ b/src/ph_rpm.ml -@@ -501,7 +501,8 @@ and download_all_packages_with_dnf pkgs dir tdir = - (match !settings.packager_config with - | None -> "" - | Some filename -> sprintf " --config=%s" (quote filename)) -- (if not is_dnf5 then " --disableexcludes=all" else "") -+ (if not is_dnf5 then " --disableexcludes=all" -+ else " --setopt=disable_excludes=*") - (quote tdir) - (quoted_list rpms) in - run_command cmd --- -2.42.0 - diff --git a/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch b/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch deleted file mode 100644 index 70f22bc..0000000 --- a/0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4b3922feb65150f3423d0877038c5ba6e16d910c Mon Sep 17 00:00:00 2001 -From: Simon Fischer <1522981+Fischer-Simon@users.noreply.github.com> -Date: Wed, 12 Jul 2023 17:10:53 +0200 -Subject: [PATCH 09/13] src/format_ext2_kernel.ml: Fix kernel filtering for - aarch64 architecture - -Add appropriate globs for arm based kernels. The file names end in -arm64 but the architecture is named aarch64. ---- - src/format_ext2_kernel.ml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml -index 6d2e699..4589552 100644 ---- a/src/format_ext2_kernel.ml -+++ b/src/format_ext2_kernel.ml -@@ -187,6 +187,7 @@ and patt_of_cpu host_cpu = - | "amd64" | "x86_64" -> ["amd64"; "x86_64"] - | "parisc" | "parisc64" -> ["hppa"; "hppa64"] - | "ppc64el" -> ["powerpc64le"] -+ | "aarch64" -> ["aarch64"; "arm64"] - | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] - | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] - | _ -> [host_cpu] --- -2.42.0 - diff --git a/0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch b/0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch deleted file mode 100644 index 6c34134..0000000 --- a/0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch +++ /dev/null @@ -1,33 +0,0 @@ -From dc80dbbef60d5d81a7d4321683a8c7305dc04972 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 12 Jul 2023 22:37:58 +0100 -Subject: [PATCH 10/13] ocamlc: Use -output-complete-exe instead of -custom - -This prevents bytecode executables from being broken by strip and -similar tools. Note this is incompatible with OCaml < 4.10 (so breaks -RHEL 8). However this only affects bytecode builds which we prefer -not to use in RHEL. I left the old option in the Makefile so that it -could be uncommented by someone using older OCaml + bytecode. We need -this for OCaml 5.0 since that drops native backends (temporarily) for -riscv64, s390x and ppc64le. ---- - src/Makefile.am | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/Makefile.am b/src/Makefile.am -index 5b07e5d..5a1c671 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -132,7 +132,8 @@ OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 - if !HAVE_OCAMLOPT - OBJECTS = $(BOBJECTS) - BEST = c --OCAMLFLAGS += -custom -+#OCAMLFLAGS += -custom # for OCaml < 4.10 -+OCAMLFLAGS += -output-complete-exe - else - OBJECTS = $(XOBJECTS) - BEST = opt --- -2.42.0 - diff --git a/0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch b/0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch deleted file mode 100644 index e4f9621..0000000 --- a/0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 59a8ffc40db94a38879d9c923520e0bd70ffa271 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 12 Jul 2023 22:51:43 +0100 -Subject: [PATCH 11/13] ocamlc: Only supply -output-complete-exe to final link - -Add a separate variable to store link flags, and use that to supply --output-complete-exe. Apparently ocamlc ignores -custom in the wrong -place. - -Fixes: dc80dbbef60d5d81a7d4321683a8c7305dc04972 ---- - src/Makefile.am | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/Makefile.am b/src/Makefile.am -index 5a1c671..1268aa5 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -132,8 +132,8 @@ OCAMLFLAGS = -g -warn-error +C+D+E+F+L+M+P+S+U+V+X+Y+Z-3 - if !HAVE_OCAMLOPT - OBJECTS = $(BOBJECTS) - BEST = c --#OCAMLFLAGS += -custom # for OCaml < 4.10 --OCAMLFLAGS += -output-complete-exe -+#OCAMLLINKFLAGS = -custom # for OCaml < 4.10 -+OCAMLLINKFLAGS = -output-complete-exe - else - OBJECTS = $(XOBJECTS) - BEST = opt -@@ -143,7 +143,8 @@ supermin_DEPENDENCIES = $(OBJECTS) - - supermin_LINK = \ - ./supermin-link.sh \ -- $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \ -+ $(OCAMLFIND) $(BEST) $(OCAMLLINKFLAGS) $(OCAMLFLAGS) \ -+ $(OCAMLPACKAGES) \ - $(OBJECTS) -o $@ - - .mli.cmi: --- -2.42.0 - diff --git a/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch b/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch deleted file mode 100644 index 63b7e5d..0000000 --- a/0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 9a0d078dc35fde7a715666bce6c765ed5fe5e916 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -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 - diff --git a/0013-src-Uncompress-kernel-on-RISC-V.patch b/0013-src-Uncompress-kernel-on-RISC-V.patch deleted file mode 100644 index 32abb93..0000000 --- a/0013-src-Uncompress-kernel-on-RISC-V.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 5230e2c3cd07e82bd6431e871e239f7056bf25ad Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -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 - diff --git a/sources b/sources index 98c633b..2def3d0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.3.3.tar.gz) = 39eb687a4e6fbd13d356612f950352848626fe68a14054a62ac7fa1bb3b42be716189b1505bf137331974ea02d75e2e8079f412a133af165cba7767699925f38 -SHA512 (supermin-5.3.3.tar.gz.sig) = e5109e718b06992bde73be913be49cd00358ec835566beb1f207109f54f73dbc6600275e929eb88fea42bda13643ec3ee9bb80032f8a05c37537f28bafb49fad +SHA512 (supermin-5.3.4.tar.gz) = 383d783f57af3a870f1debd3c87929b1d73a12d404c3268640963967a53582419923076410d47e79de0eb2a111fe66a998258e636de41caa3ff7f296b5458797 +SHA512 (supermin-5.3.4.tar.gz.sig) = 1cae330cc4cee6c48e238738a4fd26b31f21f5ffb054b0496d6eebc5e45d0599c2a9586f3e0a9fe25475ab184394bf5d4155a5c5f82b83a380da0994568c8937 diff --git a/supermin.spec b/supermin.spec index 086cf8d..02add2b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -37,8 +37,8 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin -Version: 5.3.3 -Release: 19%{?dist} +Version: 5.3.4 +Release: 1%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -53,29 +53,6 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring -# https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr -Patch: 0001-rpm-New-RPM-database-location-in-usr-lib-sysimage-rp.patch -# OCaml 5 compatibility: -Patch: 0002-Add-support-for-OCaml-5.0.patch -Patch: 0003-Restore-compatibility-with-OCaml-4.07.patch -# dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2209412): -Patch: 0004-rpm-Detect-dnf5-and-omit-missing-options.patch -# dnf5 (https://bugzilla.redhat.com/show_bug.cgi?id=2211386) -Patch: 0005-rpm-Use-dnf-config-instead-of-c.patch -# Fix --if-newer -Patch: 0006-src-Improved-debugging-of-the-supermin-if-newer-calc.patch -Patch: 0007-src-Fix-if-newer-copy-kernel.patch -# Reenable disable_excludes for dnf5 -Patch: 0008-rpm-Reenable-disable_excludes-for-dnf5.patch -# Fix kernel filtering on aarch64 -Patch: 0009-src-format_ext2_kernel.ml-Fix-kernel-filtering-for-a.patch -# Fix bytecode builds so they resist stripping -Patch: 0010-ocamlc-Use-output-complete-exe-instead-of-custom.patch -Patch: 0011-ocamlc-Only-supply-output-complete-exe-to-final-link.patch -# Fix RISC-V gzip compressed kernels -Patch: 0012-src-format_ext2_kernel.ml-Rename-function-file-kerne.patch -Patch: 0013-src-Uncompress-kernel-on-RISC-V.patch - BuildRequires: gcc BuildRequires: make BuildRequires: autoconf, automake @@ -229,6 +206,10 @@ make check || { %changelog +* Thu Jan 11 2023 Richard W.M. Jones - 5.3.4-1 +- New upstream version 5.3.4 +- Remove patches which are now all upstream. + * Mon Dec 18 2023 Richard W.M. Jones - 5.3.3-19 - OCaml 5.1.1 + s390x code gen fix for Fedora 40 From 0c6d8abf1180b99d3a68959dfeae2338ccc46111 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Jan 2024 12:51:13 +0000 Subject: [PATCH 83/95] Fix date in changelog --- supermin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 02add2b..a68c7ec 100644 --- a/supermin.spec +++ b/supermin.spec @@ -206,7 +206,7 @@ make check || { %changelog -* Thu Jan 11 2023 Richard W.M. Jones - 5.3.4-1 +* Thu Jan 11 2024 Richard W.M. Jones - 5.3.4-1 - New upstream version 5.3.4 - Remove patches which are now all upstream. From 836dd0b2295cdd9c3a2744cd9e163ed2c195c466 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 04:46:06 +0000 Subject: [PATCH 84/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index a68c7ec..1ba7048 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -206,6 +206,9 @@ make check || { %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 5.3.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Jan 11 2024 Richard W.M. Jones - 5.3.4-1 - New upstream version 5.3.4 - Remove patches which are now all upstream. From 0ca25557e7296c248e7c406442aef923d309f876 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 29 May 2024 18:11:21 +0100 Subject: [PATCH 85/95] OCaml 5.2.0 for Fedora 41 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 1ba7048..f30495e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -206,6 +206,9 @@ make check || { %changelog +* Wed May 29 2024 Richard W.M. Jones - 5.3.4-3 +- OCaml 5.2.0 for Fedora 41 + * Sat Jan 27 2024 Fedora Release Engineering - 5.3.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 479078fe0c659ce7b36e864eb143baf8275e297e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 19 Jun 2024 13:38:14 +0100 Subject: [PATCH 86/95] OCaml 5.2.0 ppc64le fix --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index f30495e..b1cfa6e 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.4 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -206,6 +206,9 @@ make check || { %changelog +* Wed Jun 19 2024 Richard W.M. Jones - 5.3.4-4 +- OCaml 5.2.0 ppc64le fix + * Wed May 29 2024 Richard W.M. Jones - 5.3.4-3 - OCaml 5.2.0 for Fedora 41 From 50e0475ea7fe924fd536f6bc6adf6c9d77bc05bd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 06:44:22 +0000 Subject: [PATCH 87/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index b1cfa6e..9a69b19 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.4 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -206,6 +206,9 @@ make check || { %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 5.3.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jun 19 2024 Richard W.M. Jones - 5.3.4-4 - OCaml 5.2.0 ppc64le fix From 4a1323f319c0322e63d610af7c054410a201b880 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 31 Aug 2024 10:39:53 +0100 Subject: [PATCH 88/95] New upstream version 5.3.5 --- sources | 4 ++-- supermin.spec | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sources b/sources index 2def3d0..cc31e54 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (supermin-5.3.4.tar.gz) = 383d783f57af3a870f1debd3c87929b1d73a12d404c3268640963967a53582419923076410d47e79de0eb2a111fe66a998258e636de41caa3ff7f296b5458797 -SHA512 (supermin-5.3.4.tar.gz.sig) = 1cae330cc4cee6c48e238738a4fd26b31f21f5ffb054b0496d6eebc5e45d0599c2a9586f3e0a9fe25475ab184394bf5d4155a5c5f82b83a380da0994568c8937 +SHA512 (supermin-5.3.5.tar.gz) = e410bafe06805880f0f701e78d743a6e22e9d25e57bd70a020d583dba6d710ba9917d7afc37be714d9bde410c7ff35f4198300b3af0858d761b0b3e07af58dc0 +SHA512 (supermin-5.3.5.tar.gz.sig) = 88f446c3855367dd8917a6eb44d926f8a09dac9913d9098757951ccb3300f9e3544689a45d661382ae24221f8558bbfc188976f4db288829c28379b87949ed7e diff --git a/supermin.spec b/supermin.spec index 9a69b19..30f7a51 100644 --- a/supermin.spec +++ b/supermin.spec @@ -37,8 +37,8 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin -Version: 5.3.4 -Release: 5%{?dist} +Version: 5.3.5 +Release: 1%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -206,6 +206,9 @@ make check || { %changelog +* Sat Aug 31 2024 Richard W.M. Jones - 5.3.5-1 +- New upstream version 5.3.5 + * Sat Jul 20 2024 Fedora Release Engineering - 5.3.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 42c5e1c3607b6deb8c5a69cbaaa1b1b8c813680c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 21 Oct 2024 14:34:22 +0100 Subject: [PATCH 89/95] Use stable owner, group and mtime in base.tar.gz (RHBZ#2320025) --- ...le-owner-group-and-mtime-in-base.tar.patch | 33 +++++++++++++++++++ supermin.spec | 10 +++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch diff --git a/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch b/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch new file mode 100644 index 0000000..6e70551 --- /dev/null +++ b/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch @@ -0,0 +1,33 @@ +From 7a80a6eec799841b828ba7f617709562d8061435 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 21 Oct 2024 11:55:53 +0100 +Subject: [PATCH] prepare: Use stable owner, group and mtime in base.tar.gz + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025 +Signed-off-by: Richard W.M. Jones +--- + src/mode_prepare.ml | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/mode_prepare.ml b/src/mode_prepare.ml +index 70f9dd4..6af47b1 100644 +--- a/src/mode_prepare.ml ++++ b/src/mode_prepare.ml +@@ -166,9 +166,12 @@ let prepare debug (copy_kernel, format, host_cpu, + let base = outputdir // "base.tar.gz" in + if debug >= 1 then printf "supermin: writing %s\n%!" base; + let cmd = +- sprintf "tar%s -C %s -zcf %s -T %s" ++ let mtime = ++ try sprintf "--mtime=@%s" (quote (Sys.getenv "SOURCE_DATE_EPOCH")) ++ with Not_found -> "" in ++ sprintf "tar%s -C %s -z --owner=0 --group=0 %s -cf %s -T %s" + (if debug >=1 then " -v" else "") +- (quote dir) (quote base) (quote files_from) in ++ (quote dir) mtime (quote base) (quote files_from) in + run_command cmd; + ) + else ( +-- +2.46.0 + diff --git a/supermin.spec b/supermin.spec index 30f7a51..21e015d 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -53,6 +53,11 @@ Source1: http://download.libguestfs.org/supermin/%{source_directory}/%{nam # Keyring used to verify tarball signature. Source2: libguestfs.keyring +# Use stable owner, group and mtime in base.tar.gz +# Upstream in > 5.3.5 +# https://bugzilla.redhat.com/show_bug.cgi?id=2320025 +Patch1: 0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch + BuildRequires: gcc BuildRequires: make BuildRequires: autoconf, automake @@ -206,6 +211,9 @@ make check || { %changelog +* Mon Oct 21 2024 Richard W.M. Jones - 5.3.5-2 +- Use stable owner, group and mtime in base.tar.gz (RHBZ#2320025) + * Sat Aug 31 2024 Richard W.M. Jones - 5.3.5-1 - New upstream version 5.3.5 From 38ee6830fa36b39dc3c804bc505dc110eff81027 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 9 Jan 2025 13:28:26 -0700 Subject: [PATCH 90/95] OCaml 5.3.0 rebuild for Fedora 42 --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 21e015d..6a26a39 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -211,6 +211,9 @@ make check || { %changelog +* Thu Jan 9 2025 Jerry James - 5.3.5-3 +- OCaml 5.3.0 rebuild for Fedora 42 + * Mon Oct 21 2024 Richard W.M. Jones - 5.3.5-2 - Use stable owner, group and mtime in base.tar.gz (RHBZ#2320025) From 1c53902718d952ab457c965e712f4aaef902761a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 11:59:02 +0000 Subject: [PATCH 91/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 6a26a39..0b7c4ed 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -211,6 +211,9 @@ make check || { %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 5.3.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Jan 9 2025 Jerry James - 5.3.5-3 - OCaml 5.3.0 rebuild for Fedora 42 From dfd1c6610dd3fc514e36ec5d7e29e68ef9da0732 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 11 Jul 2025 14:39:10 -0600 Subject: [PATCH 92/95] Rebuild to fix OCaml dependencies --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 0b7c4ed..737900b 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 4%{?dist} +Release: 5%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -211,6 +211,9 @@ make check || { %changelog +* Fri Jul 11 2025 Jerry James - 5.3.5-5 +- Rebuild to fix OCaml dependencies + * Sun Jan 19 2025 Fedora Release Engineering - 5.3.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From dbb5a2fe0e36ccacdf586f2c846094f20d7d5a88 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 18:54:20 +0000 Subject: [PATCH 93/95] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index 737900b..c82cad2 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 5%{?dist} +Release: 6%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -211,6 +211,9 @@ make check || { %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 5.3.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Fri Jul 11 2025 Jerry James - 5.3.5-5 - Rebuild to fix OCaml dependencies From 1ce3d77b47fc8501087121de70cab4733d7d1b38 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Oct 2025 18:50:43 +0100 Subject: [PATCH 94/95] OCaml 5.4.0 rebuild --- supermin.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index c82cad2..a1fe3bb 100644 --- a/supermin.spec +++ b/supermin.spec @@ -38,7 +38,7 @@ ExcludeArch: %{ix86} Summary: Tool for creating supermin appliances Name: supermin Version: 5.3.5 -Release: 6%{?dist} +Release: 7%{?dist} License: GPL-2.0-or-later ExclusiveArch: %{kernel_arches} @@ -211,6 +211,9 @@ make check || { %changelog +* Mon Oct 13 2025 Richard W.M. Jones - 5.3.5-7 +- OCaml 5.4.0 rebuild + * Fri Jul 25 2025 Fedora Release Engineering - 5.3.5-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 809fd5e0a1e395c5ed5e12d7c8eb6ac845587b7b Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 13 Jan 2026 20:49:14 -0700 Subject: [PATCH 95/95] Fix a changelog entry --- supermin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supermin.spec b/supermin.spec index a1fe3bb..ee09a0f 100644 --- a/supermin.spec +++ b/supermin.spec @@ -217,7 +217,7 @@ make check || { * Fri Jul 25 2025 Fedora Release Engineering - 5.3.5-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Fri Jul 11 2025 Jerry James - 5.3.5-5 +* Fri Jul 11 2025 Jerry James - 5.3.5-5 - Rebuild to fix OCaml dependencies * Sun Jan 19 2025 Fedora Release Engineering - 5.3.5-4