aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'images/ubuntu/genimg')
-rwxr-xr-ximages/ubuntu/genimg24+7 −17
1 files changed, 7 insertions, 17 deletions
diff --git a/images/ubuntu/genimg b/images/ubuntu/genimg
index 1980803..114438c 100755
--- a/images/ubuntu/genimg
+++ b/images/ubuntu/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")")
@@ -81,7 +81,7 @@ export DEBIAN_FRONTEND=noninteractive
debootstrap \
--include=gnupg,ubuntu-keyring \
- --arch="$arch" "$release" \
+ --arch=$arch $release \
/mnt http://archive.ubuntu.com/ubuntu/
mount --bind /dev /mnt/dev
@@ -111,9 +111,9 @@ echo 'nameserver 1.1.1.1' >>/mnt/etc/resolv.conf
net_mode=static
net_address=10.0.2.15/24
net_gateway=10.0.2.2
-cat >"/mnt/etc/systemd/network/25-$iface.network" <<EOF
+cat >/mnt/etc/systemd/network/25-ens3.network <<EOF
[Match]
-Name=$iface
+Name=ens3
[Network]
Address=$net_address
@@ -142,8 +142,7 @@ run_root apt-get -y install locales
run_root apt-get -y install linux-base
run_root apt-get -y install linux-image-generic
run_root apt-get -y install \
- build-essential git mercurial ssh sudo dirmngr curl ca-certificates \
- qemu-guest-agent
+ build-essential git mercurial ssh sudo dirmngr curl ca-certificates
if [ "$arch" = "amd64" ]; then
extlinux -i /mnt/boot
@@ -160,7 +159,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
@@ -172,14 +170,7 @@ EOF
run_root update-initramfs -u
-kernel_path=
-for candidate in /mnt/boot/vmlinuz-[0-9]*; do
- [ -e "$candidate" ] || continue
- kernel_path=$candidate
- break
-done
-[ -n "$kernel_path" ]
-linuxver=${kernel_path##*/vmlinuz-}
+linuxver=$(ls /mnt/boot | grep 'vmlinuz-[0-9].*' | cut -d- -f2-)
# Reference partitions by PARTUUID so boot works regardless of how the VMM names
# the disk (vda/sda/nvme...). cmdline is canonical: identical for every boot
@@ -281,8 +272,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": "$net_mode",