aboutsummaryrefslogtreecommitdiff
path: root/scripts/disk_image
diff options
context:
space:
mode:
authorVictor Mayoral Vilches2021-09-02 16:52:10 -0700
committerStefano Stabellini2021-09-03 10:51:12 -0700
commit743cd04edb63ddb4067eaf22e8a7b75ac2c2c305 (patch)
treec0cc18d576ef72de111fcaf87a6a8ba39776aabe /scripts/disk_image
parentdc2cd40bbd64a953b24c661fdc9ea04602aa1169 (diff)
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 <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@gmail.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Diffstat (limited to 'scripts/disk_image')
-rwxr-xr-xscripts/disk_image26
1 files changed, 26 insertions, 0 deletions
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