13 Commits
Author SHA1 Message Date
Damiano Donati ef964f3028 gok logs: fix data race on http.Client.CheckRedirect
eventsource.SubscribeWith mutates the passed http.Client's
CheckRedirect field. Since streamLog is called concurrently for
stdout and stderr, this is a data race. Clone the client before
passing it to the library.

Add TestStreamLogConcurrentCancel to exercise both the concurrent
client usage and context cancellation under the race detector.
2026-06-23 08:58:23 +02:00
Damiano Donati 1713398904 gok logs: don't call stream.Close() to avoid send-on-closed-channel panic
The eventsource library's background goroutine may still be sending on
the Events/Errors channels when Close() is called, causing a panic.
Context cancellation already aborts the HTTP request, which makes the
library goroutine exit on its own.

This fixes TestGokRun failing in CI with:
  panic: send on closed channel
2026-06-23 08:58:23 +02:00
Damiano Donati f9838e18ee gok vm: use cpu:host on macOS with Hypervisor.framework (#100)
macOS Hypervisor.framework (HVF) does not support named CPU models
like cortex-a72 in QEMU 10; only host and max are valid.

Use -cpu host when HVF acceleration is active and keep cortex-a72
for all other cases (Linux KVM, cross-arch software emulation).

ref: https://www.qemu.org/docs/master/system/arm/cpu-features.html
2026-06-20 16:10:20 +02:00
Damiano Donati e4396f9c2c feat(packer): add zstd compression support for extrafiles (#102) 2026-06-01 18:18:59 +02:00
Damiano Donati 0f15665dd1 fix(packer): append new extraEEPROM properties to bootconf.txt (#101)
Previously, overwriteBootconf only replaced existing properties but
silently dropped any extraEEPROM lines for properties not already
present in the upstream bootconf.txt. Now, new properties are appended
at the end in user-specified order.
2026-05-24 18:28:32 +02: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
Damiano Donati 1c3069c7e6 fix sbom generation inconsistency, take 2 (#66) 2023-10-25 08:39:46 +02:00
Damiano Donati 84fe9d9358 fix: rerun go mod tidy (#65) 2023-10-22 13:11:07 +02:00
Damiano Donati 84c24f75e1 fix sbom generation inconsistency (#61)
prior to this commit SBOMs would have inconsistency in their hashing on
the configuration file.

The representation of the config file in fact would differ at certain
stages of the gok commands lifecycle, where at packer running time,
an extra InternalCompatibilityFlag, Sudo, would be added in memory
(while that not being the case at `gok sbom` time),
resulting in a differing config and as such differing SBOM hashes, same
goes for the differing pointer addresses that were skew the hashing
results.

This is now fixed by using the SudoOrDefault() accessor,
as well as converting the config into a string before computing the hash,
to avoid differing pointer problems.
2023-10-11 17:46:50 +02:00
Damiano Donati 7e4c5df8fb gok overwrite: add gaf as output format
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).
2023-02-05 13:51:32 +01:00
Damiano Donati 239461d80e packer: use Pack as receiver for Main and logic 2023-02-05 13:51:32 +01:00
Damiano Donati db4f55e31a gok sbom: prefactor mv GenerateSBOM to internal/packer 2023-02-05 13:51:32 +01:00
Damiano Donati 0d3aef012e add arm64 uefi support, bump systemd third_party (#36)
- adds the systemd-bootaa64.efi file to support UEFI boot for
arm64 machines that can do UEFI.

- bumps the systemd package from systemd-248.3-2 to systemd-250.5-1 (I
couldn't find the arm64 version for systemd-248.3-2 so I bumped them
both).

The packages come from the arch linux package registries:
- amd64: https://archlinuxarm.org/packages/aarch64/systemd
- arm64: http://mirror.archlinuxarm.org/aarch64/core/systemd-250.5-1-aarch64.pkg.tar.xz

fixes https://github.com/gokrazy/gokrazy/issues/129
2022-05-07 17:24:25 +02:00