Allow reproducing single-vCPU package guests
@@ -1,6 +1,7 @@
11// v run tests/busybox/boot.v INSTALLED_ROOT VINIX_ISO NEW_OUTPUT_DIRECTORY [MODE]
22// For ARM provide AARCH64_EFI_CODE and AARCH64_EFI_VARS, and CROSS_COMPILE for a cross GCC.
33// Set VINIX_QEMU_AMD64_DISK_BUS=nvme to use an NVMe disk for x86_64 fixtures.
4+// Set VINIX_QEMU_VCPUS=1 to reproduce a single-vCPU guest.
45module main
56
67import crypto.sha256
@@ -37,6 +38,12 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin
3738 if memory <= 0 {
3839 return error('VINIX_QEMU_MEMORY_MIB must be a positive integer in MiB')
3940 }
41+ vcpus := strconv.atoi(os.getenv_opt('VINIX_QEMU_VCPUS') or { '2' }) or {
42+ return error('VINIX_QEMU_VCPUS must be a positive integer')
43+ }
44+ if vcpus <= 0 {
45+ return error('VINIX_QEMU_VCPUS must be a positive integer')
46+ }
4047 musl := mode in ['--musl', '--aarch64-musl']
4148 machine := if arm { 'aarch64' } else { 'x86_64' }
4249 acceleration := os.getenv_opt('VINIX_QEMU_ACCEL') or { 'tcg' }
@@ -155,8 +162,8 @@ fn boot_image(root string, iso string, output string, mode string, fixture strin
155162 emulator << ['-drive', 'if=ide,' + drive]
156163 }
157164 }
158- emulator << ['-accel', acceleration, '-cpu', cpu, '-m', memory.str(), '-smp', '2', '-nic',
159- 'none', '-display', 'none', '-monitor', 'none', '-serial', 'file:' + log, '-no-reboot']
165+ emulator << ['-accel', acceleration, '-cpu', cpu, '-m', memory.str(), '-smp', vcpus.str(),
166+ '-nic', 'none', '-display', 'none', '-monitor', 'none', '-serial', 'file:' + log, '-no-reboot']
160167 run(['timeout', '${deadline}s', ...emulator])!
161168 lines := os.read_lines(log)!.map(it.trim_space())
162169 if disk != '' {
@@ -134,6 +134,8 @@ The worker built both instrumented probes against the existing signed SDKs and v
134134
135135The first AMD64 ordinary-user fixture compiled with the installed GCC headers and LTO tools and passed EGL. Its readiness timer stopped `xset q` while it queried Xvfb, after the client printed `Keyboard Control:`. The readiness check now allows eight attempts of up to 90 seconds each. Both signed BusyBox shells passed controls for a server that started after retries, persistent timeouts and a server that exited. See `foundation/release-mode-migration-amd64-ordinary-readiness-01` and `foundation/release-mode-migration-glx-readiness-test-01`, receipt SHA-256 `7fc6d9315a94af6cc22611ee72c352c78a6a9df156744023d856cd982897719a` and `212f493acea367d0dad472b89508e4f3c273b4e93679db42300afee9b56534d2`.
136136
137+The earlier passing AMD64 on-demand X11 fixture used KVM with one virtual CPU. Set `VINIX_QEMU_VCPUS=1` with `VINIX_QEMU_ACCEL=kvm` to reproduce that CPU configuration. The fixture helper defaults to two virtual CPUs. The worker compiled it and verified that it rejects zero, negative, fractional and nonnumeric CPU counts before creating a guest directory. See `foundation/release-mode-migration-vcpu-boot-tool-01`, receipt SHA-256 `d62bec28ce09f8c846c697ac29758a9c7ebd0779732f3192b53c460e362ae745`.
138+
137139The migration fixture streams the package transaction to serial and keeps a copy for its hook-error check. The worker ran the fixture's logging block with the signed BusyBox shell and tee applet for each target. It observed both output streams before releasing a held package command, verified that tee preserved a failed package command's exit status, and checked that a reported hook failure stopped the fixture. See `foundation/release-mode-migration-stream-fixture-01`, receipt SHA-256 `c5aecd55f7659f68abf295bad3c8a7b86920fc2d884321e344d422433f33faf5`.
138140
139141The 2 GiB AMD64 migration guest reached the 5,400-second QEMU deadline during the GCC update. The worker read the disposable snapshot after QEMU exited. The installed binutils 2.43.1-5 and FreeGLUT 3.4.0-2 records showed PGP validation. The GCC 14.2.0-3 directory existed, but its installed record was absent and the permission migration was unverified. See `foundation/release-mode-migration-amd64-upgrade-terminal-01`, receipt SHA-256 `c66ab9af9e3c0305ba3b03fe2e6add7833da485e9b4cc8b47793dde8bf935a25`.