aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'images/debian/genimg')
-rwxr-xr-ximages/debian/genimg20+8 −12
1 files changed, 8 insertions, 12 deletions
diff --git a/images/debian/genimg b/images/debian/genimg
index 2dedba5..85e363a 100755
--- a/images/debian/genimg
+++ b/images/debian/genimg
@@ -1,6 +1,6 @@
#!/bin/sh -eux
# SPDX-FileCopyrightText: 2017-2026 Drew DeVault
-# SPDX-FileCopyrightText: 2026 Nikolay Govorov
+# SPDX-FileCopyrightText: 2026 Nikolay Govorov
# SPDX-License-Identifier: AGPL-3.0-only
self=$(dirname "$(readlink -f "$0")")
@@ -21,16 +21,19 @@ case $arch in
amd64)
darch=amd64
iface=ens3
+ qarch=x86_64
kpkg=linux-image-amd64
;;
arm64)
darch=arm64
iface=enp0s1
+ qarch=aarch64
kpkg=linux-image-arm64
;;
ppc64le)
darch=ppc64el
iface=enp0s0
+ qarch=ppc64le
kpkg=linux-image-powerpc64le
;;
*)
@@ -64,7 +67,7 @@ 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"
for i in $(seq 1 5); do
- sleep "0.$i"
+ sleep 0.$i
partprobe /dev/nbd0 && break
done
trap cleanup EXIT
@@ -88,9 +91,9 @@ mkdir /mnt/boot
mount /dev/nbd0p1 /mnt/boot
if [ "$arch" = "amd64" ]; then
- debootstrap --include=gnupg2 --arch="$darch" "$release" /mnt
+ debootstrap --include=gnupg2 --arch=$darch $release /mnt
else
- ./qemu-debootstrap --include=gnupg2 --arch="$darch" "$release" /mnt
+ ./qemu-debootstrap --include=gnupg2 --arch=$darch $release /mnt
fi
mount --bind /dev /mnt/dev
@@ -156,14 +159,7 @@ EOF
run_root update-initramfs -u
-kernel_path=
-for candidate in /mnt/boot/vmlinuz-*; do
- [ -e "$candidate" ] || continue
- kernel_path=$candidate
- break
-done
-[ -n "$kernel_path" ]
-linuxver=${kernel_path##*/vmlinuz-}
+linuxver=$(ls /mnt/boot | grep vmlinuz | cut -d- -f2-)
# Reference partitions by PARTUUID so boot survives whatever the VMM names the
# disk. cmdline is canonical: identical for every boot protocol (extlinux append