From e135b4bcc887395ca4c253f85889b8dbcbc1de97e8204950c94c2f033b834409 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Wed, 15 Sep 2021 16:53:39 +0000 Subject: [PATCH] - 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 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=484 --- ...e-bashs-Process-Substitution-feature.patch | 31 ++++++++ appliance.patch | 10 +-- ...ce-add-reboot-and-netconfig-for-SUSE.patch | 29 +++++++ ...nting-of-special-filesystems-in-init.patch | 77 +++++++++++++++++++ libguestfs.changes | 10 +++ libguestfs.spec | 3 + netconfig.patch | 8 -- 7 files changed, 155 insertions(+), 13 deletions(-) create mode 100644 9db0c98c-appliance-enable-bashs-Process-Substitution-feature.patch create mode 100644 c0de4de9-appliance-add-reboot-and-netconfig-for-SUSE.patch create mode 100644 f47e0bb6-appliance-reorder-mounting-of-special-filesystems-in-init.patch 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 + +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 + +--- 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 + +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=$(