146 Commits

Author SHA1 Message Date
Joonas Kuorilehto
ab6fc6e02a Fix short name with short primary and long extension (#7)
Fixes gokrazy/internal#5
2020-07-13 10:41:55 +02:00
Michael Stapelberg
539bb61868 updater: use crc32 for checksumming when available
This is significantly faster than sha256 on the Raspberry Pi 4:
update speeds increase from ≈12 MB/s to ≈55 MB/s.
2020-06-26 11:05:05 +02:00
Michael Stapelberg
6897d2a79a move API to Target struct 2020-06-26 10:54:33 +02:00
Michael Stapelberg
71ca43da01 introduce updater.Target struct 2020-06-26 10:46:47 +02:00
Michael Stapelberg
dd941cf696 set InsecureSkipVerify if -insecure is specified 2020-06-01 14:00:25 +02:00
Michael Stapelberg
d96421c600 handle upgrade path (location: header missing) 2020-05-31 21:46:36 +02:00
Michael Stapelberg
0ad69b1961 remove status code check after all
I was about to add Unauthorized to the list, but I think we should just remove
it after all , as it seems brittle.
2020-05-31 21:46:12 +02:00
Michael Stapelberg
bcf56cab3e don’t use TLS at all if -tls is empty 2020-05-31 21:45:59 +02:00
Michael Stapelberg
d0cf397b47 GetTLSHttpClientByTLSFlag: check if tls flag is non-empty 2020-05-31 21:29:35 +02:00
Janis Streib
220f580f3a Specify the httpClient (part of gokrazy/gokrazy#7) (#4)
This allows us to use a custom httpClient with own trusted certificates.
2020-05-31 11:28:57 +02:00
Michael Stapelberg
5369c1985e config: don’t require os.UserConfigDir() to work at func init
This broke the packer’s sudo privilege elevation code path.
2020-05-30 20:59:35 +02:00
Michael Stapelberg
389acc6d08 add PARTUUID() 2020-05-30 19:04:18 +02:00
Michael Stapelberg
2cb9182fef factor host-specific config reading into internal/ 2020-05-27 18:35:28 +02:00
Michael Stapelberg
7e4057347a move iface package from github.com/gokrazy/gokrazy to internal
related to https://github.com/gokrazy/gokrazy/issues/57
2020-05-27 08:34:29 +02:00
Michael Stapelberg
9da9028582 travis: use go 1.14 2020-04-07 10:02:21 +02:00
Michael Stapelberg
660ad467b7 updater: add TargetSupports()
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 09:58:22 +02:00
Michael Stapelberg
37efc446ad declare a go module 2020-04-07 08:55:09 +02:00
Michael Stapelberg
f93ff050da rootdev: add accessors for partitions, deal with PARTUUID=
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 08:54:35 +02:00
Michael Stapelberg
cee26266a0 mbr: include partuuid in disk signature
related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 08:53:57 +02:00
Michael Stapelberg
edd739cb2e shave off 1 bootloader byte to make space for the disk signature
Previously, the bootloader occupied 441 bytes, but we need it to fit within 440
bytes to place the disk signature in the remaining 6 bytes before the partition
table.

related to https://github.com/gokrazy/gokrazy/issues/52
2020-04-07 08:53:48 +02:00
Michael Stapelberg
de21a662e4 travis: update to Go 1.12 2019-06-30 11:10:51 +02:00
Michael Stapelberg
faec26b22a internal/fat: fix unusableClusters after previous commit 2019-06-30 11:10:30 +02:00
Michael Stapelberg
c3231df868 fat/writer: represent first 2 FAT entries in w.fat
Before this commit, the special first two entries (media descriptor copy, file
system state) were only written out in writeFAT.

For the edge case where the two entries are what pushes the FAT from one sector
to the next, this resulted in incorrect fatSectors calculation.
2019-06-30 11:03:35 +02:00
Michael Stapelberg
23a986872b move root device finding function to internal/rootdev 2018-07-14 23:33:57 +02:00
Michael Stapelberg
8037b85c92 return an error when a specific update handler (e.g. MBR) is unimplemented 2018-07-13 23:54:42 +02:00
Michael Stapelberg
d29e68b650 add UpdateMBR 2018-07-12 09:27:19 +02:00
Michael Stapelberg
377f208063 nasm.go: gofmt generated source 2018-07-08 21:55:17 +02:00
Michael Stapelberg
f1fa8f1224 mbr: load cmdline from LBA (like kernel), add Configure function 2018-07-07 00:11:25 +02:00
Michael Stapelberg
60b5366ebd add mbr/bootloader.asm
from https://sebastian-plotz.blogspot.com/2012/07/1.html
2018-07-07 00:09:34 +02:00
Michael Stapelberg
d9943d7e3e Merge pull request #1 from stapelberg/squashfs
Add a SquashFS writer
2018-06-21 19:28:46 +02:00
Michael Stapelberg
ccf5171e9f squashfs: use zlib.BestSpeed
This reduces the time to generate images for my largest gokrazy installation
from 3.5s to 1.6s, while only increasing the file size from 32M to 36M.
2018-06-21 19:22:43 +02:00
Michael Stapelberg
80f452e9c9 squashfs: write ldirInodeHeaders for large directories
The dirInodeHeader type only uses a uint16 for the size of the directory
entries, which is sometimes not sufficient (and before this change would
overflow, resulting in directories which seemed to miss files).
2018-06-20 23:45:44 +02:00
Michael Stapelberg
e220cec663 squashfs: use correct offset for writing parent inode 2018-06-19 08:41:35 +02:00
Michael Stapelberg
ff98b2beb2 squashfs: fall back to uncompressed blocks for Linux compatibility 2018-06-19 08:41:25 +02:00
Michael Stapelberg
59a20ece5c squashfs: fix compressed block flushing of larger files 2018-06-10 14:04:25 +02:00
Michael Stapelberg
8c59fbd82f squashfs: fix file size calculation when using more than one block 2018-06-10 14:03:07 +02:00
Michael Stapelberg
ab3bfa03ae squashfs: turns out inode blocks are offsets (e.g. 8194), not block numbers 2018-06-10 14:02:13 +02:00
Michael Stapelberg
32d3607ae8 Add a SquashFS writer 2018-06-10 13:57:34 +02:00
Michael Stapelberg
8508a2c816 Bugfix: exempt special . and .. entries from leading dot stripping 2018-05-16 18:24:07 +02:00
Michael Stapelberg
5ba2f5ad38 FAT: add support for long file names
This is in preparation for adding Raspberry Pi 3 B+ support, for which we’ll
need to let the firmware locate the DTB file under file names such as
bcm2710-rpi-3-b-plus.dtb.

Note that short names are not upper-cased currently (the standard says they
should, but neither the firmware nor the linux kernel care) so that upgrades
from older gokrazy installations work. In a year or so, we can change this.
2018-05-16 09:33:23 +02:00
Michael Stapelberg
dafaf92bf7 fat: add Reader.ModTime() for the timestamps package 2017-09-06 09:37:57 +02:00
Michael Stapelberg
482fe4e5c6 fat: store timestamps in UTC (Linux interprets them in UTC) 2017-09-06 09:37:30 +02:00
Michael Stapelberg
ebb63d7e97 fat: store seconds correctly (divide, not multiply) 2017-09-06 09:37:13 +02:00
Michael Stapelberg
e166c599fa update import paths 2017-07-14 03:18:19 +02:00
Michael Stapelberg
580b69f8dc Move FAT16B writer from github.com/gokrazy/fat to internal 2017-07-14 03:14:28 +02:00
Michael Stapelberg
eb0895d70f Initial commit 2017-03-04 11:12:34 +01:00