From 51ed018735fef96e34a4b263cf4878a5595b82f5 Mon Sep 17 00:00:00 2001 From: Brennan Vincent Date: Tue, 10 Mar 2026 11:13:42 -0700 Subject: [PATCH 1/2] Exit when debootstrap fails Previously we were catting the log, but trying to continue booting and running the VM, which will probably hang and time out or otherwise not work in a confusing way. --- test/distro-qemu/build-and-run.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/distro-qemu/build-and-run.sh b/test/distro-qemu/build-and-run.sh index aea7c4d02..0854d3aa2 100755 --- a/test/distro-qemu/build-and-run.sh +++ b/test/distro-qemu/build-and-run.sh @@ -61,10 +61,16 @@ fi # Create minimal rootfs with debootstrap (requires sudo for chroot operations) echo "Running debootstrap to create $DISTRO $RELEASE rootfs for $DEBOOTSTRAP_ARCH..." -sudo debootstrap --variant=minbase \ +if ! sudo debootstrap --variant=minbase \ --arch="$DEBOOTSTRAP_ARCH" \ --cache-dir="$CACHE_DIR" \ - "$RELEASE" "$ROOTFS_DIR" "$MIRROR" || cat "$ROOTFS_DIR/debootstrap/debootstrap.log" + "$RELEASE" "$ROOTFS_DIR" "$MIRROR" ; then + echo "Debootstrap failed, log follows." + cat "$ROOTFS_DIR/debootstrap/debootstrap.log" + exit 1 +fi + + # Change ownership of rootfs to current user to avoid needing sudo for subsequent operations sudo chown -R "$(id -u):$(id -g)" "$ROOTFS_DIR" From 365a1e279ee0b22115658b625b5e2ce56a580b7d Mon Sep 17 00:00:00 2001 From: Brennan Vincent Date: Tue, 10 Mar 2026 11:53:20 -0700 Subject: [PATCH 2/2] add "foreign" to exit after unpacking and not try to execute stuff --- test/distro-qemu/build-and-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/distro-qemu/build-and-run.sh b/test/distro-qemu/build-and-run.sh index 0854d3aa2..30f16e934 100755 --- a/test/distro-qemu/build-and-run.sh +++ b/test/distro-qemu/build-and-run.sh @@ -64,6 +64,7 @@ echo "Running debootstrap to create $DISTRO $RELEASE rootfs for $DEBOOTSTRAP_ARC if ! sudo debootstrap --variant=minbase \ --arch="$DEBOOTSTRAP_ARCH" \ --cache-dir="$CACHE_DIR" \ + --foreign \ "$RELEASE" "$ROOTFS_DIR" "$MIRROR" ; then echo "Debootstrap failed, log follows." cat "$ROOTFS_DIR/debootstrap/debootstrap.log"