Re: [PATCH 3/8] guestfs: Fix dracut-config-rescue removal for Debian systems

Luis Chamberlain <[email protected]> Tue, 21 Oct 2025 09:56:50 -0700
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
On Sat, Oct 18, 2025 at 02:16:03PM -0400, Chuck Lever wrote:
> On 10/17/25 10:31 PM, Luis Chamberlain wrote:
> > 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 <[email protected]>
> > ---
> >  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) %}
> 
> Claude copied a bug I introduced. You want this:
> 
> {% if guestfs_debian is defined and guestfs_debian %}
> 
> instead, but it will work only after applying "base_image: Replace
> distro checks" which is in the cel-fixes branch. I can merge that
> right now.
> 
> With that change, for the series:
> 
> Reviewed-by: Chuck Lever <[email protected]>

Great, I'll rebase and merge this shortly.

  Luis