From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 512D713635E for ; Sat, 18 Oct 2025 02:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754719; cv=none; b=cmdbScB9o0UP55hhT2nEKEigda9dTPSXM8Lq4Yq47gTIcG/yrP0EdRJ4NI6l2VnkUCTPrcpX7XUXbWKuARqw47Hqu3njm8fkza8+k/xM4kC14lzktyTFRA6V5kKmFL8VIV/p4xhvcG0OG9Gj8tpssGM2rb5BmT/SakgsT3Q1tEA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754719; c=relaxed/simple; bh=H/o2PwltxzXr/1MRvHB8p20mLOh7Afa9Ff6+ByWOweg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tCW3LzlXEzasF9GOcp/cY6fVNiVsQIYk9LVCGxNuI7mC8S51vpLdQjrmiac80VEdMpbtUbDA0Rqz3P0hRZYI0+SnCl2ZWtRSQCpb2SCtD7lmwHXZBSzsapqDGuXGA2C8kroFAfgCj2LHgP9nxGkhjj5V3VB/lYukqb4/6rqxHUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pYfeyly4; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pYfeyly4" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=avu4UndL0JRKADDFjpmmouRFU2uLYAoa8c8I7H62pQY=; b=pYfeyly4TZLiKzTo2sR00aw7YC oHwlj70hVEHZvvn1z5N7i0LsUnst7hyJbdzSjrApcDWeZ1K0KfVF0l32h1joBNIkVWcbodp16LV9f Kcjay0wXrzZUTy0dDA/6xpPJjF6DEO3G/Ho00PtWa1K2AadonoAydxvPZjxu0VnTOFzqFUQ1a0VQF rYywYLDHqKRnAXPMzkpRhSW7MWsqGosGWFRW6IvHQK68G3l1wqJPMTckI20wpFCKkTvPZqfH/btGT IaQsf5OsrN/RR7L2XnqjafuhqWAttZVZnwSaBgQ1PBhaWlTVG82xY6G2KfqrhQOPqiPnNXm93OGD+ QyscfxQQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9wjc-00000009OeT-4557; Sat, 18 Oct 2025 02:31:56 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 3/8] guestfs: Fix dracut-config-rescue removal for Debian systems Date: Fri, 17 Oct 2025 19:31:48 -0700 Message-ID: <20251018023154.2239688-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251018023154.2239688-1-mcgrof@kernel.org> References: <20251018023154.2239688-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain 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 --- 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