diff options
author | Brian Woods | 2019-10-23 19:32:17 -0700 |
---|---|---|
committer | Stefano Stabellini | 2019-10-24 12:51:57 -0700 |
commit | 6ec4ec9ac340bd8f50d66d6daf83c767e78249c8 (patch) | |
tree | 379916c758e8e02f731be37bc078cfb773cd50a9 /scripts/disk_image | |
parent | aefd022cde5cec7a27bd0786a0a1b5cfa41528d6 (diff) |
Fix copying files to boot partition in disk_image
Copy only the files that were used to generate the size of the boot
partition. This fixes a bug where if the Dom0 ramdisk is over ~16M the
boot partition will run out of space since everything in the directory
is copied over.
Signed-off-by: Brian Woods <brian.woods@xilinx.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts/disk_image')
-rwxr-xr-x | scripts/disk_image | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/scripts/disk_image b/scripts/disk_image index 6a90851..99e40f5 100755 --- a/scripts/disk_image +++ b/scripts/disk_image @@ -19,6 +19,8 @@ offset=$((2*1024*1024)) _part1_size=`stat --printf="%s" $UBOOT_OUT/$XEN` _part1_size=$(( $_part1_size + `stat --printf="%s" $UBOOT_OUT/$DOM0_KERNEL` )) _part1_size=$(( $_part1_size + `stat --printf="%s" $UBOOT_OUT/$DEVICE_TREE` )) +_part1_size=$(( $_part1_size + `stat --printf="%s" $UBOOT_OUT/$UBOOT_SOURCE` )) +_part1_size=$(( $_part1_size + `stat --printf="%s" $UBOOT_OUT/$UBOOT_SCRIPT` )) i=0 while test $i -lt $NUM_DOMUS do @@ -121,8 +123,28 @@ umount $DESTDIR/part/disk2 mkdir -p ${DESTDIR}/part/disk1 mount -t ext4 /dev/mapper/diskimage1 $DESTDIR/part/disk1 -# copy over files needed -cp -r $UBOOT_OUT/* ${DESTDIR}/part/disk1/ +# only copy over files that were counted for the partition size +cd "$UBOOT_OUT" +cp --parents "$XEN" "${DESTDIR}/part/disk1/" +cp --parents "$DOM0_KERNEL" "${DESTDIR}/part/disk1/" +cp --parents "$DEVICE_TREE" "${DESTDIR}/part/disk1/" +cp --parents "$UBOOT_SOURCE" "${DESTDIR}/part/disk1/" +cp --parents "$UBOOT_SCRIPT" "${DESTDIR}/part/disk1/" +i=0 +while test $i -lt $NUM_DOMUS +do + cp --parents "${DOMU_KERNEL[$i]}" "${DESTDIR}/part/disk1/" + if test "${DOMU_RAMDISK[$i]}" + then + cp --parents "${DOMU_RAMDISK[$i]}" "${DESTDIR}/part/disk1/" + fi + if test "${DOMU_PASSTHROUGH_DTB[$i]}" + then + cp --parents "${DOMU_PASSTHROUGH_DTB[$i]}" "${DESTDIR}/part/disk1/" + fi + i=$(( $i + 1 )) +done +cd - # unmount sync |