From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 3/8] guestfs: Fix dracut-config-rescue removal for Debian systems
Date: Fri, 17 Oct 2025 19:31:48 -0700 [thread overview]
Message-ID: <20251018023154.2239688-4-mcgrof@kernel.org> (raw)
In-Reply-To: <20251018023154.2239688-1-mcgrof@kernel.org>
The virt-builder template was trying to uninstall dracut-config-rescue
package unconditionally, but this package only exists on Fedora/RHEL
systems. Debian uses initramfs-tools instead of dracut.
This was causing base image customization to fail with:
E: Unable to locate package dracut-config-rescue
virt-customize: error: apt-get remove 'dracut-config-rescue': command
exited with an error
Conditionalize the dracut cleanup section to only run on non-Debian
systems. This allows Debian Trixie base images to be created successfully
while preserving the cleanup behavior for Fedora/RHEL/openSUSE systems
that use dracut.
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
playbooks/roles/base_image/templates/virt-builder.j2 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/playbooks/roles/base_image/templates/virt-builder.j2 b/playbooks/roles/base_image/templates/virt-builder.j2
index b5de57d4..5e3e4cd8 100644
--- a/playbooks/roles/base_image/templates/virt-builder.j2
+++ b/playbooks/roles/base_image/templates/virt-builder.j2
@@ -14,10 +14,12 @@ copy-in {{ guestfs_distro_source_and_dest_file }}:{{ target_dir }}
install sudo,qemu-guest-agent,python3,bash,policycoreutils-python-utils
+{% if not (distro_debian_based is defined and distro_debian_based) %}
# get rid of any rescue initramfs images, and prevent new ones from being generated
uninstall dracut-config-rescue
delete /boot/*rescue*
delete /boot/loader/entries/*rescue*
+{% endif %}
run-command useradd {{ kdevops_uid }} -s /bin/bash -m kdevops
append-line /etc/sudoers.d/kdevops:kdevops ALL=(ALL) NOPASSWD: ALL
--
2.51.0
next prev parent reply other threads:[~2025-10-18 2:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 2:31 [PATCH 0/8] guestfs / base_images: fixes Luis Chamberlain
2025-10-18 2:31 ` [PATCH 1/8] guestfs: Fix Debian 13 (Trixie) APT sources file path Luis Chamberlain
2025-10-18 2:31 ` [PATCH 2/8] guestfs: Don't delete APT sources copied from host Luis Chamberlain
2025-10-18 2:31 ` Luis Chamberlain [this message]
2025-10-18 18:16 ` [PATCH 3/8] guestfs: Fix dracut-config-rescue removal for Debian systems Chuck Lever
2025-10-21 16:56 ` Luis Chamberlain
2025-10-18 2:31 ` [PATCH 4/8] base_image: put a guard check before adding kdevops user Luis Chamberlain
2025-10-18 2:31 ` [PATCH 5/8] base_image: relax base image permissions Luis Chamberlain
2025-10-18 2:31 ` [PATCH 6/8] guestfs: Use sudo for base image copy with system libvirt Luis Chamberlain
2025-10-18 2:31 ` [PATCH 7/8] guestfs: Fix base_image_pathname for custom images Luis Chamberlain
2025-10-18 2:31 ` [PATCH 8/8] playbooks: Fix host pattern for single-node setups Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251018023154.2239688-4-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox