69 Commits

Author SHA1 Message Date
Miguel Pires
db9c63b734 many: remove unused code 2021-08-26 18:24:02 +01:00
Maciej Borzecki
8b7473d0de bootloader/bootloadertest: mock a mix of TrustedAssetsBootloader and RecoveryAwareBootloader
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-22 11:25:18 +02:00
Maciej Borzecki
f0d20ddc84 bootloader/bootloadertest: provide mixins for interface implementations
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-22 11:25:18 +02:00
Maciej Borzecki
abb058121f boot, bootloader: tweak naming of panic injection helper
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-19 13:27:10 +02:00
Maciej Borzecki
6c4c7c713d bootloader/bootloadertest: make panic inject part of the base mock bootloader
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-16 18:42:15 +02:00
Maciej Borzecki
98da32f4ef bootloader: introduce full set of command line arguments, refactor trusted bootloader interface
Introduce a structure for passing components of kernel command line. Extend the
structure with a field to carry the full set of arguments. Introduce support in
grub.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-15 19:20:21 +02:00
Maciej Borzecki
80968beb6c bootloader/bootloadertest: allow setting up a function for mocked SetBootVars errors
This gives slightly more flexibility in mocking different failure modes.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-02-10 15:47:49 +01:00
Ian Johnson
e3d7c4f378 Merge pull request #9673 from anonymouse64/feature/uc20-lk-bootloader-4-take-2
bootloader/many: rm ConfigFile, add Present for indicating presence of bloader

Now we have a specific method on the Bootloader interface which tells Find()
whether the specific bootloader is actually present on the current system. This
will simplify future bootloader implementations to be able to return errors when
identifying if a bootloader is present on the system is more complicated a
question than just if the config file for that bootloader exists.

This is required for the UC20 lk bootloader work, where the Present() implementation will be more complicated than just whether a file exists.
2020-11-23 18:24:52 -06:00
Maciej Borzecki
d50fb3bc01 bootloader/bootloadertest: update mock bootloader
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-20 13:52:13 +01:00
Ian Johnson
e4ab1c5ca9 bootloader/many: rm ConfigFile, add Present for indicating presence of bloader
Now we have a specific method on the Bootloader interface which tells Find()
whether the specific bootloader is actually present on the current system. This
will simplify future bootloader implementations to be able to return errors when
identifying if a bootloader is present on the system is more complicated a
question than just if the config file for that bootloader exists.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-19 15:39:56 -06:00
Maciej Borzecki
00b07447f1 bootloader: use ForGadget when installing boot config
Address TODO added during UC20 development and use a ForGadget helper when
installing boot configs of a bootloader.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-13 14:30:38 +01:00
Maciej Borzecki
579fc64e73 bootloader, boot: drop IsCurrentlyManaged check
The check is no longer needed.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-29 09:42:35 +02:00
Maciej Borzecki
330bebb454 bootloader: comment tweaks, drop unnecessary mock
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-25 14:32:55 +02:00
Maciej Borzecki
98486c0010 Revert "bootloader: drop GetRecoverySystemEnv, drop from grub, update mocks"
This reverts commit 2618d31eba.
2020-09-25 14:18:36 +02:00
Maciej Borzecki
2618d31eba bootloader: drop GetRecoverySystemEnv, drop from grub, update mocks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-24 14:06:36 +02:00
Maciej Borzecki
bc755dccb3 many: move ManagedAssetsBootloader into TrustedAssetsBootloader, drop former
Drop the ManagedAssetsBootloader, all its methods become part of
TrustedAssetsBootloader. Update relevant locations.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-23 17:17:16 +02:00
Claudio Matsuoka
e78ae47f85 bootloadertest: capture boot chain arguments
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-02 16:00:56 -03:00
Claudio Matsuoka
48edbb4bcd bootloader,bootloadertest: verify if run mode bootloader is grub
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-02 14:12:16 -03:00
Claudio Matsuoka
d3396f43d5 bootloadertest: fix bootchain to return previously mocked values
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-02 13:17:42 -03:00
Claudio Matsuoka
b7e1d10111 bootloader/bootloadertest: implement boot chain functions
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-01 23:14:42 -03:00
Maciej Borzecki
10380e4982 bootloader/bootloadertest: add mocked trusted assets bootloader
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-08-13 13:35:15 +02:00
Maciej Borzecki
9ec3747d0a bootloader: extend managed assets bootloader interface to compose a candidate command line
Where the candidate command line is based on the current internal edition of the
asset.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-07-29 12:26:38 +02:00
Maciej Borzecki
53d73392e0 bootloader, bootloader/btldrtest: make mode and system argument explicit
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-07-27 16:22:08 +02:00
Maciej Borzecki
01f968f1ef bootloader/bootloadertest: fix mocked managed assets bootloader command line
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-07-15 22:47:40 +02:00
Maciej Borzecki
9b9a74effe bootloader: tweak CommandLine interface, pass extra and mode arguments
Try to keep the separation between boot and bootloader packages. Tweak the
ManagedAssetsBootloader interface, so that extra command line arugments and mode
arguments are passed directly in the CommandLine call. This is preferable to
having the bootloader query boot vars directly.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-07-14 09:51:48 +02:00