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] 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