It is desired that the seal/reseal code only operates on the input provided in
modeenv rather than poking other external structures. The change decouples the
lower level code from accessing the model directly.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
to achieve this change the signature of MakeBootableImage (also drop
now unused argument)
setImageBootFlags needed adjustments and also the tests using it
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>
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>
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>
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>
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>
When setting up a UC20 run mode system, the bootloader config may have been
installed when populating the ubuntu-boot partition. However, for trusted assets
bootloader which have their configuration managed directly by snapd, the config
will only be installed though an explicit call to InstallBootConfig().
Tweak the code to use the gadget snap to identify the right bootloader.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>