diff options
Diffstat (limited to 'images/freebsd/genimg')
| -rwxr-xr-x | images/freebsd/genimg | 52 | +27 −25 |
1 files changed, 27 insertions, 25 deletions
diff --git a/images/freebsd/genimg b/images/freebsd/genimg index 08a258c..8b23ed0 100755 --- a/images/freebsd/genimg +++ b/images/freebsd/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")") @@ -141,7 +141,7 @@ esac # resolver; the guest resolv.conf written below is purely for runtime. pkg -C /dev/null -R "$reposdir" -r "$rootfs" update pkg -C /dev/null -R "$reposdir" -r "$rootfs" install -y \ - pkg git-lite mercurial sudo curl qemu-guest-agent + pkg git-lite mercurial sudo curl pkg -C /dev/null -R "$reposdir" -r "$rootfs" clean -ay if [ "$with_ports" = true ]; then @@ -157,7 +157,6 @@ cat >>"$rootfs"/etc/rc.conf <<EOF ntpd_enable=YES sshd_enable=YES growfs_enable=YES -qemu_guest_agent_enable=YES hostname="build" ifconfig_DEFAULT="inet 10.0.2.15 netmask 255.255.255.0" defaultrouter="10.0.2.2" @@ -199,7 +198,7 @@ mkimg -s gpt \ cleanup trap : EXIT -# --- Hule machine configuration (`config.json`) ------------------------------ +# --- Hule Machine Manifest (.hmm) -- docs/boot-protocol.md 10b --------------- # GPT + freebsd-boot (gptboot/pmbr), booted by the VMM's BIOS firmware. No # boot.cmdline (the FreeBSD loader owns boot; firmware-disk takes none from the # VMM). FreeBSD host tools: sha256(1) and stat -f, not GNU coreutils. @@ -209,31 +208,21 @@ virtual_bytes=$((size_gib * 1024 * 1024 * 1024)) mem_min=$((256 * 1024 * 1024)) mem_def=$((1024 * 1024 * 1024)) -cat >"$out/config.json" <<CONFIG +cat >"$out/image.hmm" <<HMM { "schemaVersion": 1, "kind": "MachineImage", "system": { - "os": "freebsd", - "version": "$version", - "architecture": "$arch" + "family": "freebsd", + "distro": "freebsd", + "release": "$version" }, "machine": { + "arch": "$arch", "cpu": { "minimum": 1, "default": 2 }, - "ram": { "minimum": $mem_min, "default": $mem_def }, - "boot": [ - { - "protocol": "firmware-disk/bios", - "disk": "root" - } - ], - "access": [ - { "type": "ssh", "port": 22, "user": "build", "auth": "empty-password" }, - { "type": "qga" } - ], - "network": { "mode": "static", "address": "10.0.2.15/24", "gateway": "10.0.2.2" } + "ram": { "minimum": $mem_min, "default": $mem_def } }, "disks": [ @@ -241,10 +230,23 @@ cat >"$out/config.json" <<CONFIG "id": "root", "format": "qcow2", "path": "root.hmi", - "digest": "sha256:$disk_sha", - "virtSize": $virtual_bytes, - "diskSize": $disk_bytes + "checksum": "sha256:$disk_sha", + "virtualSize": $virtual_bytes, + "physicalSize": $disk_bytes } - ] + ], + + "boot": [ + { + "id": "firmware-disk/bios", + "disk": "root" + } + ], + + "access": [ + { "type": "ssh", "port": 22, "user": "build", "auth": "empty-password" } + ], + + "network": { "mode": "static", "address": "10.0.2.15/24", "gateway": "10.0.2.2" } } -CONFIG +HMM |
