rauc: Bundle RAUC status file in disk image

This let's us report the installed software versions, before any
updates have been made. Since the info should _not_ be erased in a
factory reset (since the installed software versions will not change),
move the status file to aux, which is the proper place for this class
of information.
This commit is contained in:
Tobias Waldekranz
2023-06-30 15:33:10 +02:00
committed by Joachim Wiberg
parent 1b85d0c4e0
commit f056e20558
4 changed files with 34 additions and 2 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
[system]
compatible=infix-aarch64
bootloader=uboot
statusfile=/var/lib/rauc/status
statusfile=/mnt/aux/rauc.status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
+1
View File
@@ -157,6 +157,7 @@ awk \
mkdir -p $root/aux
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
cp -f $BUILD_DIR/mkrauc/rauc.status $root/aux/rauc.status
case "$arch" in
aarch64)
+31
View File
@@ -46,3 +46,34 @@ rm -f $BINARIES_DIR/$name.pkg
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/$name.pkg
# Bootstrap a RAUC status file showing the newly created image
# installed to both the primary and secondary slots. This then bundled
# in the aux partition in mkdisk.sh, so that RAUC (on the target) can
# always report the installed versions.
rauc info --no-verify --output-format=shell $BINARIES_DIR/$name.pkg >$work/rauc.info
. $work/rauc.info
tstamp=$(date -u +%FT%TZ)
cat >$work/rauc.status <<EOF
[slot.rootfs.0]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
[slot.rootfs.1]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
EOF
+1 -1
View File
@@ -2,7 +2,7 @@
compatible=infix-x86_64
bootloader=grub
grubenv=/mnt/aux/grub/grubenv
statusfile=/var/lib/rauc/status
statusfile=/mnt/aux/rauc.status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain