Skip to content
Snippets Groups Projects
Commit d92bf6dd authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

boot/piboot: rewrite PiBoot based on BootConfig


This replaces the scaffolding added early on in the life cycle of the
project, which did crude string replacements and had flawed assumptions,
with a system which deeply understands the boot configuration file and
manipulates it based on the primitives we've built recently. This
approach has prevented us from ever updating any of the relevant OS boot
files with new images.

The new pre-install hook extracts the /boot directory from the system
image and saves it to /boot/slot-{a,b} matching the slot conveyed by
RAUC with the RAUC_SLOT_BOOTNAME_$n (either "A" or "B"). The config.txt
file is analyzed to find the location of the cmdline.txt file, which is
modified to have root= pointing to RAUC_SLOT_DEVICE_$n. This creates a
boot sub-directory with complete set of consistent
kernel/initrd/cmdline/device tree/overlays.

The TrySwitch method queries for the inactive slot, loads the
slot-$inactive/config.txt, pretending that slot-$inactive is the real
/boot directory, as this helps in finding files like cmdline.txt, sets
the os_prefix= to slot-$inactive/ and saves the entire configuration to
tryboot.txt in the real /boot directory.

The QueryActive method changes to look for os_prefix=slot-a/ or
os_prefix=slot-b/. We no longer look at individual parameters or ensure
they have a consistent prefix. Usage of os_prefix= was a long-standing
TODO which is now resolved.

Later on a separate validation step will ensure, that none of the
essential parameters avoids the A/B system or points to non-existent
file.

Apart from piboot, the prepare phase of the spread test suite for piboot
is updated to provide more realistic data. The smoke test is replaced
with a "rauc install" command, exercising the entire stack in one go.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent 3aaa6127
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment