100 Commits

Author SHA1 Message Date
Maciej Borzecki
d4f888598f boot, bootloader: extend unit tests, bump year
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-15 19:21:46 +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
Ian Johnson
8275345afc bootloader: add check for prepare-image time and more tests validating options
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-12-03 12:03:07 -06:00
Ian Johnson
421c677428 bootloader: remove installableBootloader interface and methods
This is not used anywhere anymore, so let's just drop it. If we need it again,
we can bring it back.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-30 17:49:09 -06: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
Ian Johnson
5a717a278a bootloader: refactor static set of bootloaders to list instead of a map
This is simpler and avoids from having to maintain the list of names of
bootloaders in three locations, one in the bootloader implementation itself, one
in the gadget.yaml bootloader setting, and one in Find(). Now we just have the
bootloader implementation and the gadget.yaml validator.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-20 09:03:22 -06:00
Ian Johnson
e3df360d41 Revert "bootloader/bootloader.go: refactor ForGadget slightly"
This reverts commit 072b8847eb.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-20 08:56:03 -06:00
Maciej Borzecki
900faa90f6 bootloader: indicate when boot config was updated
Indicate when the bootloader boot config was updated. This allows the callers to
take a better decision as to whether an update or some other action is required.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-20 13:31:44 +01:00
Ian Johnson
072b8847eb bootloader/bootloader.go: refactor ForGadget slightly
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-19 15:39:56 -06: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
a13a6f7e8f image, bootloader: comment tweaks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-16 09:05:02 +01: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
479a54bfef bootloader: document some methods do not need rootdir
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-10-09 13:51:58 +02: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
6ff7100e3e bootloader: comment tweaks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-24 14:08:30 +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
Michael Vogt
19e8c663f0 Merge pull request #9257 from cmatsuoka/uc20-bootloader-get-bootchains
bootloader: retrieve boot chains from bootloader
2020-09-03 09:21:05 +02: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
a11c8c958a bootloader: comment tweaks
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-02 13:24:19 -03:00
Michael Vogt
d95b45688b bootloader: tweak doc comments (thanks Samuele)
Followup from #9250
2020-09-02 12:59:38 +02:00
Claudio Matsuoka
694a5230e7 bootloader: retrieve boot chains from bootloader
Add functions to get the recovery and run mode boot chains from a
trusted bootloader.

Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-01 21:24:11 -03:00
Claudio Matsuoka
8a4ceee322 many: refactor bootfile fields
Change Path and Relative fields to Snap and Path.

Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
2020-09-01 16:15:13 -03:00