diff options
Diffstat (limited to 'images/debian/genimg')
| -rwxr-xr-x | images/debian/genimg | 26 | +10 −16 |
1 files changed, 10 insertions, 16 deletions
diff --git a/images/debian/genimg b/images/debian/genimg index 2dedba5..116fab2 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 @@ -132,7 +135,7 @@ run_root apt-get -y install locales run_root apt-get -y install $kpkg run_root apt-get -y install build-essential git mercurial ssh sudo \ gnupg dirmngr ca-certificates apt-transport-https curl dbus \ - systemd-timesyncd ncurses-term qemu-guest-agent + systemd-timesyncd ncurses-term run_root ln -sf /usr/share/zoneinfo/UTC /etc/localtime run_root systemctl enable systemd-timesyncd.service @@ -144,7 +147,6 @@ echo '%sudo ALL=(ALL) NOPASSWD: ALL' >>/mnt/etc/sudoers echo "PermitEmptyPasswords yes" >>/mnt/etc/ssh/sshd_config echo ssh >>/mnt/etc/securetty run_root systemctl enable ssh -run_root systemctl enable qemu-guest-agent # Prevent docker from mucking up networking mkdir -p /mnt/etc/docker @@ -156,14 +158,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 @@ -280,8 +275,7 @@ cat >"$out/config.json" <<EOF $protocols ], "access": [ - { "type": "ssh", "port": 22, "user": "build", "auth": "empty-password" }, - { "type": "qga" } + { "type": "ssh", "port": 22, "user": "build", "auth": "empty-password" } ], "network": { "mode": "static", "address": "10.0.2.15/24", "gateway": "10.0.2.2" } }, |
