Files
infix/board/common/mkrauc.sh
Tobias WaldekranzandJoachim Wiberg c08fe9f522 post-image: Defer RAUC status file generation to disk image creation
In the future we want to build disk images from builds where we
haven't locally built Infix, we've just downloaded an existing
release. In those cases we also have to create rauc.status, even
though we're not creating a bundle.
2023-08-25 10:51:45 +02:00

46 lines
806 B
Bash
Executable File

#!/bin/sh
set -e
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
name=$1
arch=$2
sign=$3
crt=$(ls $sign/*.crt)
key=$(ls $sign/*.key)
common=$(dirname $(readlink -f "$0"))
work=$BUILD_DIR/mkrauc
mkdir -p $work
cp -f $common/rauc-hooks.sh $work/hooks.sh
# RAUC internally uses the file extension to find a suitable install
# handler, hence the name must be .img
cp -f $BINARIES_DIR/rootfs.squashfs $work/rootfs.img
cp -f $BINARIES_DIR/rootfs.itbh $work/rootfs.itbh
cat >$work/manifest.raucm <<EOF
[update]
compatible=infix-${arch}
version=${GIT_VERSION}
[bundle]
format=verity
[hooks]
filename=hooks.sh
[image.rootfs]
filename=rootfs.img
hooks=post-install
EOF
rm -f $BINARIES_DIR/$name.pkg
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/$name.pkg