aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Mayoral Vilches2021-09-02 16:52:12 -0700
committerStefano Stabellini2021-09-03 10:54:31 -0700
commite56d6ff757b60a4eaa85d0345b7bedfc649e8a4d (patch)
treeb417e04d148c8ac841504ed70072057629c2c75f
parent599b85512988448e8c7e7a563f515b18ebaabe79 (diff)
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 <v.mayoralv@gmail.com> Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
-rwxr-xr-xscripts/disk_image22
1 files changed, 17 insertions, 5 deletions
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