420 Commits
Author SHA1 Message Date
Michael Stapelberg 28d96f8788 gok new: add GOOS and GOARCH by default
related to https://github.com/gokrazy/gokrazy/issues/191
2025-01-26 22:49:25 +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 70c48e594c sbom: use absolute instancePath, not (relative) config.InstancePath
fixes https://github.com/gokrazy/gokrazy/issues/292
2025-01-25 21:02:04 +01:00
Michael Stapelberg f1a87939e4 GitHub Actions: create dummy SSH key for breakglass.authorized_keys 2025-01-22 21:54:04 +01:00
Michael Stapelberg 5762235ac5 make ExtraFilePaths absolute earlier to fix sbom in relative parents
fixes https://github.com/gokrazy/gokrazy/issues/289
2025-01-22 21:49:32 +01:00
Michael Stapelberg ea613267ff gok new: use relative path for breakglass.authorized_keys
related to https://github.com/gokrazy/gokrazy/issues/289
2025-01-22 21:41:48 +01:00
Bill Doyle 8edbabf668 Preserve GOKRAZY_PARENT_DIR when executing sudo (#76)
This should fix `gok overwrite` not fully utilizing this environment
variable as mentioned in a comment on gokrazy/gokrazy#222.
2025-01-20 08:18:36 +01:00
Michael Stapelberg ca8464f58d overwrite: add --trace_file flag for performance analysis
related to https://github.com/gokrazy/gokrazy/issues/287
2025-01-13 21:56:14 +01:00
Michael Stapelberg 37e2f95c5c create an empty /bin mount point
This is useful for mounting a tmpfs and installing busybox
(e.g. the version that comes with the serial-busybox package):

    mount -t tmpfs tmpfs /bin
    ln -s /tmp/serial-busybox/ash busybox
    ./busybox --install -s /bin

Afterwards, TRAMP (transparent remote access) in Emacs works:

    emacs /ssh:scan2drive:/perm/keep/index.md
2024-12-29 16:36:13 +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
Michael Stapelberg 0c67e08b0a packer: partially restore buildPackagesFromFlags()
Commit a59c9ad5f4 was not entirely correct:
It is desired to call getGokrazySystemPackages(), but we should also
keep looking at cfg.Packages (which the commit didn’t).
2024-09-11 18:27:24 +02:00
Michael Stapelberg feda2a35da sbom: move too-late os.Chdir call earlier
This fixes errors such as:

2024/09/11 08:41:50 Error: build directory
"/home/michael/gokrazy/router7/builddir/github.com/stapelberg/prober7/cmd/probe"
does not exist in
"/home/michael/gokrazy/router7/builddir/github.com/gokrazy/serial-busybox"
2024-09-11 08:47:35 +02:00
Michael Stapelberg a59c9ad5f4 FindExtraFiles: unify packages to consider with sbom logic
This fixes 'gok -i hello sbom' when the hello instance
directory (~/gokrazy/hello) has an empty build directory.

related to #51
2024-09-09 17:20:29 +02:00
Michael Stapelberg a2dd9b9a09 sbom: move os.Chdir into 'gok sbom' (but not gokr-packer)
fixes #51
2024-09-09 17:20:07 +02:00
Michael Stapelberg d9a4bf387a update gokrazy/internal: fix bootloader 15/16 MB kernel size limit
related to https://github.com/gokrazy/gokrazy/issues/248
2024-08-27 21:09:36 +02:00
Michael Stapelberg fbd9e5d9cc GitHub Actions: delete unused LSIF workflow 2024-08-27 20:45:50 +02:00
Michael Stapelberg 809775d2b7 go.mod: bump language version to go 1.22 (oldest supported release) 2024-08-27 20:45:30 +02:00
Michael Stapelberg f7db22daab gotool: add missing -tags=gokrazy for list
I noticed this while working on the integration test.
2024-08-18 21:39:22 +02:00
George Hopkins de5f76c883 Support i386/x86 platforms (#75) 2024-08-18 16:15:51 +02:00
Michael Stapelberg d0d0a0a6ae GitHub Actions: stick to go 1.22 until telemetry is fixed 2024-08-18 11:10:46 +02:00
Michael Stapelberg 9f81add3a9 kernelGlobs: include overlay_map.dtb
See “The overlay map file” in the Raspberry Pi Configuration docs:
https://www.raspberrypi.com/documentation/computers/configuration.html#part2.2.10

related to https://github.com/gokrazy/gokrazy/issues/273
2024-07-30 21:25:48 +02:00
oliverpool 05d1f9d1a0 Fix building when GOBIN is set in the GOENV file (#73)
compute basename manually when target is missing

fixes #71
2024-07-06 08:25:14 +02:00
Anup Chenthamarakshan fe5fe168ac Support non-default FirstPartitionOffsetSectors (#70)
Support devices that require non-default space before the first partition
starts (4MiB). Required to enable booting Rock64 devices
2024-07-04 17:50:25 +02:00
oliverpool e53ba4e609 Satisfy staticcheck (#74)
* remove deprecated ioutil usage

* use more suitable functions

* add missing error handling

* remove unused variables

* select{} instead of for{}
2024-07-04 17:35:15 +02:00
Michael Stapelberg 41f11fbe3a pull in latest gokrazy/internal for default kernel switch
related to https://github.com/gokrazy/gokrazy/issues/223
2024-06-23 11:10:41 +02:00
Michael Stapelberg efa3f22802 packer: prevent accidental overwrites on boot partition
related to https://github.com/gokrazy/gokrazy/issues/264

Currently, both the gokrazy/firmware and the gokrazy/kernel.rpi repository
contain an overlays directory. The desired state is that only gokrazy/kernel.rpi
contains an overlays directory, as that is the repository from which the
overlays are built (whereas the are only copied into the firmware repository).

To prevent confusion between different versions, the packer now returns an error
instead of silently overwriting files on the boot partition when there are
multiple sources for a file.
2024-06-23 10:34:02 +02:00
Michael Stapelberg 3919dda31d packer: error out on invalid ExtraFilePaths
Before this change, the packer created an empty directory unconditionally,
which resulted in surprising errors in programs like breakglass.

closes https://github.com/gokrazy/breakglass/issues/19
2024-06-15 18:09:21 +02:00
Michael Stapelberg 0798935a7a packer: rename to addExtraFilesFromDir 2024-06-15 17:57:14 +02:00
Brad Fitzpatrick ee071a0b95 internal/packer: use new UpdateOpts.NoPassword (#69)
Updates gokrazy/gokrazy#265
Updates tailscale/tailscale#1866

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-06-09 10:38:39 +02:00
Michael Stapelberg 34b02e215b include mount device config in /etc/gokrazy/mountdevices.json
related to https://github.com/gokrazy/gokrazy/issues/236
2024-05-10 19:03:41 +02:00
Michael Stapelberg f7be03f9cb create mount device targets in /mnt
related to https://github.com/gokrazy/gokrazy/issues/236
2024-05-10 19:03:19 +02:00
Michael Stapelberg 06656d4340 bump language version to go 1.21 (oldest supported release) 2024-05-10 17:46:08 +02:00
Michael Stapelberg 04de7ab994 create /var as a symlink to /perm/var instead of empty directory
The /var directory is meant to hold data that changes (see hier(7)).

With the previous behavior, users had to bind-mount a writable
and persistent directory over /var, for example as documented in
https://gokrazy.org/packages/docker-containers/

With this commit, there is one fewer hurdle to get podman running.
2024-05-10 17:40:40 +02:00
Michael Stapelberg 80a59f1153 dirhash: use zip.CheckDir() to find valid files
The sumdb/dirhash package was built to work with extracted Go module zip files,
but we are working with directories on local disk (working copies).

So, to reflect what the Go tool would see as source code,
we now use the same code.

Specifically, the old approach failed with symbolic links to directories,
because it treated them as regular files (Go module zips do not contain
irregular files such as symlinks).
2023-12-22 09:00:07 +01:00
Michael Stapelberg d7eafaef08 write BootloaderExtraLines to config.txt
related to https://github.com/gokrazy/gokrazy/issues/216
2023-12-15 15:19:30 +01:00
Mark Dietzer 60c9d51572 Copy .dtbo overlays from firmware repo as well (#67) 2023-12-15 08:59:47 +01:00
Michael Stapelberg aa3507219c pull in latest gokrazy/internal for FAT writer fix 2023-12-15 08:58:53 +01:00
Michael Stapelberg c2c21f612c warn about slow GOPROXY=direct setting 2023-11-05 16:24:03 +01:00
Michael Stapelberg dceb56ee39 pull in gokrazy/internal for updateflag.BaseURL change 2023-10-31 19:32:10 +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
Mark Dietzer c6f9ca1dab Add ability to have sub-path globs and include overlays (#63)
Add ability to have sub-path globs and include overlays/*.dtbo from kernel package
2023-10-20 10:48:15 +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
Michael Stapelberg 231dea4b57 gok edit: run $EDITOR/$VISUAL through /bin/sh -c
This makes command line arguments in these environment variables work,
e.g. 'code -w', or 'emacs -q'

fixes https://github.com/gokrazy/gokrazy/issues/217
2023-09-21 19:13:28 +02:00
Michael Stapelberg 23cde3b0d8 fix build on non-linux: run go list with the required environment 2023-08-12 10:57:38 +02:00
Michael Stapelberg c5e8689f03 build init in github.com/gokrazy/gokrazy
fixes https://github.com/gokrazy/gokrazy/issues/210

fixes https://github.com/gokrazy/gokrazy/pull/178
2023-07-28 08:45:52 +02:00
Michael Stapelberg 25116b2f79 GitHub Actions: switch to setup-go@v4, which enables caching 2023-07-23 17:37:27 +02:00
Michael Stapelberg fa33ef8830 packer: set 022 umask to ensure the o+x bit is present
fixes https://github.com/gokrazy/gokrazy/issues/205
2023-07-13 18:06:18 +02:00
Michael Stapelberg 56839a456a packer: fix incorrect parent association in mkdirp()
A bug was triggered when the file system contained two directories with the same
basename, because all directories were incorrectly associated with the root
directory.

fixes https://github.com/gokrazy/tools/issues/58
2023-06-29 22:20:40 +02:00