From e56d6ff757b60a4eaa85d0345b7bedfc649e8a4d Mon Sep 17 00:00:00 2001 From: Víctor Mayoral Vilches Date: Thu, 2 Sep 2021 16:52:12 -0700 Subject: Allow to generate non-Xen images This commit introduces several changes that allow the use of disk_image for the generation of non-Xen (e.g. plain vanilla kernel-based) raw images. Signed-off-by: Víctor Mayoral Vilches Signed-off-by: Brian Woods Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- scripts/disk_image | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/disk_image b/scripts/disk_image index 5e95542..f0afcd0 100755 --- a/scripts/disk_image +++ b/scripts/disk_image @@ -289,12 +289,18 @@ do done offset=$((2*1024*1024)) -_part1_size=`stat -L --printf="%s" $UBOOT_OUT/$XEN` -_part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$DOM0_KERNEL` )) +_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 "${UBOOT_SOURCE}" +then + _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$UBOOT_SOURCE` )) +fi +if test "${XEN}" +then + _part1_size=$(( $_part1_size + `stat -L --printf="%s" $UBOOT_OUT/$XEN` )) +fi if test "$NUM_BOOT_AUX_FILE" && test "$NUM_BOOT_AUX_FILE" -gt 0 then i=0 @@ -409,12 +415,18 @@ mount -t ext4 /dev/mapper/diskimage1 $DESTDIR/part/disk1 # only copy over files that were counted for the partition size cd "$UBOOT_OUT" -cp --parents "$XEN" "${DESTDIR_ABS}/part/disk1/" 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 "${UBOOT_SOURCE}" +then + cp --parents "$UBOOT_SOURCE" "${DESTDIR_ABS}/part/disk1/" +fi +if test "${XEN}" +then + cp --parents "$XEN" "${DESTDIR_ABS}/part/disk1/" +fi if test "$NUM_BOOT_AUX_FILE" && test "$NUM_BOOT_AUX_FILE" -gt 0 then i=0 -- cgit v1.2.3