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).
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
gaf is the new gokrazy archive format output type.
It is immagined for storage and upgrade.
A single, uncompressed zip archive files that contains:
- the MBR image (mbr.img)
- the boot image (boot.img)
- the root image (root.img)
- the SBOM of the gokrazy build (sbom.json)
It is lighter in size than a "full" disk image (it doesn't have the
partition filling bits).
It contains all the necessary bits to upgrade a gokrazy instance (all it
takes is the 3 imgs).
It can be directly accessed for a single file extraction (non compressed
zip property).
It can be easily unarchived by gokrazy appliances (cheap unzipping).
It is easy to verify what the build contains (SBOM alongside to be read).