100 Commits

Author SHA1 Message Date
Alfonso Sánchez-Beato
b849263ac6 Merge branch 'master' into reboot-from-bootpkg 2022-02-21 15:37:32 +01:00
Ian Johnson
af77b3fb0d many: move boot.Device to snap.Device
This is a purely mechanical change because it touches so many files, the real
interesting parts we need that prompted this will be followups.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-02-18 11:59:29 -06:00
Alfonso Sánchez-Beato
f1e4c57df4 boot: minor refactor
Fix typo and move function to a better place.
2022-02-16 11:47:56 +01:00
Alfonso Sánchez-Beato
09543ee333 boot: rename Rbl to RebootBootloader in RebootInfo 2022-02-14 12:32:52 +01:00
Alfonso Sánchez-Beato
08b0a7262b boot: address review comments 2022-02-08 13:44:01 +01:00
Alfonso Sánchez-Beato
5d8a45a87f boot: return error in getRebootBootloader() 2022-02-04 10:42:13 +01:00
Alfonso Sánchez-Beato
9374574af5 boot: introduce RebootInfo type
Now SetNextBoot() will return a RebootInfo struct that will include a
bootloader.RebootBootloader interface, instead of just a bool
indicating if rebooting is required. This allows to obtain additional
information from the bootloader while rebooting.
2022-02-02 18:13:57 +01:00
Maciej Borzecki
613ad35c7b boot: populate sign-key-id on successful boot
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-06-10 17:03:43 +02:00
Maciej Borzecki
49bb96be37 boot: drop unnecessary no-slash-boot flag, comment tweaks, leave TODO
Thanks to @pedronis and @anonymouse64 for suggestions.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-14 19:37:01 +02:00
Maciej Borzecki
4c8fd0edb4 boot: rename to UpdateCommandLineForGadgetComponent
Thanks to @pedronis for the suggestion

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-14 13:52:39 +02:00
Maciej Borzecki
0e4abc9f9b boot: update component contributing to kernel command line
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-13 16:33:47 +02:00
Maciej Borzecki
4c1b6a7677 boot, overlord/devicestate: use gadget command line when updating boot configs
Make sure that gadget command line is considered when updating boot configs

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-13 10:32:14 +02:00
Maciej Borzecki
479d921481 boot: populate good recovery systems on boot in a compatibility scenario
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-02-18 14:37:45 +01:00
Maciej Borzecki
17da1a72cd boot: no update boot config error on non-UC20
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-11 13:48:03 +01:00
Maciej Borzecki
4f2e2a7c78 boot: observe boot config update and reseal as needed
Observe when boot config gets update and reseal the keys as needed for both the
curre and candidate kernel command lines if those are different.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-09 12:21:07 +01:00
Maciej Borzecki
c848e8ec51 boot: support updating managed boot configs
Add helper to perform an update of managed boot configs when supported.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-09 10:14:30 +01:00
Maciej Borzecki
12d858b50d boot: observe successful command line update, provide a default
Add bootstate handling for observing a successful command line update. At the
same time, provide backwards compatibility for the systems built before tracking
of current kernel command lines was introduced in modeenv and set one on
successful boot.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-01 12:55:05 +01:00
Maciej Borzecki
2066fff4d1 boot: reseal when changing kernels
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-12 20:12:43 +02:00
Maciej Borzecki
58e5be103d boot: add model to the Device
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-12 20:12:43 +02:00
Maciej Borzecki
b7bf504171 boot: tweak mark successful with boot assets, tweak comments, extend tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-04 16:06:45 +02:00
Maciej Borzecki
9901b4dd51 boot: mark successful with boot assets
Analyze which trusted assets we booted with and update the modeenv so that only
the assets on disk are listed in the boot assets map. Unused assets are dropped
form the cache.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-09-04 09:45:00 +02:00
Samuele Pedroni
f34137a809 boot,bootloader,gadget: apply new bootloader.Options.Role
introduce bootloader.Options.Role to cover more generically
what was covered before by the Recovery and ExtractedRunKernelImage
flags

the default is RoleSole = "" which applies to the sole bootloader
for UC16/18

adjust tests and comments
2020-08-31 21:56:26 +02:00
Ian Johnson
f6282589b8 boot/bootstate20: unify commit method impls, rm bootState20MarkSuccessful
Refactor the various structs in bootstate20.go to use a common bootStateUpdate
implementation with a single commit() method that is used for all scenarios.
This is necessary because we will soon need to reseal against the TPM when
we commit boot state changes, so having that happen in one place will greatly
simplify things.

This unification allows us to remove one of the structs,
bootState20MarkSuccessful entirely, and allows us to greatly reduce the
amount of state that the bootState20Kernel and bootState20Base structs
carry around.

Also fix a typo in the comment for revisions(), as isTrySnapError is not
exported anymore.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-08-07 07:02:55 -05:00
Ian Johnson
6e8b54c91b Merge branch 'master' into feature/uc20-snap-bootstrap-refactor-middle-ground-4
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-04-02 16:18:20 -05:00
Maciej Borzecki
9679c0bd15 boot: naming, comment, message tweaks, UC20 specific TODOs
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-03-31 19:51:29 +02:00