420 Commits
Author SHA1 Message Date
Michael Stapelberg ce33e62bcd packer: pi 3 → pi 3 or 4
related to https://github.com/gokrazy/gokrazy/issues/48
2020-06-19 08:59:31 +02:00
Michael Stapelberg 5329ccbb1c packer: skip signature for recovery.bin (not part of the EEPROM) 2020-06-19 08:39:40 +02:00
Michael Stapelberg de64b88472 packer: include EEPROM files from github.com/gokrazy/rpi-eeprom
Specify an empty -eeprom_package= flag to not include any EEPROM updates.

related to https://github.com/gokrazy/gokrazy/issues/48
2020-06-18 21:08:11 +02:00
Michael Stapelberg d080103072 packer: pass through -insecure
This fixes disabling TLS via a network update.
2020-06-01 14:04:02 +02:00
Janis Streib 3d2ae8ed96 gokr-packer: TLS support (#7) (#14)
The new `-tls` parameter is empty by default, retaining the current behavior (no change).

If `-tls=self-signed` is specified, the packer generates and signs a RSA4096 certificate, stored in the host-specific config directory, e.g. typically `~/.config/gokrazy/<hostname>/{cert,key}.pem` on Linux.

If `-tls=<certpath>[,<keypath>]` is specified, the packer uses the specified certificate and key.

When TLS is used, the certificate/key is included in the gokrazy root file system at  `/etc/ssl/{web,web_key}.pem`.

To switch an unencrypted (HTTP) installation to HTTPS, use the `-insecure` flag for the first update, e.g.:
`gokr-packer -tls=self-signed -insecure …`
…then remove it for all subsequent updates, which will now be done via HTTPS:
`gokr-packer -tls=self-signed …`
2020-05-31 23:19:06 +02:00
Michael Stapelberg 3f33129918 pull in newer gokrazy/internal 2020-05-30 21:00:39 +02:00
Michael Stapelberg 4d98088ffe refactor ensurePasswordFileExists to use internal/config 2020-05-27 18:37:13 +02:00
Michael Stapelberg 2196ee2eab packer: allow host-specific configuration of the HTTP password
The gokrazy configuration directory is named “gokrazy” underneath
https://golang.org/pkg/os/#UserConfigDir, which on Linux typically
resolves to ~/.config/gokrazy.

The global HTTP password stored in http-password.txt within that
directory will still be used, but in case a host-specific override
directory exists, that directory has priority.

E.g., if you wanted to set up a gokrazy installation named “dev”
for live-coding on a public twitch stream, you could:

  % host_specific=~/.config/gokrazy/hosts/dev/
  % mkdir -p $host_specific
  % echo -n publicly-leaked-on-stream > $host_specific/http-password.txt

This technique was originally contributed by @janisstreib in
https://github.com/gokrazy/tools/pull/14
2020-05-27 18:05:39 +02:00
Michael Stapelberg a11ea1b259 print PARTUUID= all uppercase to match root= kernel cmdline format 2020-05-01 10:02:09 +02:00
Michael Stapelberg 887bfb76f1 packer: use absolute path when using sudo 2020-04-09 09:36:35 +02:00
Michael Stapelberg 703b26aa27 packer: also include *.upd and *.sig (for Raspberry Pi 4 EEPROM)
releated to https://github.com/gokrazy/gokrazy/issues/48
2020-04-09 09:33:23 +02:00
Michael Stapelberg 776fce5eca travis: use go 1.14 2020-04-07 10:06:38 +02:00
Michael Stapelberg 87444dca50 packer: check target supports partuuid before using it in cmdline
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 10:00:48 +02:00
Michael Stapelberg 5501e3c235 packer: don’t use PARTUUID= in cmdline.txt when updating yet
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 09:26:06 +02:00
Michael Stapelberg 156ba20b17 packer: write PARTUUID=
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 09:02:08 +02:00
Michael Stapelberg 27bcb247d9 packer: print suggestion upon -EROFS 2020-01-16 22:38:08 +01:00
Michael Stapelberg 5a50ad0a49 packer: verify DNS resolution works
fixes #12
2019-10-21 19:01:21 +02:00
Michael Stapelberg 46ded5b93b packer: use password from update URL if provided
fixes #13
2019-10-21 17:53:39 +02:00
mikioh 3364436881 cmd/gokr-packer: add missing rereadPartitions for darwin (#11)
This change makes it possible to use the combination of gokr-packer and
image manipulation tools like balenaEtcher on macOS.
2019-03-08 15:38:47 +01:00
Michael Stapelberg c9faf0ad81 travis: switch to go1.12 2019-03-08 11:29:51 +01:00
Michael Stapelberg 1bbb70b90d README: use sdx to prevent mistakes 2019-02-07 14:40:40 +01:00
Michael Stapelberg f352a9f6d1 gofmt parttable.go 2019-01-05 23:04:46 +01:00
Michael Stapelberg b3188e62b2 travis: update to Go 1.11 2019-01-05 23:02:41 +01:00
Michael Stapelberg d5a93c3f7e localtime: correct path to Go’s zoneinfo.zip 2019-01-05 23:01:43 +01:00
Michael Stapelberg 2c4d21a7dd localtime: fall back to Go’s zoneinfo.zip
And don’t error out if that’s missing. gokrazy can still boot.
2019-01-05 22:38:12 +01:00
Michael Stapelberg 6219658570 use sudo to elevate privileges when required
fixes #9
2018-11-01 16:59:56 +01:00
Michael Stapelberg 09013ce6e2 -override: verify no partitions of the target device are mounted 2018-11-01 09:48:12 +01:00
Michael Stapelberg 09e23c73a7 -overwrite: seek instead of relying on re-reading the partition table
This makes the packer more flexible with regards to permissions: write
permissions for the target device are now sufficient.

The downside is that the SD card needs to be unplugged and re-plugged before the
persistent file system can be created (if desired).

related to https://github.com/gokrazy/tools/issues/9
2018-11-01 09:46:34 +01:00
Michael Stapelberg c0b0f8c450 /dev/loop uses p<num> syntax for partitions, too 2018-10-26 20:52:26 +02:00
Michael Stapelberg 7075e42531 completeness check: spell out -gokrazy_pkgs default 2018-10-19 18:27:52 +02:00
Michael Stapelberg 6b72ed5692 completeness check: include github.com/gokrazy/gokrazy for init 2018-10-19 18:27:30 +02:00
Michael Stapelberg 25fb563340 parttable: use linux type for root partitions (Thanks lichti) 2018-10-18 17:41:06 +02:00
Michael Stapelberg 4c8bec4443 don’t error on unimplemented MBR update handler
(for backwards compatibility)
2018-07-13 23:55:13 +02:00
Michael Stapelberg 117f7cc504 get kernel/firmware repository at runtime, not build time
This avoids unnecessary downloads/disk usage when not using the standard
kernel/firmware repositories.
2018-07-13 23:26:42 +02:00
Michael Stapelberg c74380b015 move writeMBR to write.go for consistency 2018-07-12 09:56:28 +02:00
Michael Stapelberg 7b3a628a7c add MBR log message 2018-07-12 09:56:01 +02:00
Michael Stapelberg 3af2dd8298 update MBR, too 2018-07-12 09:26:55 +02:00
Michael Stapelberg 5b02a8488e Bugfix: don’t accidentally shadow isDev (for -overwrite with -update) 2018-07-12 09:24:45 +02:00
Michael Stapelberg d32bdc71ea Bugfix: swap rootSize/bootSize for -overwrite=<file> with -update 2018-07-12 09:12:59 +02:00
Michael Stapelberg 9511aecee3 introduce -overwrite_mbr flag 2018-07-11 08:36:59 +02:00
Michael Stapelberg fe4f39371f packer: ensure CGO_ENABLED=0 2018-07-10 08:12:50 +02:00
Michael Stapelberg aac9d9deb1 packer: give more helpful -target_storage_bytes error messages 2018-07-08 22:03:19 +02:00
Michael Stapelberg 41b65e1d8a -serial_console: use argument in console= directive
The special value UART0 is still supported for backwards compatibility.

This change makes using the serial console possible on platforms which don’t use
ttyAMA0.
2018-07-08 22:03:19 +02:00
Michael Stapelberg b6511f99a7 packer: include MBR bootloader 2018-07-08 22:03:17 +02:00
Michael Stapelberg 7130054859 introduce -gokrazy_pkgs flag 2018-07-07 00:07:36 +02:00
Michael Stapelberg e77cf46fc7 introduce -kernel_package and -firmware_package flags 2018-07-07 00:06:00 +02:00
Michael Stapelberg c6e37c01a3 lift 8.3 file name length restriction 2018-06-21 23:26:44 +02:00
Michael Stapelberg 8dc67f0a9e populate /etc in the file system
Now that symlinks and long file names are supported, we no longer need to mount
a tmpfs on /etc and install a bunch of hacks.
2018-06-21 23:24:15 +02:00
Michael Stapelberg 1450d301b4 Use Squashfs for the root file system (instead of FAT)
This paves the way for a bunch of other cleanups, such as full file names (no
more 8.3) or symbolic links, allowing us to clean up our directory structure.

Also, thanks to Squashfs’s compression, images are smaller and hence updates are
faster: a 95M FAT image shrinks to a 36M Squashfs image, reducing the update
time from about 20s to about 7s.
2018-06-21 19:23:48 +02:00
Michael Stapelberg 3b53372b3e take default -update value from GOKRAZY_UPDATE environment variable
related to https://github.com/gokrazy/gokrazy/issues/38
2018-03-29 11:59:04 +02:00