diff --git a/9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch b/9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch new file mode 100644 index 0000000..3d18789 --- /dev/null +++ b/9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch @@ -0,0 +1,31 @@ +Subject: appliance: enable bash's Process Substitution feature +From: Olaf Hering olaf@aepfle.de Wed Sep 15 12:20:42 2021 +0200 +Date: Wed Sep 15 12:37:08 2021 +0100: +Git: 9db0c98c99090e601d856c6795544f6967e6155f + +bash can read input from a spawned process, and even provide input to +such process. This feature relies on /dev/fd/ being present. In the +past udev silently created this symlink, so this bash feature worked +more or less by accident. With recent systemd versions, such as 246 +which is included in Leap 15.3, the symlink is not created anymore. As +a result scripts, such as /sbin/dhclient-script, fail to work +properly. + +This symlink should have been created in version 1 of this variant of /init. + +https://bugzilla.opensuse.org/show_bug.cgi?id=1190501 + +Signed-off-by: Olaf Hering <olaf@aepfle.de> + +diff --git a/appliance/init b/appliance/init +index b1c4d09ea..cdc39c3b9 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -72,6 +72,7 @@ fi + + # devtmpfs is required since udev 176 + mount -t devtmpfs /dev /dev ++ln -s /proc/self/fd /dev/fd + mkdir -p /dev/pts + mount -t devpts /dev/pts /dev/pts + mkdir -p /dev/shm diff --git a/appliance.patch b/appliance.patch index fc29438..dd1a063 100644 --- a/appliance.patch +++ b/appliance.patch @@ -1,8 +1,8 @@ -Index: libguestfs-1.42.0/appliance/init +Index: libguestfs-1.44.2/appliance/init =================================================================== ---- libguestfs-1.42.0.orig/appliance/init -+++ libguestfs-1.42.0/appliance/init -@@ -127,8 +127,10 @@ if test "$guestfs_network" = 1; then +--- libguestfs-1.44.2.orig/appliance/init ++++ libguestfs-1.44.2/appliance/init +@@ -122,8 +122,10 @@ if test "$guestfs_network" = 1; then rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved if dhclient --version >/dev/null 2>&1; then dhclient $iface @@ -14,7 +14,7 @@ Index: libguestfs-1.42.0/appliance/init fi fi -@@ -245,7 +245,8 @@ else +@@ -240,7 +242,8 @@ else echo "Note: The contents of / (root) are the rescue appliance." if ! test -d "/sysroot/dev"; then echo "You have to mount the guest’s partitions under /sysroot" diff --git a/c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch b/c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch new file mode 100644 index 0000000..9286ab8 --- /dev/null +++ b/c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch @@ -0,0 +1,29 @@ +Subject: appliance: add reboot and netconfig for SUSE +From: Olaf Hering olaf@aepfle.de Tue Sep 14 17:57:43 2021 +0200 +Date: Tue Sep 14 20:49:02 2021 +0100: +Git: c0de4de9029c3e483f738a0f80a2c5066c6532db + +systemd-sysvinit contains the reboot command, which is used to +properly stop the VM. This was required by other packages, and as a +result always available. Since Leap 15.3 it will not be installed, and +as a result the VM will just panic because /init died. + +If the appliance is started with --network, dhclient will run +/usr/sbin/dhclient-script, which in turn may call /sbin/netconfig to +update /etc/resolv.conf. Install sysconfig-netconfig to make sure DNS +resolving actually works. + +Signed-off-by: Olaf Hering <olaf@aepfle.de> + +--- a/appliance/packagelist.in ++++ b/appliance/packagelist.in +@@ -133,7 +133,9 @@ ifelse(SUSE,1, + ntfs-3g + reiserfs + squashfs ++ sysconfig-netconfig + systemd ++ systemd-sysvinit + vim + xz + ) diff --git a/f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch b/f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch new file mode 100644 index 0000000..df21414 --- /dev/null +++ b/f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch @@ -0,0 +1,77 @@ +Subject: appliance: reorder mounting of special filesystems in init +From: Olaf Hering olaf@aepfle.de Wed Sep 15 12:58:23 2021 +0200 +Date: Wed Sep 15 12:37:08 2021 +0100: +Git: f47e0bb6725434778384cf79ba3b08610f8c3796 + +Make sure proc and dev are available early. +No change in behavior intended. + +Signed-off-by: Olaf Hering <olaf@aepfle.de> + +diff --git a/appliance/init b/appliance/init +index cdc39c3b9..7076821d2 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -27,12 +27,12 @@ for d in /lib64 /lib; do + fi + done + +-mkdir -p /sysroot +- +-# Mount /proc. +-if [ ! -d /proc ]; then rm -f /proc; fi +-mkdir -p /proc ++mkdir -p /proc /sys + mount -t proc /proc /proc ++mount -t sysfs /sys /sys ++# devtmpfs is required since udev 176 ++mount -t devtmpfs /dev /dev ++ln -s /proc/self/fd /dev/fd + + # Parse the kernel command line early (must be after /proc is mounted). + cmdline=$(</proc/cmdline) +@@ -54,34 +54,28 @@ if [[ $cmdline == *guestfs_boot_analysis=1* ]]; then + guestfs_boot_analysis=1 + fi + +-# Mount the other special filesystems. +-if [ ! -d /sys ]; then rm -f /sys; fi +-mkdir -p /sys +-mount -t sysfs /sys /sys ++mkdir -p /dev/pts /dev/shm ++mount -t devpts /dev/pts /dev/pts ++mount -t tmpfs -o mode=1777 shmfs /dev/shm ++ ++mkdir -p /sysroot ++ + # taken from initramfs-tools/init --Hilko Bengen + mkdir -p /run + mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run + mkdir -p /run/lock + ln -s ../run/lock /var/lock + ++if [[ $cmdline == *selinux=1* ]]; then ++ mount -t selinuxfs none /sys/fs/selinux ++fi ++ + # On Fedora 23, util-linux creates /etc/mtab in %post .. stupid + # and e2fsprogs fails if the link doesn't exist .. stupid stupid + if ! test -e /etc/mtab; then + ln -s /proc/mounts /etc/mtab + fi + +-# devtmpfs is required since udev 176 +-mount -t devtmpfs /dev /dev +-ln -s /proc/self/fd /dev/fd +-mkdir -p /dev/pts +-mount -t devpts /dev/pts /dev/pts +-mkdir -p /dev/shm +-mount -t tmpfs -o mode=1777 shmfs /dev/shm +- +-if [[ $cmdline == *selinux=1* ]]; then +- mount -t selinuxfs none /sys/fs/selinux +-fi +- + # Static nodes must happen before udev is started. + + # Set up kmod static-nodes (RHBZ#1011907). diff --git a/libguestfs.changes b/libguestfs.changes index 4e9c549..9852985 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Sep 15 10:31:29 MDT 2021 - carnold@suse.com + +- bsc#1190501 - virt-builder fails to install packages when + building an image + 9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch +- Upstream bug fixes + c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch + f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch + ------------------------------------------------------------------- Mon Sep 13 16:34:08 MDT 2021 - carnold@suse.com diff --git a/libguestfs.spec b/libguestfs.spec index 2b6e6da..a603bad 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -145,6 +145,9 @@ License: GPL-2.0-only Patch1: e26cfa44-daemon-Build-with--pthread.patch Patch2: 489b14b7-ocaml-examples-Link-examples-to-gnulib.patch Patch3: 68a02c2f-customize--resize--sparsify--sysprep-Link-explicitly-with-pthread.patch +Patch4: c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch +Patch5: 9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch +Patch6: f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch # Pending upstram review Patch50: 0001-Introduce-a-wrapper-around-xmlParseURI.patch diff --git a/netconfig.patch b/netconfig.patch index 821501d..63f0cfe 100644 --- a/netconfig.patch +++ b/netconfig.patch @@ -10,11 +10,3 @@ Index: libguestfs-1.44.2/appliance/packagelist.in cdrkit-cdrtools-compat cryptsetup dhcpcd -@@ -133,6 +134,7 @@ ifelse(SUSE,1, - ntfs-3g - reiserfs - squashfs -+ sysconfig-netconfig - systemd - vim - xz