diff options
| author | Nikolay Govorov <me@govorov.online> | 2026-07-11 16:28:05 +0100 |
|---|---|---|
| committer | Nikolay Govorov <me@govorov.online> | 2026-07-11 16:28:05 +0100 |
| commit | 666ba6b7058c7fbecf4501b3468d9896e3c30d94 (patch) | |
| tree | fe7103bc370bac5faeadcac38f9eba1c6eb95fe9 | |
| parent | 67286b8141b032462d1510ea22b4873569dfe0f3 (diff) | |
| download | tar tar.gz tar.bz2 tar.lz tar.xz tar.zst zip | |
Fix build scripts for alpine and fedora
Diffstat
| -rwxr-xr-x | images/alpine/genimg | 18 | +6 −12 |
| -rwxr-xr-x | images/fedora/genimg | 10 | +10 −0 |
| -rwxr-xr-x | images/ubuntu/genimg | 6 | +0 −6 |
3 files changed, 16 insertions, 18 deletions
diff --git a/images/alpine/genimg b/images/alpine/genimg index e6b1ab2..ef2aaf1 100755 --- a/images/alpine/genimg +++ b/images/alpine/genimg @@ -43,9 +43,6 @@ cleanup() { size_gib=24 mkdir -p "$out" -# .hmi (Hule Machine Image): plain qcow2 restricted to a feature subset that -# materializes losslessly to raw (no internal snapshots/bitmaps/encryption). -# Base image = chain root, so no backing. Never `qemu-img snapshot` it. qemu-img create -f qcow2 -o compat=1.1 "$out"/root.hmi "${size_gib}G" modprobe nbd max_part=16 qemu-nbd --connect=/dev/nbd0 "$out"/root.hmi @@ -155,12 +152,9 @@ printf '%s\n' "%wheel ALL=(ALL) NOPASSWD: ALL" >>/mnt/etc/sudoers rm -f /mnt/etc/motd printf 'permit nopass :wheel\n' >>/mnt/etc/doas.d/doas.conf -# Reference partitions by PARTUUID so boot survives whatever the VMM names the -# disk. cmdline is canonical (extlinux APPEND == manifest boot.cmdline). -boot_partuuid=$(blkid -s PARTUUID -o value /dev/nbd0p1) -swap_partuuid=$(blkid -s PARTUUID -o value /dev/nbd0p2) -root_partuuid=$(blkid -s PARTUUID -o value /dev/nbd0p3) -cmdline="root=PARTUUID=$root_partuuid rw modules=sd-mod,usb-storage,ext4 quiet rootfstype=ext4" +boot_uuid=$(blkid -s UUID -o value /dev/nbd0p1) +root_uuid=$(blkid -s UUID -o value /dev/nbd0p3) +cmdline="root=UUID=$root_uuid rw modules=sd-mod,usb-storage,ext4 quiet rootfstype=ext4" cat >/mnt/boot/extlinux.conf <<EOF DEFAULT linux @@ -171,9 +165,9 @@ LABEL linux EOF cat >>/mnt/etc/fstab <<EOF -PARTUUID=$boot_partuuid /boot ext4 rw,relatime,data=ordered 0 0 -PARTUUID=$swap_partuuid swap swap defaults 0 0 -PARTUUID=$root_partuuid / ext4 rw,relatime,data=ordered 0 0 +UUID=$boot_uuid /boot ext4 rw,relatime,data=ordered 0 0 +/dev/vda2 swap swap defaults 0 0 +UUID=$root_uuid / ext4 rw,relatime,data=ordered 0 0 EOF mkdir -p /mnt/etc/docker diff --git a/images/fedora/genimg b/images/fedora/genimg index 3e4e668..74f1e33 100755 --- a/images/fedora/genimg +++ b/images/fedora/genimg @@ -37,6 +37,7 @@ cleanup() { umount /mnt/dev 2>/dev/null || true umount /mnt/proc 2>/dev/null || true umount /mnt/run 2>/dev/null || true + umount /mnt/sys/firmware 2>/dev/null || true umount /mnt/sys 2>/dev/null || true umount /mnt/boot 2>/dev/null || true umount /mnt 2>/dev/null || true @@ -101,6 +102,15 @@ mount --bind /proc /mnt/proc mount --bind /run /mnt/run mount --bind /sys /mnt/sys +# This is a BIOS-only image (no ESP), but the build host may boot via UEFI. Since +# /sys is bind-mounted from the host, grub2-mkconfig's 10_linux sees the host's +# /sys/firmware/efi and probes the nonexistent /boot/efi ("failed to get canonical +# path of /boot/efi/"). Shadow /sys/firmware with an empty tmpfs so the chroot's +# grub sees a BIOS platform regardless of how the host booted. Make the bind +# private first so the tmpfs doesn't propagate back and hide firmware on the host. +mount --make-rprivate /mnt/sys +mount -t tmpfs tmpfs /mnt/sys/firmware + # Remove systemd-networkd symlink, which is useless in our chroot. rm -f /mnt/etc/resolv.conf diff --git a/images/ubuntu/genimg b/images/ubuntu/genimg index d34f67b..c503b05 100755 --- a/images/ubuntu/genimg +++ b/images/ubuntu/genimg @@ -50,12 +50,6 @@ out="$release/$arch" size_gib=32 mkdir -p "$out" -# .hmi (Hule Machine Image) is a qcow2 restricted to a feature subset that -# materializes losslessly to raw (no internal snapshots, no dirty bitmaps, no -# encryption). Backing files are allowed in general -- that is how Hule layers -# images over OCI -- but this is a base image, i.e. a chain root, so it has no -# backing. It is the *resolved chain* that must round-trip to raw for raw-only -# VMMs (e.g. Firecracker). Never `qemu-img snapshot` it. qemu-img create -f qcow2 -o compat=1.1 "$out/root.hmi" "${size_gib}G" modprobe nbd max_part=16 qemu-nbd --connect=/dev/nbd0 "$out/root.hmi" |
