12 Commits

Author SHA1 Message Date
Michael Stapelberg
1921f918ee cleanup: inline programName now that the old packer is gone 2025-12-06 20:23:57 +01:00
Michael Stapelberg
2c805ed001 refactor cobra command initialization to avoid stale state
Before this commit, we held onto *cobra.Command objects,
but that is not actually supported: after the first Execute(),
commands like updateCmd are stuck on the first-ever provided ctx.

Instead, turn command initialization into functions.

I only noticed this when trying to do two 'gok update'
from within the same test, where the fake build timestamp
is injected via the context (the timestamp was always the same).
2025-11-29 10:47:48 +01:00
Michael Stapelberg
9a9519186b integration: add 'gok update' test
Some checks failed
gokrazy CI / CI (macos-latest) (push) Has been cancelled
gokrazy CI / CI (ubuntu-latest) (push) Has been cancelled
gokrazy CI / CI (windows-latest) (push) Has been cancelled
2025-10-03 19:12:17 +02:00
Michael Stapelberg
2e390edb12 gok vm run: print a tip for how to enable the serial console
This should make it a little easier for users.
2025-05-30 19:00:00 +02:00
Michael Stapelberg
105d190cbc internal/packer: introduce Pack.Env (with a logger) and log to it
related to https://github.com/gokrazy/tools/issues/91
2025-05-29 15:26:31 +02:00
Michael Stapelberg
bdb09ed67a gok vm run: pass extra arguments to QEMU as-is
fixes https://github.com/gokrazy/tools/issues/87
2025-04-17 17:03:41 +02:00
Michael Stapelberg
ed3a455463 gok vm run: allocate 512 MB of /perm disk 2025-02-21 21:29:52 +01:00
andig
6316042495 gok vm: add -netdev command-line flag (#79) 2025-01-28 21:01:51 +01:00
Damiano Donati
9a2d41569f use newest arm64 UEFI and amd64 OVMF CODE/VARS firmware (#81)
it updates the arm64 UEFI firmware to a version newer than 2023.11,
as running on qemu >= 9.0 can trigger a bug in the older versions of the EDK2 guest firmware,
causing Synchronous Exception and potential bootloops.

While doing so it updates the amd64 OVMF firmware, which now has removed
support for the 2M firmware and only supports the 4M one.
The 4M OVMF firmware comes with split CODE and VARS images, which need
to be loaded as pflash drives in the qemu vm, rather than via the -bios
flag.

For more details on the migration see: https://salsa.debian.org/qemu-team/edk2/-/blob/debian/latest/debian/howto-2M-to-4M-migration.md

Fixes https://github.com/gokrazy/tools/issues/80
2025-01-28 19:00:02 +01:00
Michael Stapelberg
5f4d95c2d4 gok: apply Environment from config.json
For gok vm run, this means an explicit -arch=amd64 or -arch=arm64
might become necessary. In general, I recommend configuring
GOOS and GOARCH in config.json explicitly:

    {
        "Hostname": "repro",
        "Environment": [
            "GOOS=linux",
            "GOARCH=amd64"
        ],
    […]

related to https://github.com/gokrazy/gokrazy/issues/191
2025-01-26 22:43:19 +01:00
Michael Stapelberg
6bec690fe5 add embedded version of edk2 firmware files
Whether edk2 is available on operating systems varies,
so the best choice is to embed the amd64/arm64 EFI files.

We need these files to boot amd64 images in EFI mode,
and also for arm64 images to boot at all.
2024-09-27 08:21:46 +02:00
Michael Stapelberg
b8ffcd451e gok: add vm run subcommand
This is inspired by https://github.com/damdo/gokrazy-machine :)
2024-09-26 22:12:36 +02:00