73 Commits

Author SHA1 Message Date
Maciej Borzecki
fc5b004454 Merge remote-tracking branch 'upstream/master' into bboozzoo/uc20-recovery-capable-system 2021-09-06 19:30:29 +02:00
Miguel Pires
aa623a49ea many: remove unused parameters and returns 2021-09-02 17:44:34 +01:00
Maciej Borzecki
716e920ad4 boot: rename to MarkRecoveryCapableSystem
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-08-23 18:26:13 +02:00
Maciej Borzecki
5d8b8efc1e boot: record recovery capable system during install
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-07-19 14:52:36 +02:00
Maciej Borzecki
09829e9f4e boot: tweak naming, rename SignKeyID to ModelSignKeyID
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-06-11 10:08:10 +02:00
Maciej Borzecki
3e7f75369c boot: set sign-key-id when making the system bootable
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-06-10 17:01:39 +02:00
Samuele Pedroni
37c1255389 boot/image: support image.Customizations.BootFlags
to achieve this change the signature of MakeBootableImage (also drop
now unused argument)

setImageBootFlags needed adjustments and also the tests using it
2021-04-30 21:15:38 +02:00
Maciej Borzecki
0e547e485b boot: use prepare image time flag when making a recovery system bootable
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-21 12:16:43 +02:00
Maciej Borzecki
8d5f4293ee boot: split out a helper for making recovery system bootable
Split out bits that make the recovery system bootable. Those will be used
independently when creating a recovery system and setting it up for boot.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-20 13:40:16 +02:00
Maciej Borzecki
f070eda096 boot: set kernel command line arguments when making the new run system usable
When setting up the run system, set the kernel command line arguments provided
by the gadget.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-12 10:21:10 +02:00
Maciej Borzecki
08fa3319de Merge branch 'bboozzoo/uc20-cmdline-in-recovery-system' into bboozzoo/uc20-cmdline-in-run-mode 2021-04-12 10:20:52 +02:00
Maciej Borzecki
973781113b boot: set extra kernel command line arguments when making a recovery system bootable
When preparing an image, make sure that the recovery system contains the kernel
command line arguments requested by the gadget.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-09 14:13:38 +02:00
Maciej Borzecki
e32bf4c136 boot: extend command line helpers to take gadget path
Extend the kernel command line helpers to take additional parameters.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-04-08 12:27:13 +02:00
Ian Johnson
4bc7604050 boot/makebootable.go: adjust MakeBootableImage doc-comment
Thanks to @pedronis for the suggestion.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-03-11 11:49:38 -06:00
Ian Johnson
216271e125 boot/makebootable.go: drop rootdir from MakeRunnableSystem
This parameter is no longer used.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-03-11 11:45:29 -06:00
Ian Johnson
98078d6ee5 boot, o/devicestate: split makeBootable20 into two parts
Split makeBootable20 into two parts, one MakeRunnableSystem and
MakeBootableImage, with the former being exclusively for image-prepare time ops,
and the latter being for UC20 install mode preparing an active run system.

Additionally, for MakeRunnableSystem, remove out the final bit which sets the
boot variables and officially marks the point at which the system is ready to be
rebooted into the run mode. This will allow us to refactor the install mode
changes more easily in a future commit, but for now we get the same behavior
with EnsureNextBootToRunMode() in the install mode setup-run-system task.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-03-09 20:25:47 -06:00
Ian Johnson
f1e5bf72c7 Revert "Merge pull request #10009 from anonymouse64/feature/uc20-install-device-hook-1"
This reverts commit 349548bb99, reversing
changes made to 2e2cff7c18.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-03-09 14:20:18 -06:00
Ian Johnson
e037910636 boot: export bootAssetsMap as AssetsMap
We need this to be exported to be able to serialize a trusted asset observer
across multiple tasks during UC20 install mode. The only state that is not
currently observable from filesystem state are the keys and the boot asset maps
for tracked assets here. The keys can easily be saved in state.json to
serialize, but the boot asset map needs to be exported to be able to serialize
it in the state.json across tasks.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-03-08 16:00:10 -06:00
Maciej Borzecki
4e42aa7be7 boot: record current system as good when installing
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-02-18 14:37:45 +01:00
Maciej Borzecki
e0d25b56ee boot: write modeenv only once when making the run system bootable
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-12-01 11:34:58 +01:00
Maciej Borzecki
b7907d925a boot: set kernel command line in modeenv during install
Populate modeenv with kernel command line during installation.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-30 14:15:53 +01:00
Michael Vogt
38698f3fd6 devicestate: implement boot.HasFDESetupHook (#9667)
* devicestate: implement boot.HasFDESetupHook

This commit adds support for boot.HasFDESetupHook and matching
tests.

* devicestate: move hasFDESetupHook setup into delayedCrossMgrInit()

* boot,devicestate: use deviceCtx to get fde-setup hook data

* devicestate: improve TestHasFdeSetupHook test

* devicestate: tweak TestHasFdeSetupHook further

* boot,devicestate: remove "bootWith" from SealKeyToModeenv() again

* boot: tweak error message

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* o/devicestate: tweak error messages and comments

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

Co-authored-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-11-19 14:38:03 +01:00
Michael Vogt
267eac412f boot: add scaffolding for "fde-setup" hook support for sealing
* boot: add scaffolding for "fde-setup" hook support for sealing

Add intial support for sealKeyToModeenv() to support running
a "fde-setup" hook instead of using the build-in secboot
implementation for key sealing.

This is broken out of the larger
https://github.com/mvo5/snappy/tree/fdehook-skeleton-2
branch.

* boot: tweak naming/coments for HasFDESetupHook/RunFDESetupHook

* boot: collect the fde hook functions into a single var stanza

Co-authored-by: Samuele Pedroni <pedronis@lucediurna.net>
2020-11-18 13:16:02 +01:00
Ian Johnson
5caf44461f boot/makebootable.go: set snapd_recovery_mode=install at image-build time
This is the first step to doing away with the current default of
snapd_recovery_mode being unset implying "install". We need prepare-image (and
thus also ubuntu-image) to start writing "snapd_recovery_mode=install".

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2020-11-16 18:24:14 -06:00
Maciej Borzecki
efb9aef377 Merge pull request #9643 from bboozzoo/bboozzoo/uc20-bootloader-install-boot-config-cleanup
bootloader: use ForGadget when installing boot config
2020-11-16 13:57:44 +01:00