Jan Čermák 48bf9b5056
Move rauc.db to boot partition (#3810)
* Move rauc.db to boot partition

The RAUC metadata file contains information that is tightly related to the
system and kernel partitions. With the possibility to migrate data disk, the
rauc.db can contain bogus information when moved to a different system. Removal
of the file on "device wipe" is also not desirable, because the information
about slot status is lost.

Relocate the rauc.db to the boot partition after a system upgrade (as this
can't be handled by RAUC hooks, because it needs to be executed after all slots
and metadata is written) and adjust the script for recreating it. The downside
is that its content in /mnt/data would be recreated if the boot slot is changed
or system downgraded but this should be handled quite gracefully.

Also remove the raucdb-first-boot service which is no longer necessary
with the file not present in the data partition.

* Fix shellcheck and mount path
2025-01-21 18:40:07 +01:00

51 lines
994 B
Groovy

[system]
compatible={{ env "ota_compatible" }}
mountprefix=/run/rauc
statusfile=/mnt/boot/rauc.db
{{- if eq (env "BOOTLOADER") "tryboot" }}
bootloader=custom
{{- else }}
bootloader={{ env "BOOTLOADER" }}
{{- end }}
{{- if eq (env "BOOTLOADER") "grub" }}
grubenv=/mnt/boot/EFI/BOOT/grubenv
{{- end }}
{{- if eq (env "BOOTLOADER") "tryboot" }}
[handlers]
bootloader-custom-backend=/usr/lib/rauc/rpi-tryboot.sh
{{- end }}
[keyring]
path=/etc/rauc/keyring.pem
[slot.boot.0]
device=/dev/disk/by-partlabel/hassos-boot
type=vfat
allow-mounted=true
{{- if eq (env "BOOT_SPL") "true" }}
[slot.spl.0]
device=/dev/disk/by-partlabel/hassos-boot
type=raw
{{- end }}
[slot.kernel.0]
device=/dev/disk/by-partlabel/hassos-kernel0
type=raw
bootname=A
[slot.rootfs.0]
device=/dev/disk/by-partlabel/hassos-system0
type=raw
parent=kernel.0
[slot.kernel.1]
device=/dev/disk/by-partlabel/hassos-kernel1
type=raw
bootname=B
[slot.rootfs.1]
device=/dev/disk/by-partlabel/hassos-system1
type=raw
parent=kernel.1