From 8296a98e612da0e72390c8e23ec21fd4223b9ef7 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 10 Jan 2023 08:16:51 +0100 Subject: [PATCH] common: Use plain SquashFS images on disk Store FIT headers separately on aux, and place the raw SquashFS images on primary/secondary. This removes the need to muck about with the device mapper to setup the rootfs, and it allows us to boot using syslinux files. --- board/aarch64/rootfs/boot/syslinux/syslinux.conf | 3 +++ board/common/genimage.cfg | 5 +++-- board/common/mkmmc.sh | 2 ++ board/common/rootfs.its | 10 ---------- board/common/sign.sh | 4 +++- 5 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 board/aarch64/rootfs/boot/syslinux/syslinux.conf diff --git a/board/aarch64/rootfs/boot/syslinux/syslinux.conf b/board/aarch64/rootfs/boot/syslinux/syslinux.conf new file mode 100644 index 00000000..33fdbb23 --- /dev/null +++ b/board/aarch64/rootfs/boot/syslinux/syslinux.conf @@ -0,0 +1,3 @@ +label Infix (aarch64) + kernel /boot/Image + append ${bootargs_root} ${bootargs_rauc} ${bootargs_log} diff --git a/board/common/genimage.cfg b/board/common/genimage.cfg index 285bde4a..2d6e16ed 100644 --- a/board/common/genimage.cfg +++ b/board/common/genimage.cfg @@ -42,12 +42,13 @@ image mmc.img { } partition primary { - image = "rootfs.itb" + image = "rootfs.squashfs" size = 224M } partition secondary { - image = "rootfs.itb" + bootable = true + image = "rootfs.squashfs" size = 224M } diff --git a/board/common/mkmmc.sh b/board/common/mkmmc.sh index 1944f778..88549630 100755 --- a/board/common/mkmmc.sh +++ b/board/common/mkmmc.sh @@ -9,6 +9,8 @@ tmp=$BUILD_DIR/genimage.tmp mkdir -p $root/aux cp -f $BINARIES_DIR/uboot-env.bin $root/aux/uboot.env +cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh +cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh rm -rf $tmp diff --git a/board/common/rootfs.its b/board/common/rootfs.its index 6a321f49..a826694e 100644 --- a/board/common/rootfs.its +++ b/board/common/rootfs.its @@ -6,15 +6,6 @@ #address-cells = <0x1>; images { - boot-script { - type = "script"; - data = /incbin/("boot.script"); - signature-1 { - algo = "sha256,rsa4096"; - key-name-hint = "infix"; - }; - }; - rootfs { description = "Infix"; type = "ramdisk"; @@ -32,7 +23,6 @@ default = "verity"; verity { ramdisk = "rootfs"; - script = "boot-script"; }; }; }; diff --git a/board/common/sign.sh b/board/common/sign.sh index eaf7ae3d..0eb37db6 100755 --- a/board/common/sign.sh +++ b/board/common/sign.sh @@ -5,7 +5,9 @@ set -e common=$(dirname $(readlink -f "$0")) cd $BINARIES_DIR -cp $BR2_EXTERNAL_INFIX_PATH/board/$1/boot.script . cp $common/rootfs.its . mkimage -E -p 0x1000 -B 0x1000 -k $2 -f rootfs.its rootfs.itb + +cp rootfs.itb rootfs.itbh +truncate -s $((0x1000)) rootfs.itbh