401 Commits

Author SHA1 Message Date
Michael Vogt
2af863e2aa Merge pull request #11068 from alfonsosanchezbeato/piboot
bootloader: add support for piboot
2022-03-18 10:03:03 +01:00
Alfonso Sánchez-Beato
59cf517516 bootloader/bootloader_test: remove now unneeded test case 2022-03-16 17:22:29 +01:00
Alfonso Sánchez-Beato
5a399f258d bootloader/piboot: create empty env file always
It does not really make sense to ship a non-empty environment in the
gadget, so remove that case.
2022-03-16 17:22:26 +01:00
Alfonso Sánchez-Beato
419092ecc1 bootloader/piboot.md: add better description of config files and fix typo 2022-03-16 17:20:40 +01:00
Alfonso Sánchez-Beato
fdf5ae865d bootloader: add some additional unit tests for piboot 2022-03-15 11:16:47 +01:00
Alfonso Sánchez-Beato
ef4036c5a2 b/piboot.go: do not use snapd_*_cmdline_args and rename some methods
snapd_*_cmdline_args only apply to TrustedAssetsBootloader interface,
that is not implemented by piboot. Also, rename a couple of methods
with better names.
2022-03-15 11:16:47 +01:00
Michael Vogt
439f267378 many: replace use of "sanity" for interface implementation checks
This commit replaces the use of "sanity" with more inclusive
naming. When `// sanity` is used to check if an interface is
implemented the comment `expected interface is implemented`
is used.
2022-03-14 17:35:33 +01:00
Samuele Pedroni
550fad4640 bootloader: allow different names for the grub binary in different archs
Merge pull request #11282 from alfonsosanchezbeato/grub-multiarch

Currently, the grub binary name is always grubx64.efi. However, for
arm64 the usual name is Ubuntu us grubaa64.efi. Make it dependent on
architecture, so one or the other is expected in each case. This will
allow using grub on arm64 systems.
2022-03-01 11:57:19 +01:00
Alfonso Sánchez-Beato
cccf9997f5 bootloader/piboot: minor GetBootVars() refactor 2022-02-28 14:51:53 +01:00
Alfonso Sánchez-Beato
6161322b65 bootloader/piboot.md: fix some errors in documentation 2022-02-28 14:49:54 +01:00
Alfonso Sánchez-Beato
5519698c94 bootloader/piboot: simplify mocking of seed dir
Just using a variable is enough, intstead of simulating by a function.
2022-02-23 16:25:58 +01:00
Alfonso Sánchez-Beato
b3a12846f5 bootloader/piboot: implement RebootBootloader interface
Implement RebootBootloader interface so now piboot does not write the
reboot arguments when kernel is set to "try" state - instead piboot
will return those areguments when required, right before calling
shutdown.
2022-02-23 16:25:51 +01:00
Alfonso Sánchez-Beato
8c240a75aa bootloader: make sure to revert seed partition directory
Otherwise we could point to data from  previous test if not calling
again MockPibootFiles().
2022-02-23 16:23:53 +01:00
Alfonso Sánchez-Beato
8a519f46b1 boot,bootloader: add error parameter to GetRebootArguments() 2022-02-23 16:23:53 +01:00
Alfonso Sánchez-Beato
2543d2c2e3 Merge branch 'master' into piboot 2022-02-22 15:38:12 +01:00
Alfonso Sánchez-Beato
ead29039b9 bootloader/grub_test.go: remove now unused variable 2022-02-16 12:22:11 +01:00
Alfonso Sánchez-Beato
5903d72f39 bootloader: use AddCleanup instead of TearDownTest in tests
Use AddCleanup from the test suite instead of relying on TearDownTest
to clean-up state after a test finishes.
2022-02-16 12:01:06 +01:00
Alfonso Sánchez-Beato
077fbe2a03 bootloader/grub_test: add multi-arch support 2022-02-15 19:12:34 +01:00
Alfonso Sánchez-Beato
347b73cbee bootloader/grub: check for prepare image time when retrieving boot assets 2022-02-15 19:11:34 +01:00
Alfonso Sánchez-Beato
f2fdf40bf0 bootloader: include grub prefix in some names uin grub.go 2022-02-14 19:06:08 +01:00
Alfonso Sánchez-Beato
721bf78f27 bootloader: use different boot assets in grub depending on arch
Make the choosing of boot assets dependent dynamically on arch instead
of having static names. This will facilitate overriding by environment
variables if needed in the future.
2022-02-14 10:49:04 +01:00
Alfonso Sánchez-Beato
41cb1b79f7 b/assets: revert grub-recovery.cfg edition to 1 again
There is no need for the bump as no new features are added by using
gnu_arch in the grub script.
2022-02-11 15:44:19 +01:00
Alfonso Sánchez-Beato
660db7bf77 bootloader: use different grub binaries in different arch
Use different grub binaries in different architectures, by checking
the grub_cfg variable in the grub recovery script. Also, increase the
config edition for grub-recovery.cfg.

Provide the different names for the assets in snapd by using constants
in files tagged for different architectures.
2022-02-11 12:31:02 +01:00
Alfonso Sánchez-Beato
7d489d7129 boot: add tests for RebootInfo 2022-02-04 14:01:24 +01:00
Alfonso Sánchez-Beato
a51858b1e7 bootloader: rename RebootArgumentsBootloader interface to RebootBootloader 2022-02-02 18:12:39 +01:00