From 48ff272c67de6562cb14b8212b270ea8706b53f9 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 15:06:24 +0100 Subject: [PATCH 1/2] Make lvm optional in capture deployment initramfs Hosts without lvm2 installed made dracut report a FAILED dracut-install during imgutil capture. The initramfs was still built, just without lvm. lvm is only used there to deactivate stale volume groups before the install. Any LVM layout is created from inside the image, which carries its own lvm2 when the source used LVM. Mark lvm optional, the same way unsquashfs already is. --- imgutil/el10/dracut/install | 3 ++- imgutil/el7/dracut/install | 3 ++- imgutil/el8/dracut/install | 3 ++- imgutil/el9/dracut/install | 3 ++- imgutil/suse15/dracut/install | 3 ++- imgutil/suse16/dracut/install | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/imgutil/el10/dracut/install b/imgutil/el10/dracut/install index e5a2d910..6ed996b2 100644 --- a/imgutil/el10/dracut/install +++ b/imgutil/el10/dracut/install @@ -18,7 +18,8 @@ dracut_install chmod chcon whoami head tail basename tr dracut_install /usr/sbin/arping dhcpcd logger hostnamectl inst /bin/bash /bin/sh dracut_install /lib64/libfuse.so.2 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/udev/rules.d/60-net.rules /lib/udev/rename_device /usr/lib/systemd/network/99-default.link dracut_install /lib64/libpthread.so.0 diff --git a/imgutil/el7/dracut/install b/imgutil/el7/dracut/install index 31d56f38..28132153 100644 --- a/imgutil/el7/dracut/install +++ b/imgutil/el7/dracut/install @@ -18,7 +18,8 @@ dracut_install chmod chcon whoami head tail basename tr dracut_install /usr/sbin/arping /usr/sbin/dhclient-script ipcalc logger hostnamectl inst /bin/bash /bin/sh dracut_install /lib64/libfuse.so.2 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/udev/rules.d/60-net.rules /lib/udev/rename_device dracut_install losetup # multipart support diff --git a/imgutil/el8/dracut/install b/imgutil/el8/dracut/install index 8d235db8..754235ad 100644 --- a/imgutil/el8/dracut/install +++ b/imgutil/el8/dracut/install @@ -16,7 +16,8 @@ dracut_install chmod chcon whoami head tail basename tr dracut_install /usr/sbin/arping /usr/sbin/dhclient-script ipcalc logger hostnamectl inst /bin/bash /bin/sh dracut_install /lib64/libfuse.so.2 /lib64/libfuse.so.2.9.7 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/udev/rules.d/60-net.rules /lib/udev/rename_device /usr/lib/systemd/network/99-default.link dracut_install losetup # multipart support diff --git a/imgutil/el9/dracut/install b/imgutil/el9/dracut/install index 2e334295..d935f2a7 100644 --- a/imgutil/el9/dracut/install +++ b/imgutil/el9/dracut/install @@ -17,7 +17,8 @@ dracut_install chmod chcon whoami head tail basename tr dracut_install /usr/sbin/arping /usr/sbin/dhclient-script ipcalc logger hostnamectl inst /bin/bash /bin/sh dracut_install /lib64/libfuse.so.2 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/udev/rules.d/60-net.rules /lib/udev/rename_device /usr/lib/systemd/network/99-default.link dracut_install /lib64/libpthread.so.0 diff --git a/imgutil/suse15/dracut/install b/imgutil/suse15/dracut/install index 6bf70376..2792bb55 100644 --- a/imgutil/suse15/dracut/install +++ b/imgutil/suse15/dracut/install @@ -17,7 +17,8 @@ dracut_install chmod whoami head tail basename tr dracut_install /usr/sbin/arping logger hostnamectl inst /bin/bash /bin/sh dracut_install /lib64/libfuse.so.2 /lib64/libfuse.so.2.9.7 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/systemd/network/99-default.link dracut_install losetup # multipart support diff --git a/imgutil/suse16/dracut/install b/imgutil/suse16/dracut/install index 253a2c72..7dd56212 100644 --- a/imgutil/suse16/dracut/install +++ b/imgutil/suse16/dracut/install @@ -28,7 +28,8 @@ dracut_install /lib64/libfuse.so.2 # symlink, dracut brings the target along # urlmount still links libpthread, which since glibc 2.34 is an empty stub that # nothing else in the initramfs pulls in dracut_install /lib64/libpthread.so.0 -dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod +dracut_install -o lvm # optional, only used to deactivate stale volume groups before install dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/lib/systemd/network/99-default.link dracut_install losetup # multipart support From b2a40e13705d63d5b43a02d30aafad491a7a7a84 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 3 Nov 2026 17:18:46 +0100 Subject: [PATCH 2/2] Skip deactivating volume groups when lvm is absent lvm is optional in the capture initramfs now, so installimage printed 'lvm: command not found' on every install of a capture taken from a host without lvm2. Only run it when it is there. --- .../el7-diskless/profiles/default/scripts/installimage | 2 +- .../el8-diskless/profiles/default/scripts/installimage | 2 +- .../el9-diskless/profiles/default/scripts/installimage | 2 +- .../ubuntu20.04-diskless/profiles/default/scripts/installimage | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/el7-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/el7-diskless/profiles/default/scripts/installimage index 5a462445..c77a2c13 100644 --- a/confluent_osdeploy/el7-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/el7-diskless/profiles/default/scripts/installimage @@ -29,7 +29,7 @@ if [ ! -f /sysroot/tmp/installdisk ]; then sleep 1 done fi -lvm vgchange -a n +if command -v lvm > /dev/null; then lvm vgchange -a n; fi # lvm is optional in the initramfs udevadm control -e chroot /sysroot /usr/lib/systemd/systemd-udevd --daemon chroot /sysroot bash -c "source /etc/confluent/functions; run_remote_python image2disk.py" diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/el8-diskless/profiles/default/scripts/installimage index 031b1479..e2532494 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/installimage @@ -36,7 +36,7 @@ if [ ! -f /sysroot/tmp/installdisk ]; then sleep 1 done fi -lvm vgchange -a n +if command -v lvm > /dev/null; then lvm vgchange -a n; fi # lvm is optional in the initramfs udevadm control -e if [ -f /sysroot/etc/lvm/devices/system.devices ]; then rm /sysroot/etc/lvm/devices/system.devices diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage index eef9da18..bec197a3 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/installimage @@ -41,7 +41,7 @@ if [ ! -f /sysroot/tmp/installdisk ]; then sleep 1 done fi -lvm vgchange -a n +if command -v lvm > /dev/null; then lvm vgchange -a n; fi # lvm is optional in the initramfs /sysroot/usr/sbin/wipefs -a /dev/$(cat /sysroot/tmp/installdisk) udevadm control -e if [ -f /sysroot/etc/lvm/devices/system.devices ]; then diff --git a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/installimage b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/installimage index a62bce6b..8be29fc7 100644 --- a/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/installimage +++ b/confluent_osdeploy/ubuntu20.04-diskless/profiles/default/scripts/installimage @@ -31,7 +31,7 @@ if [ ! -f /sysroot/tmp/installdisk ]; then sleep 1 done fi -lvm vgchange -a n +if command -v lvm > /dev/null; then lvm vgchange -a n; fi # lvm is optional in the initramfs udevadm control -e if [ -f /sysroot/etc/lvm/devices/system.devices ]; then rm /sysroot/etc/lvm/devices/system.devices