Commit Graph

19 Commits

Author SHA1 Message Date
Hugo Osvaldo Barrera 1aca349c90 Attempt to trigger automounts to find the ESP
The ESP may be an automount partition, so try touching a file in each
candidate location so as to trigger an automounts.

This is the same way systemd attempts to find it:
https://github.com/systemd/systemd/blob/f565b86/src/shared/bootspec.c#L1014-L1018

I've also changed the function to return an error if no ESP is found.
The previous behaviour (an empty string) just results in a crash later
on.

When no ESP is found, the `bundle` command will have no default for the
`esp` flag. Passing an empty string to it as a default results in no
value being show in the output of `--help`.

This seemed like the most reasonable compromise instead of panicking.

Fixes #78
2021-06-28 20:37:56 +02:00
Morten Linderud 070702abda
Removed extra print logging
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-06-12 21:22:09 +02:00
Morten Linderud 57a1c93eb9
Remove last of the log.* stuff
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:47:45 +02:00
Morten Linderud 97435cc48e
More internal restructuring
Move more logic top-level, move prints to top-level

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:46:07 +02:00
Morten Linderud 3505f1b571
New structure
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:46:05 +02:00
Morten Linderud d0022cb3b2
Added BundleIter
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:43:05 +02:00
Morten Linderud fb9b3c7b33
🤷
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:43:05 +02:00
Morten Linderud b82e17e2ed
Return errors when generating bundles
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:43:04 +02:00
Morten Linderud 0d249b25df
Added bundle cli format
Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:43:03 +02:00
Morten Linderud ba6dfc183e
sbctl/bundle: Do not default to ESP for fetching kernel and initramfs
Most distros (I think) default to stuffing this into `/boot` so our ESP
selection is going to mess this up more often then not.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-30 14:15:02 +02:00
igo95862 d3feae2791
Remove ioutil
Deprecated in GO 1.16
2021-05-16 21:14:42 +03:00
Morten Linderud 35ebd7bba9
bundles: Handle command not found errors
Fixes #64

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-05-13 12:33:58 +02:00
igo95862 e55ef14bf4
Redirect objcopy stderr to parent stderr 2021-05-05 11:15:50 +03:00
igo95862 02885c41db
Use argument list for objcopy instead of split by whitespace
The order of .splash argument has changed but I don't
believe it will have an effect on result.
2021-05-05 11:01:35 +03:00
Morten Linderud 36a1849942
sbctl/bundle: Change default cmdline to /etc/kernel/cmdline
Should probably try include some documentation to this, but this changes
the default from /proc/cmdline to /etc/kernel/cmdline.

This is partially a standard and a bit more flexible for everyday use
for most people.

https://www.freedesktop.org/software/systemd/man/kernel-install.html

Fixes #39

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-04-05 16:24:19 +02:00
Érico Rolim f94f185652 Use ReadOrCreateFile in ReadBundleDatabase.
Using the function also removed code that had hardcoded globals for the
location of some files instead of using the dbpath parameter.

Add error checking around the function where appropriate.

Also fail early when creating a new bundle if it isn't possible to
access the bundle database.

Signed-off-by: Érico Rolim <erico.erc@gmail.com>
2021-01-11 00:51:32 -03:00
Morten Linderud 3279c9eed5
sbctl: Ensure we can also find gummiboot stub
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-08 19:08:43 +02:00
George Rawlinson f24e11f773
Fix some minor typos in documentation & CLI output
Signed-off-by: George Rawlinson <george@rawlinson.net.nz>
2020-05-21 05:59:24 +12:00
Morten Linderud 0b5d4a46ea
Init
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-05-03 19:41:09 +02:00