From 67f2459173c295296e37c4363aa4e3136aec2db143e645d11a55d2f89291aa5c Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 29 Jul 2024 16:18:34 +0000 Subject: [PATCH] - bsc#1228373 - supermin regression in Tumbleweed / Factory causes virt-inspector to fail add-rpm-database-location.patch - Drop disable-test-if-newer-ext2.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=93 --- .gitattributes | 23 ++ .gitignore | 1 + ...of-the-supermin-if-newer-calculation.patch | 47 ++++ 002-Fix-if-newer-copy-kernel.patch | 33 +++ ...l-filtering-for-aarch64-architecture.patch | 18 ++ ...utput-complete-exe-instead-of-custom.patch | 27 ++ ...ly-output-complete-exe-to-final-link.patch | 36 +++ 006-Rename-function-file-kernel.patch | 29 ++ 007-Uncompress-kernel-on-RISC-V.patch | 66 +++++ ...link-to-renamed-kernel-documentation.patch | 21 ++ 009-New-mailing-list-email-address.patch | 19 ++ add-rpm-database-location.patch | 12 + detect-aarch64-kernel.patch | 32 +++ disable-test-if-newer-ext2.patch | 12 + supermin-5.3.3.tar.gz | 3 + supermin-5.3.3.tar.gz.sig | 17 ++ supermin-5.3.4.tar.gz | 3 + supermin-5.3.4.tar.gz.sig | 17 ++ supermin-kernel_version_compressed.patch | 19 ++ supermin.changes | 254 ++++++++++++++++++ supermin.keyring | Bin 0 -> 2823 bytes supermin.spec | 133 +++++++++ suse_release.patch | 63 +++++ 23 files changed, 885 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 001-Improved-debugging-of-the-supermin-if-newer-calculation.patch create mode 100644 002-Fix-if-newer-copy-kernel.patch create mode 100644 003-Fix-kernel-filtering-for-aarch64-architecture.patch create mode 100644 004-Use-output-complete-exe-instead-of-custom.patch create mode 100644 005-Only-supply-output-complete-exe-to-final-link.patch create mode 100644 006-Rename-function-file-kernel.patch create mode 100644 007-Uncompress-kernel-on-RISC-V.patch create mode 100644 008-Fix-link-to-renamed-kernel-documentation.patch create mode 100644 009-New-mailing-list-email-address.patch create mode 100644 add-rpm-database-location.patch create mode 100644 detect-aarch64-kernel.patch create mode 100644 disable-test-if-newer-ext2.patch create mode 100644 supermin-5.3.3.tar.gz create mode 100644 supermin-5.3.3.tar.gz.sig create mode 100644 supermin-5.3.4.tar.gz create mode 100644 supermin-5.3.4.tar.gz.sig create mode 100644 supermin-kernel_version_compressed.patch create mode 100644 supermin.changes create mode 100644 supermin.keyring create mode 100644 supermin.spec create mode 100644 suse_release.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/001-Improved-debugging-of-the-supermin-if-newer-calculation.patch b/001-Improved-debugging-of-the-supermin-if-newer-calculation.patch new file mode 100644 index 0000000..807194a --- /dev/null +++ b/001-Improved-debugging-of-the-supermin-if-newer-calculation.patch @@ -0,0 +1,47 @@ +Subject: src: Improved debugging of the supermin if-newer calculation +From: Richard W.M. Jones rjones@redhat.com Mon Jun 12 12:51:56 2023 +0100 +Date: Mon Jun 12 12:57:32 2023 +0100: +Git: 8dd37da1b5979842b0db44b44655eeaf621f7ac9 + +Also I expanded the code to make it easier to read. There is no +change to the calculation intended. + +--- a/src/supermin.ml ++++ b/src/supermin.ml +@@ -239,10 +239,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 diff --git a/002-Fix-if-newer-copy-kernel.patch b/002-Fix-if-newer-copy-kernel.patch new file mode 100644 index 0000000..82c4946 --- /dev/null +++ b/002-Fix-if-newer-copy-kernel.patch @@ -0,0 +1,33 @@ +Subject: src: Fix --if-newer --copy-kernel +From: Richard W.M. Jones rjones@redhat.com Mon Jun 12 13:02:37 2023 +0100 +Date: Mon Jun 12 13:07:51 2023 +0100: +Git: 8c38641042e274a713a18daf7fc85584ca0fc9bb + +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 + +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 + ) diff --git a/003-Fix-kernel-filtering-for-aarch64-architecture.patch b/003-Fix-kernel-filtering-for-aarch64-architecture.patch new file mode 100644 index 0000000..b55813d --- /dev/null +++ b/003-Fix-kernel-filtering-for-aarch64-architecture.patch @@ -0,0 +1,18 @@ +Subject: src/format_ext2_kernel.ml: Fix kernel filtering for aarch64 architecture +From: Simon Fischer 1522981+Fischer-Simon@users.noreply.github.com Wed Jul 12 17:10:53 2023 +0200 +Date: Wed Jul 12 17:10:53 2023 +0200: +Git: 4b3922feb65150f3423d0877038c5ba6e16d910c + +Add appropriate globs for arm based kernels. The file names end in -arm64 but the architecture is named aarch64. +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] diff --git a/004-Use-output-complete-exe-instead-of-custom.patch b/004-Use-output-complete-exe-instead-of-custom.patch new file mode 100644 index 0000000..bf1e18b --- /dev/null +++ b/004-Use-output-complete-exe-instead-of-custom.patch @@ -0,0 +1,27 @@ +Subject: ocamlc: Use -output-complete-exe instead of -custom +From: Richard W.M. Jones rjones@redhat.com Wed Jul 12 22:37:58 2023 +0100 +Date: Wed Jul 12 22:40:27 2023 +0100: +Git: dc80dbbef60d5d81a7d4321683a8c7305dc04972 + +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. + +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 diff --git a/005-Only-supply-output-complete-exe-to-final-link.patch b/005-Only-supply-output-complete-exe-to-final-link.patch new file mode 100644 index 0000000..85450e7 --- /dev/null +++ b/005-Only-supply-output-complete-exe-to-final-link.patch @@ -0,0 +1,36 @@ +Subject: ocamlc: Only supply -output-complete-exe to final link +From: Richard W.M. Jones rjones@redhat.com Wed Jul 12 22:51:43 2023 +0100 +Date: Wed Jul 12 22:51:43 2023 +0100: +Git: 59a8ffc40db94a38879d9c923520e0bd70ffa271 + +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 + +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: diff --git a/006-Rename-function-file-kernel.patch b/006-Rename-function-file-kernel.patch new file mode 100644 index 0000000..d1eed8a --- /dev/null +++ b/006-Rename-function-file-kernel.patch @@ -0,0 +1,29 @@ +Subject: src/format_ext2_kernel.ml: Rename function file -> kernel +From: Richard W.M. Jones rjones@redhat.com Fri Nov 10 08:55:25 2023 +0000 +Date: Fri Nov 10 08:55:25 2023 +0000: +Git: 9a0d078dc35fde7a715666bce6c765ed5fe5e916 + +No change, just rename the function. + +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 ( diff --git a/007-Uncompress-kernel-on-RISC-V.patch b/007-Uncompress-kernel-on-RISC-V.patch new file mode 100644 index 0000000..9641197 --- /dev/null +++ b/007-Uncompress-kernel-on-RISC-V.patch @@ -0,0 +1,66 @@ +Subject: src: Uncompress kernel on RISC-V +From: Richard W.M. Jones rjones@redhat.com Fri Nov 10 10:20:49 2023 +0000 +Date: Fri Nov 10 10:28:21 2023 +0000: +Git: 5230e2c3cd07e82bd6431e871e239f7056bf25ad + + +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 diff --git a/008-Fix-link-to-renamed-kernel-documentation.patch b/008-Fix-link-to-renamed-kernel-documentation.patch new file mode 100644 index 0000000..720fa65 --- /dev/null +++ b/008-Fix-link-to-renamed-kernel-documentation.patch @@ -0,0 +1,21 @@ +Subject: init: Fix link to renamed kernel documentation +From: Richard W.M. Jones rjones@redhat.com Mon Nov 13 10:13:26 2023 +0000 +Date: Mon Nov 13 10:13:26 2023 +0000: +Git: c8e79b7d62730f850f9e5d46c3747f414198b902 + + +diff --git a/init/init.c b/init/init.c +index bc28c69..4cc72f7 100644 +--- a/init/init.c ++++ b/init/init.c +@@ -279,8 +279,8 @@ main () + fprintf (stderr, "supermin: deleting initramfs files\n"); + delete_initramfs_files (); + +- /* Note that pivot_root won't work. See the note in +- * Documentation/filesystems/ramfs-rootfs-initramfs.txt ++ /* Note that pivot_root won't work. See the note in Linux ++ * Documentation/filesystems/ramfs-rootfs-initramfs.rst + */ + if (!quiet) + fprintf (stderr, "supermin: chroot\n"); diff --git a/009-New-mailing-list-email-address.patch b/009-New-mailing-list-email-address.patch new file mode 100644 index 0000000..3033115 --- /dev/null +++ b/009-New-mailing-list-email-address.patch @@ -0,0 +1,19 @@ +Subject: New mailing list email address +From: Richard W.M. Jones rjones@redhat.com Thu Nov 16 10:43:11 2023 +0000 +Date: Thu Nov 16 10:43:11 2023 +0000: +Git: 7e4f0931e1ee47c7fbe7e1a9917fff68a18d9235 + + +diff --git a/README b/README +index a74993b..fe298b4 100644 +--- a/README ++++ b/README +@@ -143,7 +143,7 @@ See the examples/ subdirectory. + Feedback and bugs + ----------------- + +-Send feedback to libguestfs@redhat.com. You can file bugs in ++Send feedback to guestfs@lists.libguestfs.org. You can file bugs in + https://bugzilla.redhat.com/ (under "Fedora", "supermin") + + Alternate libc diff --git a/add-rpm-database-location.patch b/add-rpm-database-location.patch new file mode 100644 index 0000000..0654c78 --- /dev/null +++ b/add-rpm-database-location.patch @@ -0,0 +1,12 @@ +References: bsc#1228373 + +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -239,6 +239,7 @@ let rpm_package_name pkg = + rpm.name + + let rpmdb_locations = [ ++ "/usr/lib/sysimage/rpm/Packages.db"; + "/usr/lib/sysimage/rpm/rpmdb.sqlite"; + "/var/lib/rpm/rpmdb.sqlite"; + "/var/lib/rpm/Packages" diff --git a/detect-aarch64-kernel.patch b/detect-aarch64-kernel.patch new file mode 100644 index 0000000..8c7f9c5 --- /dev/null +++ b/detect-aarch64-kernel.patch @@ -0,0 +1,32 @@ +References: bsc#1187532 - virt-make-fs hangs forever + +Index: supermin-5.3.3/src/format_ext2_kernel.ml +=================================================================== +--- supermin-5.3.3.orig/src/format_ext2_kernel.ml ++++ supermin-5.3.3/src/format_ext2_kernel.ml +@@ -155,7 +155,7 @@ and find_kernel_from_boot debug host_cpu + if files <> [] then files + else ( + (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) +- let files = files_matching_globs ["vmlinu?-*"] all_files in ++ let files = files_matching_globs ["vmlinu?-*"; "Image-*"] all_files in + let files = ignore_unbootable_kernels host_cpu files in + files + ) in +@@ -262,9 +262,14 @@ and get_kernel_version debug kernel_file + else ( + basename + ) in +- if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename ++ if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename || string_prefix "Image-" basename + then ( +- let version = String.sub basename 8 (String.length basename - 8) in ++ let version = ++ if string_prefix "Image-" basename then ( ++ String.sub basename 6 (String.length basename - 6) ++ ) else ( ++ String.sub basename 8 (String.length basename - 8) ++ ) in + (* Does the version look reasonable? *) + let modpath = "/lib/modules" // version in + if has_modpath modpath then ( diff --git a/disable-test-if-newer-ext2.patch b/disable-test-if-newer-ext2.patch new file mode 100644 index 0000000..c661e59 --- /dev/null +++ b/disable-test-if-newer-ext2.patch @@ -0,0 +1,12 @@ +--- supermin-5.3.4/tests/Makefile.am.orig 2024-07-12 09:00:00.700673571 -0600 ++++ supermin-5.3.4/tests/Makefile.am 2024-07-12 09:00:14.828673908 -0600 +@@ -28,8 +28,7 @@ TESTS = \ + test-execstack.sh \ + test-build-bash.sh \ + test-binaries-exist.sh \ +- test-harder.sh \ +- test-if-newer-ext2.sh ++ test-harder.sh + + if NETWORK_TESTS + TESTS += \ diff --git a/supermin-5.3.3.tar.gz b/supermin-5.3.3.tar.gz new file mode 100644 index 0000000..924212e --- /dev/null +++ b/supermin-5.3.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88948d515a9b34285f9f5ae0158c808061b6ec319ad04a21ad7df7c8cbe2102d +size 225485 diff --git a/supermin-5.3.3.tar.gz.sig b/supermin-5.3.3.tar.gz.sig new file mode 100644 index 0000000..9529931 --- /dev/null +++ b/supermin-5.3.3.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmNOrGARHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKAgHA/9EFGRdvIryS5UUcXz9yvaYs5WvMtuPn9s +Dcb7lVwLsMkVpcMulOyN1sPTI4WkgqKeXSvSJXfby/Loon8p8aTlSDZkEhivMpDG +TliKX5P8kySC+9KXSKfzHyVwKd6j/pmLtw3QvpgwuZPYdkIHzVluWKd1ql6nbLh/ +LsSg2YNyJi48i/W64xEGN0ENviYMmHoNnE56nFEApwHfG26j5bHvLZJqjFYS5ClF +CJtoaAOEEAySbJmbKTxCByk44CxjfpUHHwupJ+QKoXIJmYFVAQO2jrW3zvR7zRyI +rA1Woaqmft3PDszH9565AD34FFmXQ70+GOanO7tH1uk0wgK+lgpZpb0UMzcNBSPh +6cU4wY4nvxww39HdGLQ95au54Lp4I90S8MGrtO7XD0N2fA6QlbcSMnpM3LM4CZDi +g7SUeqWy6PRoqd6vEvO9MgAOIg/YbcnRCFZsUe2na04FvKI0jWFwor1Xm0RJIQrf +ufpLjKG1hpjbQa0Hu0RISVKBMMnLfCg3Z5xMWq0mVysdGrJzWrTqYT5Os8KOU+04 +0Ni1DWw+o3CNacTVmOroRvsUYPzQiivutNgPovRaVIL4u6OwWw+tUtxRCpZlxzc/ +m00IGHLgKwdbHTShRqzp6P2QcuXS7SGv9EqNL7yJL3kvc5INp4XJ3QHDdpO2hz5S +10cJfC6ph1o= +=FSUE +-----END PGP SIGNATURE----- diff --git a/supermin-5.3.4.tar.gz b/supermin-5.3.4.tar.gz new file mode 100644 index 0000000..e4a9442 --- /dev/null +++ b/supermin-5.3.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc0322991bea1fcc6355518474b39e2d4a341f1e2c36fd98f14c3446ef79ff70 +size 226468 diff --git a/supermin-5.3.4.tar.gz.sig b/supermin-5.3.4.tar.gz.sig new file mode 100644 index 0000000..941915e --- /dev/null +++ b/supermin-5.3.4.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmWf3ZIRHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKA6YBAApKMian3rGdXB4NDYC4lluPhDPKhlVYax +hVZGuhqFXnTIzH0djjiKKe1jkPCPjDzCfp8OIFdgzj4HUaHI2N5gUeBHINa7HJi/ +AlsR33v+Wgw82I/oiEZiwAyDP+gX29M6j7tQnJEo8yj+sSOWEWp/sKTi6u1v/Za0 +N7DkRFf2mLeOo/W2MPkkA9YtUbjr/TzJBVv1OSo1ufOH9yZI+fx9B5lO1NMojcsG +Km34sCzx0exv9DzkSOzhzMox7fCmBMpUDrx12Z1LX416dLMiiHVBc7SeTDTz8rPu +jwRzF7WJpkAJxCKQc7vwNQb+XOGOh8SoEhwqMeGc/96y/IGf0h67Cz8TEm2DSdcq +AvfaHlzsRObO9ZfeBPe5IdUMgZWBrAUD4jg4bWZVn0Fk9ibEZmaNNxY9Aa0nGCJc +tjj7tzmriwYI7Rfu3jP9DmBH6CBaXd54eMxQMgZGaqJi2ad7aVWDTbTKKk5bgfhw +bzplpnklIFomGwh4T7EkmiJiDbHlUEAGnulH6eQb26DCnzhQvaqo6J1/QA/XSK0L +PzrzcW8n2gRmzdxKZhXd2TxYkcbZYSeUuf0z0TfZijLn+lz5hM8sNdTHnoU1p60h +cuO3835oNI+j+4HdHhqPnjM9lurnPmIEb1b9bugQrP5PxrXTEADyNccwWZbAOKur +fOgPyWyATTA= +=2lcO +-----END PGP SIGNATURE----- diff --git a/supermin-kernel_version_compressed.patch b/supermin-kernel_version_compressed.patch new file mode 100644 index 0000000..c8137ea --- /dev/null +++ b/supermin-kernel_version_compressed.patch @@ -0,0 +1,19 @@ +--- a/src/format_ext2_kernel.ml ++++ b/src/format_ext2_kernel.ml +@@ -252,6 +252,16 @@ and get_kernel_version debug kernel_file + | None -> + (* Try to work it out from the filename instead. *) + let basename = Filename.basename kernel_file in ++ let basename = ++ let len = String.length basename in ++ if Filename.check_suffix basename ".xz" || Filename.check_suffix basename ".gz" ++ then ( ++ let basename = String.sub basename 0 (len-3) in ++ basename ++ ) ++ else ( ++ basename ++ ) in + if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename + then ( + let version = String.sub basename 8 (String.length basename - 8) in diff --git a/supermin.changes b/supermin.changes new file mode 100644 index 0000000..2cfe7a9 --- /dev/null +++ b/supermin.changes @@ -0,0 +1,254 @@ +------------------------------------------------------------------- +Mon Jul 29 10:16:35 MDT 2024 - carnold@suse.com + +- bsc#1228373 - supermin regression in Tumbleweed / Factory causes + virt-inspector to fail + add-rpm-database-location.patch +- Drop disable-test-if-newer-ext2.patch + +------------------------------------------------------------------- +Wed Jul 10 15:34:55 MDT 2024 - carnold@suse.com + +- Update to version 5.3.4 (jsc#PED-6305) + * Add support for OCaml 5 + * Add kylinsecos support + * rpm: Detect dnf5 and omit missing options + * ocamlc: Use -output-complete-exe instead of -custom + * Fix kernel filtering for aarch64 architecture + * Uncompress kernel on RISC-V +- Drop patches contained in new tarball + 001-Improved-debugging-of-the-supermin-if-newer-calculation.patch + 002-Fix-if-newer-copy-kernel.patch + 003-Fix-kernel-filtering-for-aarch64-architecture.patch + 004-Use-output-complete-exe-instead-of-custom.patch + 005-Only-supply-output-complete-exe-to-final-link.patch + 006-Rename-function-file-kernel.patch + 007-Uncompress-kernel-on-RISC-V.patch + 008-Fix-link-to-renamed-kernel-documentation.patch + 009-New-mailing-list-email-address.patch + +------------------------------------------------------------------- +Mon May 6 15:27:43 MDT 2024 - carnold@suse.com + +- Supermin uses mke2fs. Add Requires e2fsprogs for this command. + supermin.spec + +------------------------------------------------------------------- +Thu Jan 4 11:07:03 MST 2024 - carnold@suse.com + +- Update to version 5.3.3 (jsc#PED-6305) + * initrd: Support ztd-compressed modules + * pacman: Recognise Artix, an Arch derivative + * Add a separate variable to store link flags, and use that to + supply + * Add appropriate globs for arm based kernels. The file names end + in -arm64 but the architecture is named aarch64. + * Add support for OCaml 5.0 + * Add LFS support for fts functions + * Numerous bug fixes +- Upstream bug fixes and features + 001-Improved-debugging-of-the-supermin-if-newer-calculation.patch + 002-Fix-if-newer-copy-kernel.patch + 003-Fix-kernel-filtering-for-aarch64-architecture.patch + 004-Use-output-complete-exe-instead-of-custom.patch + 005-Only-supply-output-complete-exe-to-final-link.patch + 006-Rename-function-file-kernel.patch + 007-Uncompress-kernel-on-RISC-V.patch + 008-Fix-link-to-renamed-kernel-documentation.patch + 009-New-mailing-list-email-address.patch +- Dropped initrd_support_ztd-compressed_modules.patch + +------------------------------------------------------------------- +Tue Dec 27 15:59:57 UTC 2022 - Andreas Schwab + +- Enable build on riscv64 + +------------------------------------------------------------------- +Fri Dec 9 09:22:50 UTC 2022 - Thorsten Kukuk + +- Include sysconfig-netconfig only until SLE15, newer versions + don't use it anymore [jsc#PED-1734] + +------------------------------------------------------------------- +Tue Oct 4 14:00:46 MDT 2022 - carnold@suse.com + +- jsc#PED-2113 [Virt Tools] Refresh Virtualization Tools for Xen + and KVM Management + +------------------------------------------------------------------- +Mon Apr 25 13:03:38 MDT 2022 - carnold@suse.com + +- Update to 5.2.2 bug fix release + * Open Unix.LargeFile to avoid "lstat: Value too large for + defined data type" + * pacman: Skip over detached signatures when unpacking + * ext2, rpm: Don't redefine Val_none or Some_val. + * Don't attempt to build man page if perldoc is not available + * Ignore zfcpdump kernel on s390x + * Ignore unbootable kernels in /lib/modules + * Ignore debug kernels + * maintainer: Add our usual maintainer rules +- Drop + Avoid-lstat-Value-too-large-for-defined-data-type.patch + +------------------------------------------------------------------- +Mon Mar 7 14:54:48 MST 2022 - carnold@suse.com + +- bsc#1187532 - virt-make-fs hangs forever + detect-aarch64-kernel.patch + +------------------------------------------------------------------- +Tue Dec 21 15:33:22 UTC 2021 - BenoƮt Monin + +- Add initrd_support_ztd-compressed_modules.patch: + backport of 4306a131c6cd to add support of zstd compressed kernel + modules. + +------------------------------------------------------------------- +Sun Sep 12 10:20:30 UTC 2021 - ohering@suse.de + +- Restore ExclusiveArch, continue to follow libguestfs + The 'almost' below is the reason. + +------------------------------------------------------------------- +Thu Sep 9 19:19:19 UTC 2021 - ohering@suse.de + +- arm32 may have a kernel named /boot/zImage + +------------------------------------------------------------------- +Thu Sep 9 11:38:07 UTC 2021 - Jan Engelhardt + +- Remove arch exclusion, almost all of them build. + +------------------------------------------------------------------- +Tue Aug 31 08:08:08 UTC 2021 - ohering@suse.de + +- s390x may have a kernel named /boot/image + +------------------------------------------------------------------- +Wed Aug 25 08:48:22 MDT 2021 - carnold@suse.com + +- Update to 5.2.1 bug fix release. Include post 5.2.1 upstream fix. + Avoid-lstat-Value-too-large-for-defined-data-type.patch + disable-test-if-newer-ext2.patch + +------------------------------------------------------------------- +Thu Apr 1 13:56:13 UTC 2021 - Andreas Schwab + +- Fix typo risc64 -> riscv64 + +------------------------------------------------------------------- +Fri Feb 5 16:59:34 CET 2021 - ro@suse.de + +- add patch supermin-kernel_version_compressed.patch + find kernel module path even for compressed kernels + like on aarch64 and s390x (bsc#1182112, bsc#1138258) + +------------------------------------------------------------------- +Fri Oct 23 18:45:45 UTC 2020 - Dirk Mueller + +- update to 5.2.0: + * rpm: extend the Multiple_matches exception + * Use external command mv to rename old output directory (RHBZ#1670191). + * rpm: do not unpack parameters + * rpm: fix version comparison + * rpm: provide a dummy supermin_rpm_get_arch implementation + * ext2: Build symbolic links correctly (RHBZ#1770304). + * Update gnulib to latest. +- switch to release tarball, use keyring for gpg validation +- run tests + +------------------------------------------------------------------- +Fri Nov 1 12:34:56 UTC 2019 - ohering@suse.de + +- Update to version 5.1.20, via _service file + No changelog provided by upstream + +------------------------------------------------------------------- +Wed Jul 31 16:52:14 UTC 2019 - Larry Dewey + +- Adding sysconfig-netconfig to list of required dependencie + (BSC#136878) + +------------------------------------------------------------------- +Tue May 7 14:49:41 UTC 2019 - Larry Dewey + +- Added tar as software dependency. + (BSC#1134334) + +------------------------------------------------------------------- +Thu Aug 31 14:09:58 UTC 2017 - cbosdonnat@suse.com + +- Distro detection: also use ID_LIKE to catch suse distros + add patch: suse_release.patch + +------------------------------------------------------------------- +Thu Jul 13 14:17:07 UTC 2017 - cbosdonnat@suse.com + +- Update to version 5.1.18 + +------------------------------------------------------------------- +Tue May 30 13:45:27 UTC 2017 - olaf@aepfle.de + +- Update to version 5.1.17 + remove 0001-add_simple_handling_of_os-release.patch + remove 0002-use_os-release_to_detect_the_distro.patch + remove 0003-tests_use__etc_os-release_in_test-harder.patch + +------------------------------------------------------------------- +Thu Sep 8 15:01:41 UTC 2016 - cbosdonnat@suse.com + +- Remove use of SuSE-release and use os-release instead. (bsc#997936) + 0001-add_simple_handling_of_os-release.patch + 0002-use_os-release_to_detect_the_distro.patch + 0003-tests_use__etc_os-release_in_test-harder.patch + +------------------------------------------------------------------- +Thu May 26 09:24:57 UTC 2016 - cbosdonnat@suse.com + +- fate#316274 + +------------------------------------------------------------------- +Wed May 25 14:26:48 UTC 2016 - olaf@aepfle.de + +- Preserve bytecode + +------------------------------------------------------------------- +Fri Oct 23 15:16:31 UTC 2015 - olaf@aepfle.de + +- Update to version 5.1.13 + +------------------------------------------------------------------- +Mon Oct 20 10:08:25 UTC 2014 - ohering@suse.com + +- Update to version 5.1.10 + +------------------------------------------------------------------- +Tue May 13 15:54:34 CEST 2014 - ohering@suse.de + +- Update to version 5.1.8 + +------------------------------------------------------------------- +Mon Aug 19 18:58:20 CEST 2013 - ohering@suse.de + +- Update to version 4.1.3 + +------------------------------------------------------------------- +Tue Jun 4 16:59:21 CEST 2013 - ohering@suse.de + +- zypp: Only compile zypper support if OCaml inifiles module is found. +- zypp: Trailing whitespace. +- Handle --packager-config in zypp_rpm +- helper: Add a note that cpio might not be able to read -f cpio files. +- helper: Add megaraid drivers to the initrd. + +------------------------------------------------------------------- +Tue Apr 9 19:21:47 CEST 2013 - ohering@suse.de + +- add changes to support zypper + +------------------------------------------------------------------- +Sat Mar 9 17:44:29 CET 2013 - ohering@suse.de + +- initial package version 4.1.1 + diff --git a/supermin.keyring b/supermin.keyring new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..fc15a241c7f4d90d6eb0075e0628fec19a29608a07e1498a163819af0d0e729c GIT binary patch literal 2823 zcma*oXEYm(0><$qB7$nPViakqqNG)u+FR_sQdc{DRukabMCqKo^wCkug~Y-bN=ZdDzIiUZ#$40(0^!V6(C-KH79?s=m3cGghyAo z1|dJMm+eiM>Vb)QYy4I#;Xu&Z^B~&YVZ!Whl6YA`T0fY9jOhHw z+Y;*35;Jx(8F=n(3o5j*bNOr3S) zCOp0NiMsuh^>)x<=&*u##pa25u9;{ZZc=y@%)4CE$a$A}A*UQGOC-D04;}dULUfuV z)^qc0R62lhwbK5pAcC9hk{LK2KJQ&jd|seog-6NxEVm_4X)8y7DYjWwHK2eI$lRku zmeq4z0zkjTs4a++z4bu{k^$N0>0MkG^k~>}tQQd>eap=1)cK}mGM_yYhtaPw3u{n! zU9d7X%GZbXT!~-iaePA-_ZF&Sz{>(|!tON<`4C)es{n-Uesd{GoD$><>+YS*e%6$X zv}81ZQEu&BDa*m|%?xc}K? ztXy1dUpQFtxVqa*MT11aG(ZsGE-C15Js>6$2qig`j06Osg@VW_D8Y0f5+LX{5JVpY zpdhDC^oaLZsK??x8DJOWJSw`FnKV|{5~fVJ%k`yWLJxgLVDcRdn^Wa_F@huK2}*V{VwcRgyv*)4g2Qgt1JGlabiOx*7Fj?B<+5~s41Ba znTns*;eGgN*mTv0;L>wfxeCI*{K-s;9kSV!?`oEYYHR#>`F5iO`ZuDJL%yslOO9&w zhbbHM^ngdugCnWhKqq{uTHT9qS(fk}s?L44SS*-LzWFNMdJ_cZV+Pj}Fc0 z$z?*yD| z^ee!4Z%nhXNm_MKw>GfR!|#AT7wI=d8;#FBd0Dn`;z*2sFEnNL=50xc+d7>-sr4hc z1H^ZFsD|Tz3VZsuG#PhW4A#n%$Hvw9zllAj{C|nDDp3Q9IoOo59u_f15UB-d(i^Ft zm}W~GSou3Y2Zae}aUVFWKJ)XZ-FcZ)f7}5VNSmEBezlPwny+1V!c|G1q2)yJu^>SU zBG(uFdMTFhV(LalnV(s$P>l{I_IXET&d9&(TxDa{R*NCzcuMf&q78elSLN9YIaoM7X!j3`9@_C^pJ@OJh;qD77 z`}&Nz_D*Iq6f;t7?Bqxowet8!npZ$`6NXiVD@~AY_g*>B){{F>D1? zN$g|68|pA_wcr~kt)JAUlnukx>iU8KA)f_4{X1&=@-!^E^P8QCNsCiKiUK_F>Xsli+q$Z*{a2b32CMwb3D{%D_`*E!rm9<3xmVE)l89dYVw5nlryxm zap55S(@vrBI7zH^ydCt_O(Ugr9>qJgQm;i{)`fD?)7n|Jj)=c?=qu9x3%|TVwl?!x z?-#a4>J7h7(TrYP9;;VFFnL~q)11l=W{2zM0PM_#^G-;w9~Y(6gf0(xy$5NJB{8G) z2_PZQC}tF@|I|RCJ_Ct6H6l-=E50j$d5Ku9&`{QVe8Z;T+VX2372^TDbVX-o_tL$y zfM36H?e10e)+AoUd;Ar?$c*rS7DBr*maRLN9n|78-|^BE1bP6RW%uVWO+Eh#-^#2q zU1o2OGeEnJe`vc1&bKa=PK5K>MrUoy*4Di*xQ~Hr8YK=ae$S@5;A6m-C*^N>H6QiE z+Z~%eGDDNK_vktjC^nxMUEXZReG3G^_uml$%lONCD~B)o&u@Ar}fQG5;T#E%^U88SI<&z@~yy|THGE%E1PbI z?F^r&ZTiw{?xi@{*DAy6C4z2C)^HACOJ!QTq)OKNiy$F_ao^+$ziBa!`o*phmK_>s za)NY_nGb%M+@h1zb zdfh2x>9W=SlC19X_yB5T8jPIITr(IuajP65y|~iU>niq=mN|NI*0)B&ixQw`dlhcIFP)G9WnV`}K3C{4m}cRO<&1vJ^K5DAVUo*Z<@ zunwMvxU0NO;ORRnw0-LRLg3}q^7?BlO`eOGFQ3pD@ literal 0 HcmV?d00001 diff --git a/supermin.spec b/supermin.spec new file mode 100644 index 0000000..91b30de --- /dev/null +++ b/supermin.spec @@ -0,0 +1,133 @@ +# +# spec file for package supermin +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: supermin +Version: 5.3.4 +Release: 0 +Summary: Bootstrapping tool for creating supermin appliances +License: GPL-3.0-or-later +Group: System/Filesystems +URL: https://libguestfs.org/ +Source0: https://download.libguestfs.org/supermin/5.3-development/supermin-5.3.4.tar.gz +Source1: https://download.libguestfs.org/supermin/5.3-development/supermin-5.3.4.tar.gz.sig +Source9: supermin.keyring +Patch30: suse_release.patch +Patch31: supermin-kernel_version_compressed.patch +Patch32: detect-aarch64-kernel.patch +Patch33: add-rpm-database-location.patch +BuildRequires: augeas +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: distribution-release +BuildRequires: e2fsprogs +BuildRequires: glibc-devel-static +BuildRequires: gzip +BuildRequires: hivex +BuildRequires: kernel-default +BuildRequires: ncurses-devel +BuildRequires: ocaml +BuildRequires: ocaml-findlib +BuildRequires: ocaml-rpm-macros >= 4.02.1 +BuildRequires: pkgconfig +BuildRequires: xz +BuildRequires: xz-devel +BuildRequires: zlib-devel +BuildRequires: zstd +BuildRequires: zypper +BuildRequires: pkgconfig(com_err) +BuildRequires: pkgconfig(ext2fs) +BuildRequires: pkgconfig(rpm) +Requires: distribution-release +Requires: e2fsprogs +%if 0%{?suse_version} < 1599 +Requires: sysconfig-netconfig +%endif +Requires: tar +Requires: xmlstarlet +Requires: zypper +Provides: febootstrap +%{?ocaml_preserve_bytecode} +# this must follow libguestfs, which is the only consumer of this pkg +ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64 riscv64 + +%description +supermin is a tool for building supermin appliances. These are tiny +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. + +%prep +%autosetup -p1 + +%build +export ZYPPER=zypper +export ZYPPER=%{_bindir}/zypper +touch INSTALL NEWS AUTHORS ChangeLog +#.gnulib/gnulib-tool --update +autoreconf -fi +%configure --help +%configure --disable-network-tests +%make_build \ + %{?_smp_mflags} + +%install +%make_install +find %{buildroot} -ls + +%check +ls -alt /boot /lib/modules || : +ls -altd /lib/modules/*/* || : + +for i in /boot/image* /boot/Image* /boot/vmlinu* /boot/zImage* +do + test -f "$i" || continue + if get_kernel_version "${i}" > $$ + then + if test -s $$ + then + read SUPERMIN_KERNEL_VERSION < $$ + export "SUPERMIN_KERNEL=$i" + export "SUPERMIN_KERNEL_VERSION=$SUPERMIN_KERNEL_VERSION" + export "SUPERMIN_MODULES=/lib/modules/${SUPERMIN_KERNEL_VERSION}" + break + fi + fi +done +rm -fv $$ +test -n "${SUPERMIN_KERNEL}" +test -n "${SUPERMIN_KERNEL_VERSION}" +test -d "${SUPERMIN_MODULES}" +%ifnarch s390x +if make check +then + rc=0 +else + : rc $? + rc=1 +fi +cat tests/test-suite.log +exit ${rc} +%endif + +%files +%doc README +%doc TODO +%{_bindir}/* +%{_mandir}/*/* + +%changelog diff --git a/suse_release.patch b/suse_release.patch new file mode 100644 index 0000000..38d89a7 --- /dev/null +++ b/suse_release.patch @@ -0,0 +1,63 @@ +--- a/src/os_release.ml ++++ b/src/os_release.ml +@@ -29,6 +29,7 @@ let split sep str = + + type os_release = { + id : string; ++ id_like : string list; + } + + let data = ref None +@@ -52,6 +53,7 @@ and parse () = + let lines = List.filter (fun s -> s.[0] <> '#') lines in + + let id = ref "" in ++ let id_like = ref [] in + + List.iter ( + fun line -> +@@ -65,10 +67,11 @@ and parse () = + else value in + match field with + | "ID" -> id := value ++ | "ID_LIKE" -> id_like := string_split " " value + | _ -> () + ) lines; + +- Some { id = !id; } ++ Some { id = !id; id_like = !id_like } + ) else + None + +@@ -76,3 +79,8 @@ let get_id () = + match get_data () with + | None -> "" + | Some d -> d.id ++ ++let get_id_like () = ++ match get_data () with ++ | None -> [] ++ | Some d -> d.id_like +--- a/src/os_release.mli ++++ b/src/os_release.mli +@@ -24,3 +24,10 @@ val get_id : unit -> string + + An empty string is returned if the file does not exist or cannot + be read. *) ++ ++val get_id_like : unit -> string list ++(** Get the value of the "ID_LIKE" field from the /etc/os-release file ++ on the current system. ++ ++ An empty list is returned if the file does not exist, cannot ++ be read or the ID_LIKE field is not defined. *) +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -46,6 +46,7 @@ let opensuse_detect () = + Config.zypper <> "no" && + (List.mem (Os_release.get_id ()) [ "sled"; "sles" ] || + string_prefix "opensuse" (Os_release.get_id ()) || ++ List.mem "suse" (Os_release.get_id_like ()) || + try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false) + + let mageia_detect () =