From e13f1165c63b6cd719d9c9776cd2822a5de23187 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 11:47:32 +0000 Subject: [PATCH 01/64] - 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 02/64] 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 03/64] 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 04/64] 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 05/64] 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 06/64] 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 07/64] - 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 08/64] 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 09/64] 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 10/64] 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 11/64] 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 12/64] 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 13/64] 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 14/64] - 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 15/64] 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 16/64] 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 17/64] 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 18/64] 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 19/64] - 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 20/64] 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 21/64] 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 22/64] 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 23/64] 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 24/64] 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 25/64] 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 26/64] 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 27/64] 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 28/64] 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 29/64] 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 30/64] 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 31/64] 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 32/64] 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 33/64] 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 34/64] 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 35/64] 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 36/64] 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 37/64] 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 38/64] 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 39/64] 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 40/64] 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 41/64] 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 42/64] 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 43/64] 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 44/64] 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 45/64] 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 46/64] 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 47/64] 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 48/64] 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 49/64] 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 50/64] 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 51/64] 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 52/64] 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 53/64] 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 54/64] 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 55/64] 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 56/64] 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 57/64] 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 58/64] 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 59/64] 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 60/64] 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 61/64] 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 62/64] 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 63/64] 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 64/64] 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