aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--README.md11
-rwxr-xr-xscripts/disk_image26
2 files changed, 37 insertions, 0 deletions
diff --git a/README.md b/README.md
index d8bfc32..dd9edc5 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,10 @@ DOMU_RAMDISK[1]="zynqmp-dom2/domU-ramdisk.cpio"
DOMU_MEM[1]=512
DOMU_VCPUS[1]=1
+NUM_BOOT_AUX_FILE=2
+BOOT_AUX_FILE[0]="BOOT.BIN"
+BOOT_AUX_FILE[1]="uboot.cfg"
+
UBOOT_SOURCE="boot.source"
UBOOT_SCRIPT="boot.scr"
FDTEDIT="imagebuilder.dtb"
@@ -100,6 +104,13 @@ Where:
automatically at boot as dom0-less guest. It can still be created
later from Dom0.
+- NUM_BOOT_AUX_FILE: is optional but if specified tell how many extra
+ files to include in the first partition with disk_image. Useful for
+ things like uboot config files, firmware files or other such files.
+
+- BOOT_AUX_FILE[number]: a list of file(s) to be included in the first
+ partition.
+
- UBOOT_SOURCE and UBOOT_SCRIPT specify the output. They are optional
as you can pass -o FILENAME to uboot-script-gen as a command line
parameter
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