6 Commits

Author SHA1 Message Date
Michael Stapelberg
5b15ffbd42 packer: move unix-specific code into build tag guarded files
related to https://github.com/gokrazy/tools/issues/89
2025-05-29 16:17:58 +02:00
Olivier Mengué #openToWork-Paris
b8127bc462 overwrite: show setfacl suggestion only on Linux (#90)
When acquiring access to partition the device, show message about use of
"setfacl" only on Linux. Not on Darwin where it is irrelevant.
2025-03-21 21:36:30 +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
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
Mark Drayton
a515c601c0 parttable: pass HOME env var to sudo (#44)
Without passing $HOME into the `sudo` invocation the instance parent
directory detection
(https://github.com/gokrazy/internal/blob/main/instanceflag/instanceflag.go#L19)
fails:

  $ gok -i test overwrite --full /dev/sdc
  [..]
  2023/01/25 22:13:04 partitioning /dev/sdc (GPT + Hybrid MBR)
  2023/01/25 22:13:04 Using sudo to gain permission to format /dev/sdc
  2023/01/25 22:13:04 If you prefer, cancel and use: sudo setfacl -m u:${USER}:rw /dev/sdc
  2023/01/25 22:13:04 open os.UserHomeDir failed: $HOME is not defined/gokrazy/test/config.json: no such file or directory
  2023/01/25 22:13:04 exit status 1

This commit does the necessary passing.
2023-01-25 23:22:13 +01:00
Michael Stapelberg
434e942c97 refactor packer code into internal/packer, add gok update entrypoint
related to https://github.com/gokrazy/gokrazy/issues/147
2023-01-07 16:01:35 +01:00