From 743cd04edb63ddb4067eaf22e8a7b75ac2c2c305 Mon Sep 17 00:00:00 2001 From: Victor Mayoral Vilches Date: Thu, 2 Sep 2021 16:52:10 -0700 Subject: Add support for including files in first partition Add NUM_BOOT_AUX_FILE and BOOT_AUX_FILE[n] so that the user can add a number of files to the first partition with disk_image. This is useful for firmware files etc. Signed-off-by: VĂ­ctor Mayoral Vilches Signed-off-by: Brian Woods Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- scripts/disk_image | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'scripts') diff --git a/scripts/disk_image b/scripts/disk_image index 7f602d1..b5a3dae 100755 --- a/scripts/disk_image +++ b/scripts/disk_image @@ -291,6 +291,21 @@ _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$DOM0_KERNEL` ) _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$DEVICE_TREE` )) _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$UBOOT_SOURCE` )) _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$UBOOT_SCRIPT` )) + +if test "$NUM_BOOT_AUX_FILE" && test "$NUM_BOOT_AUX_FILE" -gt 0 +then + i=0 + while test $i -lt "$NUM_BOOT_AUX_FILE" + do + if [ ! -f "$UBOOT_OUT/${BOOT_AUX_FILE[$i]}" ] + then + echo "Can not find ${BOOT_AUX_FILE[$i]}, exiting" + fi + _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/${BOOT_AUX_FILE[$i]}` )) + i=$(( $i + 1 )) + done +fi + i=0 while test $i -lt $NUM_DOMUS do @@ -396,6 +411,17 @@ cp --parents "$DOM0_KERNEL" "${DESTDIR_ABS}/part/disk1/" cp --parents "$DEVICE_TREE" "${DESTDIR_ABS}/part/disk1/" cp --parents "$UBOOT_SOURCE" "${DESTDIR_ABS}/part/disk1/" cp --parents "$UBOOT_SCRIPT" "${DESTDIR_ABS}/part/disk1/" + +if test "$NUM_BOOT_AUX_FILE" && test "$NUM_BOOT_AUX_FILE" -gt 0 +then + i=0 + while test $i -lt "$NUM_BOOT_AUX_FILE" + do + cp --parents "${BOOT_AUX_FILE[$i]}" "${DESTDIR_ABS}/part/disk1/" + i=$(( $i + 1 )) + done +fi + i=0 while test $i -lt $NUM_DOMUS do -- cgit v1.2.3