420 Commits
Author SHA1 Message Date
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
Michael Stapelberg 5b8d8ebd00 packer: ensure eeprom package is present, too
fixes https://github.com/gokrazy/tools/issues/24
2021-02-22 09:15:20 +01:00
Michael Stapelberg fd0b073737 packer: add -testboot flag
related to https://github.com/gokrazy/gokrazy/issues/75
2021-01-30 18:56:23 +01:00
Michael Stapelberg 9e2217c2fd pad cmdline with enough space for during-testboot kernel parameters
related to https://github.com/gokrazy/gokrazy/issues/75
2021-01-30 18:55:40 +01:00
andig 86f779c5f0 Split package build flags (one per line) (#23) 2021-01-18 09:39:32 +01:00
Michael Stapelberg aa957668af packer: report config files for packages + last modification time
related to https://github.com/gokrazy/gokrazy/issues/65
2021-01-17 19:14:40 +01:00
Michael Stapelberg 135ad236ac packer: pick up extra environment variables from env/<pkg>/env.txt
The file format is one key=val pair per line (\n-separated).

Preparation example:

mkdir -p env/github.com/gokrazy/timestamps
echo 'FOO=bar' > env/github.com/gokrazy/timestamps/env.txt

Packer example:

gokr-packer -update=yes -hostname=gokrazy \
  github.com/gokrazy/breakglass \
  github.com/gokrazy/timestamps \
  github.com/gokrazy/serial-busybox

You can check the effect locally by adding -overwrite_init=/tmp/init.go to your
gokr-packer invocation and examining /tmp/init.go afterwards.

related to https://github.com/gokrazy/gokrazy/issues/65
2021-01-17 18:47:58 +01:00
andig eed7270eba Support custom build flags (#21) 2021-01-13 09:07:46 +01:00
Michael Stapelberg 588704f522 packer: increase -target_storage_bytes lower bound (for /perm)
The previous lower bound was technically correct, but not very user-friendly.
The new lower bound arranges for a 100 MB /perm partition by default.
2021-01-10 15:13:17 +01:00
Michael Stapelberg 49dfc09d9e update gokrazy/gokrazy to latest 2021-01-08 09:12:44 +01:00
Michael Stapelberg 5e9cfcb6e9 packer: write /etc/gokr-pw.txt with mode 0400
When using privilege separation, non-root users cannot read the device password
anymore.

related to https://github.com/gokrazy/gokrazy/issues/76
2021-01-07 08:57:29 +01:00
andig 2708a2ca2a Print correct uri when http(s)_port ist used (#20) 2021-01-07 08:43:33 +01:00
Michael Stapelberg f31e3ce19b bump dependencies to latest versions 2021-01-06 22:31:47 +01:00
Michael Stapelberg e15b6ea744 updater: use new github.com/gokrazy/updater package 2021-01-06 22:20:02 +01:00
Michael Stapelberg 608ca46ed4 packer: use new github.com/gokrazy/updater package 2021-01-06 22:03:29 +01:00
Michael Stapelberg 90d0f0f832 packer: add -http_port and -https_port flags (persisted to /etc)
related to https://github.com/gokrazy/gokrazy/pull/77
related to https://github.com/gokrazy/gokrazy/issues/74
2021-01-06 18:19:43 +01:00
Michael Stapelberg fdd90fc681 packer: pick up extra command-line flags from flags/<pkg>/flags.txt
The file format is one flag per line (\n-separated).

Preparation example:

mkdir -p flags/github.com/gokrazy/timestamps
echo '--ohai' > flags/github.com/gokrazy/timestamps/flags.txt

Packer example:

gokr-packer -update=yes -hostname=gokrazy \
  github.com/gokrazy/breakglass \
  github.com/gokrazy/timestamps \
  github.com/gokrazy/serial-busybox

Resulting stderr:

1970/01/01 01:00:09 gokrazy: attempt 0, starting [/user/timestamps --ohai]

You can check the effect locally by adding -overwrite_init=/tmp/init.go to your
gokr-packer invocation and examining /tmp/init.go afterwards.

related to https://github.com/gokrazy/gokrazy/issues/65
2021-01-04 16:54:11 +01:00
andig f17e3ee018 Don't apply https when -insecure requested (#19)
Fix https://github.com/gokrazy/tools/issues/18
2021-01-04 12:48:19 +01:00
Michael Stapelberg 3ba8b7f3a8 switch from travis to GitHub actions 2020-12-30 10:24:10 +01:00
Darshil Chanpura 11d5a9c4ef Updating to have correct command for mounting root (#16) 2020-12-08 08:25:02 +01:00
Michael Stapelberg ea3341009e pull in new gokrazy for gokrazy.Model() 2020-06-26 12:02:34 +02:00
Michael Stapelberg 3f3b73e556 init: print hostname and model
This helps identify devices after you forget about them :)
2020-06-26 11:58:16 +02:00
Michael Stapelberg c3fceda232 pull in new updater for crc32 checksumming 2020-06-26 11:05:52 +02:00
Michael Stapelberg 170b0422a0 switch gokr-updater to new updater API, too 2020-06-26 10:59:19 +02:00
Michael Stapelberg 71c8662bff switch to new updater API 2020-06-26 10:56:42 +02:00
Michael Stapelberg a664377a48 packer: use go build with tempdir instead of go install
fixes https://github.com/gokrazy/tools/issues/2
2020-06-21 09:08:31 +02:00
Michael Stapelberg 2d49867a09 packer: describe available consoles 2020-06-21 08:27:29 +02:00
Michael Stapelberg 49c46f2511 packer: support symlinks in -overwrite=, use partuuid in mkfs
This allows us to use e.g. -overwrite
/dev/disk/by-id/usb-TS-RDF5_SD_Transcend_000000000037-0:0
2020-06-21 08:05:14 +02:00
Michael Stapelberg c2553c9cb8 packer: set expectations. startup on the pi 4 can be slow. 2020-06-21 07:45:35 +02:00
Michael Stapelberg faba15fa08 gotool: plumb through stderr
related to https://github.com/gokrazy/tools/issues/15
2020-06-20 11:33:12 +02:00
Michael Stapelberg 09a065cae0 include commands in error messages
related to https://github.com/gokrazy/tools/issues/15
2020-06-20 10:50:26 +02:00