940 Commits

Author SHA1 Message Date
Michael Vogt
2af863e2aa Merge pull request #11068 from alfonsosanchezbeato/piboot
bootloader: add support for piboot
2022-03-18 10:03:03 +01:00
Alfonso Sánchez-Beato
3cf6f0eda6 boot/initramfs_test: add test case and change method name 2022-03-16 17:20:40 +01:00
Alfonso Sánchez-Beato
559d98ca30 boot/initramfs.go: use osutil to parse kernel command line 2022-03-16 17:20:40 +01:00
Michael Vogt
44498b937c Merge pull request #11470 from bboozzoo/bboozzoo/factory-reset-seal-keys
boot: support factory-reset when sealing and resealing
2022-03-16 12:48:12 +01:00
Alfonso Sánchez-Beato
115dcc9ad7 boot/initramfs_test.go: fix typo 2022-03-15 11:16:47 +01:00
Michael Vogt
277eb06412 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming.

When `sanity` is used in a more general sense either `validity`
or `quick` is used.
2022-03-14 18:22:34 +01:00
Maciej Borzecki
2529bd5be0 boot: drop unnecessary check for system modes
There is a more relevant per system check done further in the code path

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-14 11:35:05 +01:00
Maciej Borzecki
af77d93964 boot: tweak the order in which current and tried systems are processed for their modes
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-14 10:48:07 +01:00
Maciej Borzecki
e328a854dc boot: seal and reseal keys for factory-reset mode
Consider factory-reset mode when sealing and resealing keys. Allow factory-reset
mode only for tested recovery systems.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-07 13:56:53 +01:00
Maciej Borzecki
6a9529858c boot: compose command line for factory-reset mode
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-07 13:44:07 +01:00
Maciej Borzecki
c18bbb6068 boot: add factory-reset to valid modes
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-07 13:44:00 +01:00
Maciej Borzecki
d49dd52f57 boot: mock amd64 arch for mabootable 20 suite
One last fix for tests failing on non amd64:

----------------------------------------------------------------------
FAIL: makebootable_test.go:791: makeBootable20Suite.TestMakeRunnableSystem20RunModeSealKeyErr

makebootable_test.go:893:
    c.Assert(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"cannot copy trusted asset to cache: read /tmp/check-855608922/49/run/mnt/ubuntu-seed: is a directory"} ("cannot copy trusted asset to cache: read /tmp/check-855608922/49/run/mnt/ubuntu-seed: is a directory")

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-03 13:48:36 +01:00
Maciej Borzecki
3bf7f8a53f boot: mock amd64 architecture in relevant unit tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-02 08:31:08 +01:00
Alfonso Sánchez-Beato
ce12dc8aa7 boot: improve comment in updateNotScriptableBootloaderStatus 2022-02-28 14:49:54 +01:00
Alfonso Sánchez-Beato
8a519f46b1 boot,bootloader: add error parameter to GetRebootArguments() 2022-02-23 16:23:53 +01:00
Paweł Stołowski
5d2f85153e Merge branch 'master' into core20-preseed/pick-system 2022-02-22 16:44:22 +01:00
Alfonso Sánchez-Beato
2543d2c2e3 Merge branch 'master' into piboot 2022-02-22 15:38:12 +01:00
Samuele Pedroni
e46e2c612e gadget/install: measure and save disk volume traits during install.Run()
Merge pull request #11374 from anonymouse64/feature/uc20-multi-volume-gadget-asset-updates-26

This file will be necessary later on when we perform multi-volume gadget asset
updates.

This will be necessary later on when we perform multi-volume gadget asset
updates.

Also adjust install mode unit tests for install.Run() to check this file too.

Also test for the disk-mapping.json in some spread tests too.
2022-02-22 15:29:33 +01:00
Alfonso Sánchez-Beato
e14b3b1fe4 boot/bootstate20: add some additional comments 2022-02-22 10:03:30 +01:00
Paweł Stołowski
34ab067fb7 Merge branch 'master' into core20-preseed/pick-system 2022-02-21 16:07:16 +01:00
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
0d3ed98d8b boot/reboot: panic if not mocked on tests 2022-02-18 10:39:31 +01:00
Ian Johnson
11491e16cb boot/initramfs20dirs.go: add InstallHostDeviceSaveDir
Its value is expected to be /run/mnt/ubuntu-save/device.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-02-16 20:55:37 -06:00
Alfonso Sánchez-Beato
9c20cc6199 boot: move EnableTestingRebootFunction to export_test
As we are not going to use it outside boot package anymore.
2022-02-16 17:12:56 +01:00