common: Create (e)MMC image with redundant root filesystems

This image contains:

- A partition to hold bootloader config ("aux").

- Two redundant copies of the FIT framed rootfs (which will be
  upgradable by RAUC from within Infix).

- A partition to store critical configuration data ("cfg")

- A partition to store data created dynamically by Infix ("var")
This commit is contained in:
Tobias Waldekranz
2023-02-20 10:48:24 +01:00
parent ca3966db62
commit 499a8f718c
3 changed files with 87 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
image aux.ext4 {
mountpoint = "/aux"
temporary = true
size = 2M
ext4 {
label = "aux"
}
}
image cfg.ext4 {
empty = true
temporary = true
size = 16M
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
temporary = true
# 44M - 24k (GPT backup)
size = 45032k
ext4 {
label = "var"
}
}
image mmc.img {
size = 512M
hdimage {
partition-table-type = "gpt"
}
partition aux {
offset = 2M
image = "aux.ext4"
}
partition primary {
image = "rootfs.itb"
size = 224M
}
partition secondary {
image = "rootfs.itb"
size = 224M
}
partition cfg {
image = "cfg.ext4"
}
partition var {
image = "var.ext4"
}
}
# Silence genimage warnings
config {}
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
set -e
common=$(dirname $(readlink -f "$0"))
root=$BUILD_DIR/genimage.root
tmp=$BUILD_DIR/genimage.tmp
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 $BINARIES_DIR/uboot-env.bin $root/aux/uboot.env
rm -rf $tmp
genimage \
--rootpath $root \
--tmppath $tmp \
--inputpath $BINARIES_DIR \
--outputpath $BINARIES_DIR \
--config $common/genimage.cfg
+1
View File
@@ -10,6 +10,7 @@ signkey=$3
$common/sign.sh $arch $signkey
$common/mkfit.sh
$common/mkmmc.sh
if [ "$BR2_ARCH" = "x86_64" ]; then
"$common/mkgns3a.sh"