This will be necessary for more complicated test cases in the gadget package,
so time to rip this band-aid and get rid of the old methods.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Some packaging frameworks (dh-golang in partcular) invokes go generate. Our code
calls `go run ..` to generate some output files. In particular, when building
with Go modules support, we must pass -mod=vendor occasionally. Allow the build
code to set an environment variables with flags that shall be passed to go run.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Update the recovery grub boot config to allow all system labels that are
considered valid by snapd, which are typically just numbers based on date, eg.
20210706 but follow the same rules as model names so hyphen separated
numbers/letters are allowed.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
had to make the comment in wrappers/services_test.go a one-liner
otherwise half of it is lost
last set of files needing changing (as per current master)
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>
Add support for snapd_full_cmdline_args variable that carries a set of command
line arguments that shall be used in place of the static and extra ones. Thus
the contents of the new variable effectively become the list of arguments that
directly follows `snapd_recovery_mode=.. snapd_recovery_system=...` in the
kernel command line passed by grub.
The boot config edition is not bumped yet, thus it will not trigger an automatic
boot config update when a new snapd gets installed.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Add try_recovery_system and recovery_system_status to the boot variables tracked
inside little kernel bootloader's environment.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Add support for injecting bootloader assets and corresponding snippets in test
builds of snapd. The code is only picked up when building with
withbootassetstesting tag.
The snippets are injected only when a specific marker file is present in the
same directory as the snapd binary. This way it is possible to control when a
snapd snap update will trigger an update of boot config assets of the grub
bootloader.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>