Skip to content

Commit 5050820

Browse files
committed
xtask: Prefer local bootc image for bcvk dev VM creation
When iterating with the bcvk dev VM, developers often have a locally built composefs image (localhost/bootc). Automatically using that if it exists avoids having to explicitly set BOOTC_BASE_IMAGE on every invocation, and ensures the VM uses the correct bootloader (e.g. systemd-boot) rather than the upstream base's grub. Assisted-by: OpenCode (Claude Sonnet 4.5) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 1671307 commit 5050820

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

crates/xtask/src/sysext.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,20 @@ fn create_vm(sh: &Shell) -> Result<()> {
265265

266266
let base_img = std::env::var("BOOTC_BASE_IMAGE")
267267
.or_else(|_| std::env::var("BOOTC_base"))
268-
.unwrap_or_else(|_| "quay.io/centos-bootc/centos-bootc:stream10".to_string());
268+
.unwrap_or_else(|_| {
269+
// Prefer localhost/bootc if it exists (local composefs build), otherwise
270+
// fall back to the upstream stream10 base.
271+
let local_exists = Command::new("podman")
272+
.args(["image", "exists", "localhost/bootc"])
273+
.status()
274+
.map(|s| s.success())
275+
.unwrap_or(false);
276+
if local_exists {
277+
"localhost/bootc".to_string()
278+
} else {
279+
"quay.io/centos-bootc/centos-bootc:stream10".to_string()
280+
}
281+
});
269282
let bind_mount = format!("{}:{}", sysext_path, VM_SYSEXT_MNT);
270283

271284
let bcvk_opts = BcvkInstallOpts::from_env();

0 commit comments

Comments
 (0)