diff --git a/0018-lib-Print-kernel-utsname-in-debug-output.patch b/0018-lib-Print-kernel-utsname-in-debug-output.patch new file mode 100644 index 0000000..001dfeb --- /dev/null +++ b/0018-lib-Print-kernel-utsname-in-debug-output.patch @@ -0,0 +1,45 @@ +From 19c4d1c8b9f278e054594660b5392d6c08a59d8f Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 10 Mar 2025 18:52:08 +0000 +Subject: [PATCH] lib: Print kernel utsname in debug output + +Useful for debugging problems caused by the host kernel. In +particular we were looking at a problem with passt creating a user +namespace but didn't know what exact kernel was being used. + +(cherry picked from commit 31fa712aa07190f2c5ed789712b92b4be2d51488) +--- + lib/launch.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/lib/launch.c b/lib/launch.c +index b9b76e50..9c44612d 100644 +--- a/lib/launch.c ++++ b/lib/launch.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -93,6 +94,7 @@ guestfs_impl_launch (guestfs_h *g) + struct backend *b; + CLEANUP_FREE char *backend = guestfs_get_backend (g); + int mask; ++ struct utsname utsname; + + debug (g, "launch: program=%s", g->program); + if (STRNEQ (g->identifier, "")) +@@ -109,6 +111,10 @@ guestfs_impl_launch (guestfs_h *g) + if (mask >= 0) + debug (g, "launch: umask=0%03o", (unsigned) mask); + debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); ++ if (uname (&utsname) == 0) ++ debug (g, "launch: host: %s %s %s %s %s", ++ utsname.sysname, utsname.nodename, utsname.release, ++ utsname.version, utsname.machine); + } + + /* Launch the appliance. */ diff --git a/0019-daemon-Fix-loongarch64-detection-on-RHEL-9.patch b/0019-daemon-Fix-loongarch64-detection-on-RHEL-9.patch new file mode 100644 index 0000000..0f9caed --- /dev/null +++ b/0019-daemon-Fix-loongarch64-detection-on-RHEL-9.patch @@ -0,0 +1,29 @@ +From fa1c16528267c89de8a2ecebd44405cbd04fa0ee Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 11 Mar 2025 13:36:12 +0000 +Subject: [PATCH] daemon: Fix loongarch64 detection on RHEL 9 + +$ rpm -q file +file-5.39-16.el9.x86_64 +$ file ./test-data/binaries/bin-loongarch64-dynamic +./test-data/binaries/bin-loongarch64-dynamic: ELF 64-bit LSB pie executable, *unknown arch 0x102* version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, BuildID[sha1]=7622a1a70bf6e697851ac3790557e1ca686459b5, for GNU/Linux 5.19.0, stripped + +Updates: commit 729d6d55ea84494f0398d02450bd29c39c55f0bd +(cherry picked from commit 4176b2043f6cf65f8f5f4f7d6fa39beb9c0a22c6) +--- + daemon/filearch.ml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/daemon/filearch.ml b/daemon/filearch.ml +index 7dfc1cb7..e2bd5a2c 100644 +--- a/daemon/filearch.ml ++++ b/daemon/filearch.ml +@@ -100,6 +100,8 @@ and canonical_elf_arch bits endianness elf_arch = + ) + else if substr "LoongArch" then + sprintf "loongarch%s" bits ++ else if substr "*unknown arch 0x102*" then (* file command on RHEL 9 *) ++ sprintf "loongarch%s" bits + else + elf_arch + diff --git a/copy-patches.sh b/copy-patches.sh index 99ced47..2a0a714 100755 --- a/copy-patches.sh +++ b/copy-patches.sh @@ -7,7 +7,7 @@ set -e # ./copy-patches.sh project=libguestfs -rhel_version=9.6 +rhel_version=9.7 # Check we're in the right directory. if [ ! -f $project.spec ]; then diff --git a/libguestfs.spec b/libguestfs.spec index 7892311..8d5c901 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -37,7 +37,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.54.0 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPL-2.1-or-later # Build only for architectures that have a kernel @@ -72,7 +72,7 @@ Source7: libguestfs.keyring Source8: copy-patches.sh # Patches are maintained in the following repository: -# https://github.com/libguestfs/libguestfs/commits/rhel-9.6 +# https://github.com/libguestfs/libguestfs/commits/rhel-9.7 # Patches. Patch0001: 0001-website-Add-links-for-1.54-and-1.55-download-locatio.patch @@ -92,6 +92,8 @@ Patch0014: 0014-website-Fix-link-to-latest-development-version.patch Patch0015: 0015-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch Patch0016: 0016-RHEL-Reject-use-of-libguestfs-winsupport-features-ex.patch Patch0017: 0017-daemon-New-command_out-and-sh_out-APIs.patch +Patch0018: 0018-lib-Print-kernel-utsname-in-debug-output.patch +Patch0019: 0019-daemon-Fix-loongarch64-detection-on-RHEL-9.patch BuildRequires: autoconf, automake, libtool, gettext-devel @@ -1101,6 +1103,10 @@ rm ocaml/html/.gitignore %changelog +* Tue Mar 11 2025 Richard W.M. Jones - 1:1.54.0-5 +- Include host kernel information in libguestfs debugging output + resolves: RHEL-83025 + * Mon Feb 24 2025 Richard W.M. Jones - 1:1.54.0-4 - Add new APIs to allow command output > 4MB resolves: RHEL-80159