diff options
-rw-r--r-- | README.md | 11 | ||||
-rwxr-xr-x | scripts/disk_image | 26 |
2 files changed, 37 insertions, 0 deletions
@@ -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 |