I had a case where I unplugged an SD card and it did not boot.
Overwriting it again fixed the issue.
Let’s sync to make it safe to unplug SD cards right after overwrite.
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.
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
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
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.
This check was broken: it tried to construct a http URL
by changing the updateBaseUrl schema instead of constructing
such a URL based on the configured HTTPPort.
I also don’t think this check is useful:
HTTPS will be used for updates regardless of the check.
Even if an attacker intercepted HTTP traffic and removed the redirect,
that has no bearing on the update, so why bother checking.
One thing the check (implicitly) did is the required fallback
on initial installation when --insecure is specified.
We now solve that by falling back from HTTPS to HTTP explicitly
(only when --insecure is specified, of course).
related to https://github.com/gokrazy/tools/pull/94
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).