Commit Graph

400 Commits

Author SHA1 Message Date
Michael Stapelberg
1938385a69 do not add empty strings to package list with empty -gokrazy_pkgs= 2022-02-26 19:25:54 +01:00
Michael Stapelberg
01fcfcf8fd packer: remove extra “v” from version 2022-02-26 19:21:42 +01:00
Michael Stapelberg
c64054cdc5 set -mod=mod for now-first go tool invocation 2022-02-24 22:25:00 +01:00
Michael Stapelberg
0fde06653c packer: pick up _gokrazy/extrafiles/ within package dirs, too
This allows e.g. the github.com/gokrazy/wifi package to include firmware files
that end up in the root file system.

related to https://github.com/gokrazy/gokrazy/issues/13
2022-02-24 20:45:22 +01:00
Michael Stapelberg
686d00738e packer: follow symlinks 2022-02-24 20:37:02 +01:00
Michael Stapelberg
5d79ef259c packer: include loadable kernel modules from kernel repository
related to https://github.com/gokrazy/gokrazy/issues/13
2022-02-22 23:25:04 +01:00
Anup Chenthamarakshan
45e6b6fc6c Update github.com/gokrazy/internal version (#30) 2022-01-30 14:37:02 +01:00
Michael Stapelberg
3d62cd2257 remove branch restriction, enable CI for pull requests 2022-01-13 09:40:32 +01:00
Darshil Chanpura
0dec06d488 packer: implement waitforclock per-package config files (#29)
This allows wait for the clock to be synced before starting the service
2022-01-13 09:39:42 +01:00
Michael Stapelberg
30e91460ce errors.As should be errors.Is in this case
We’re not comparing a type, but a specific error value.
2022-01-13 09:24:17 +01:00
Anup Chenthamarakshan
8bb7e491ea packer: allow using MBR partition tables (#28)
Some ARM devices (like Odroid XU4/HC1/HC2) only support MBR booting.
Allow generating MBR partition table for such devices.
2022-01-13 09:20:34 +01:00
Michael Stapelberg
71af7271f4 packer: do not add empty -eeprom_package to list 2021-12-27 09:34:36 +01:00
Michael Stapelberg
31d26e1e37 increase timeout from 1m to 5m, for slower devices
Larger installations can take over a minute to start up.
2021-12-27 08:48:53 +01:00
Michael Stapelberg
3bb6d56203 packer: implement dontstart per-package config files
This is useful when including non-service binaries in the image, such as the
tailscale CLI.
2021-12-18 19:51:38 +01:00
Michael Stapelberg
d8eb163b39 packer: poll device until it reports the new build timestamp 2021-12-15 15:28:52 +01:00
Michael Stapelberg
a33ad86c63 gok run: automatically follow logs after uploading
related to https://github.com/gokrazy/gokrazy/issues/88
2021-12-15 14:52:22 +01:00
Michael Stapelberg
07d209a9ed implement gok logs command for streaming logs
Log streaming was implemented in https://github.com/gokrazy/gokrazy/pull/100

related to https://github.com/gokrazy/gokrazy/issues/88
2021-12-15 14:32:03 +01:00
Anup Chenthamarakshan
8127d75153 packer: ignore firmware globs if -firmware_package is empty (#27)
Don't accidentally pick up firmware files from CWD if -firmware_package is unset
2021-12-01 08:54:02 +01:00
Michael Stapelberg
688793dda2 better error message when the binary was not installed 2021-11-21 21:53:20 +01:00
Michael Stapelberg
157ff3011f refactor into internal 2021-11-21 17:01:03 +01:00
Michael Stapelberg
34f3ddd1ac introduce gok CLI
This is a subcommand based CLI for gokrazy.

Its first subcommand is “run”, to be used like so:

  cd ~/scan2drive/cmd/scan2drive
  gok run --instance=scan2drive

related to https://github.com/gokrazy/gokrazy/issues/88
2021-11-21 17:01:03 +01:00
Michael Stapelberg
0900ca05de go.mod: use language version go 1.17 2021-11-21 15:23:47 +01:00
Michael Stapelberg
a99f2c5561 move gotool.go into packer package for upcoming re-use 2021-11-21 09:50:50 +01:00
Michael Stapelberg
21d99992a1 packer: findBins must be called after build 2021-11-20 18:43:13 +01:00
Michael Stapelberg
c8145dc98d report progress (and rate) while uploading boot/root file system 2021-11-20 18:37:58 +01:00
Michael Stapelberg
7318b6cbe7 interactively report progress for boot/root file system creation 2021-11-20 18:19:06 +01:00
Michael Stapelberg
77f6c75da6 tidy up boot file system summary 2021-11-20 17:48:57 +01:00
Michael Stapelberg
c363800e98 remove .go file name from user-facing messages 2021-11-20 17:48:10 +01:00
Michael Stapelberg
69a3b3932f packer: tidy up build summary 2021-11-20 17:01:47 +01:00
Michael Stapelberg
9ae769dee0 cacerts: log → fmt 2021-11-20 16:52:01 +01:00
Michael Stapelberg
b65fcafb54 packer: print status indicator when running go build 2021-11-20 16:51:36 +01:00
Michael Stapelberg
fd36cf8872 packer: print host and target environment 2021-11-20 16:50:05 +01:00
Michael Stapelberg
24e042947c packer: print build timestamp 2021-11-20 16:49:24 +01:00
Michael Stapelberg
3249037807 GitHub actions: branch rename 2021-11-20 11:18:40 +01:00
Michael Stapelberg
4c92f5fc06 GitHub Actions: switch to Go 1.17, run tests 2021-11-20 11:13:00 +01:00
Michael Stapelberg
3342126429 use github.com/breml/rootcerts as fallback system CA certificates
fixes https://github.com/gokrazy/gokrazy/issues/98
2021-11-20 11:12:32 +01:00
Michael Stapelberg
2e02ea7acd fix: move guid_test to the packer package 2021-11-20 11:12:32 +01:00
Michael Stapelberg
de96a68f36 gofmt with go 1.17 2021-10-24 18:25:02 +02:00
Michael Stapelberg
df18adcb4e update to latest gokrazy/... packages 2021-10-24 18:24:08 +02:00
Michael Stapelberg
8736bc10b5 -update: obey -http_port, implement syntax :80
-update=:80 means -update=yes, but on port 80 regardless of -http_port.
2021-10-24 18:21:35 +02:00
Benjamin Böhmke
c6536fc744 Include extrafiles/<package>/* in root file system (#26)
This configuration works similar to https://gokrazy.org/userguide/package-config/ and can be used to include data files that are not easy to embed into the package itself, nor appropriate to go on the `/perm` partition (i.e. should be versioned/distributed with the gokrazy image).
2021-06-28 19:24:05 +02:00
Michael Stapelberg
997ca6b27e ignore ReadMsgUnix flags return value
This returns MSG_CMSG_CLOEXEC since https://github.com/golang/go/issues/42765
(for Go 1.17).

I don’t recall why we should need to check the flags in the first place. Perhaps
that was a mistake when the code was first introduced.
2021-06-24 15:36:05 +02:00
Michael Stapelberg
bea67498b5 Switch to GPT partition tables, add systemd-boot for UEFI boot
This is useful for running gokrazy on PC platforms (e.g. for
https://router7.org/), where the first systems without legacy BIOS support are
starting to ship.

The existing boot methods (Legacy BIOS MBR boot, Raspberry Pi) are unaffected by
this change and keep working.

Regardless of the bootloader (BIOS, UEFI, Raspberry Pi), we now use a GPT
partition table with hybrid MBR (= protective MBR + FAT32 /boot partition
which the Raspberry Pi bootloader requires).

This change should have no effect on existing installations.

To switch to GPT, you’ll need to use the -overwrite= flag to partition the
device (e.g. SD card). If you want to keep your /perm partition, you’ll need to
shrink the file system (using resize2fs) by 1 MB to make space for the secondary
GPT partition table copy at the end of the device.

Previously, the partition *table* contained a UUID that we used as root=
parameter for the Linux kernel, e.g. root=PARTUUID=471cad93-03

Now, individual partitions (not the partition *table*) have a UUID that begins
with 60c24cc1-f3f9-427a-8199,
e.g. root=PARTUUID=60c24cc1-f3f9-427a-8199-2e18c40c0004

fixes https://github.com/gokrazy/gokrazy/issues/87
2021-06-24 13:52:55 +02:00
Michael Stapelberg
0eb14eb8e1 specify -tags gokrazy when calling go list, too
This fixes building packages where all files use the gokrazy build tag.
2021-06-17 17:59:53 +02:00
Michael Stapelberg
ddba679fac partition table: make space for secondary GPT at the end of the disk
See https://en.wikipedia.org/wiki/GUID_Partition_Table
The Secondary GPT uses LBA -33 to LBA -1
2021-06-17 09:28:26 +02:00
Michael Stapelberg
929442d467 gotool: skip -eeprom_package if unspecified
Before this commit, the tool would try to “go get .”, which won’t necessarily
work.
2021-06-17 09:28:26 +02:00
Michael Stapelberg
e20e78958e packer: remove -mod=mod from go get call
Only go list and go build support the -mod flag.
2021-06-17 09:28:26 +02:00
Michael Stapelberg
11cde81bb7 allow configuring gokrazy system packages, too (e.g. dhcp) 2021-05-27 08:48:45 +02:00
Michael Stapelberg
97aac5cffd Run go tool with -mod=mod to automatically download missing modules 2021-05-24 11:55:57 +02:00
Mark Bryars
e39dd5e7c9 Add mkfs.ext4 instructions with --overwrite mode (#25)
Allows easy creating of perm partition when making image files.

related to https://github.com/gokrazy/gokrazy/issues/
2021-04-21 11:14:34 +02:00