aboutsummaryrefslogtreecommitdiff
path: root/scripts/disk_image
diff options
context:
space:
mode:
authorBrian Woods2019-10-24 20:32:05 -0700
committerStefano Stabellini2019-10-25 10:24:06 -0700
commit779a2203bad52ab786f371f77c8d25f0cb186bca (patch)
tree6d41ae17fac3964eaa21ecfcab1d122b7fe25e3e /scripts/disk_image
parentd7b0db13a584f24730024bf6f7ca0c9e03b259b9 (diff)
Fix DESTDIR path in disk_image
When the user supplies a relative path to use as a working tmp directory, the path is broken when a cd occurs in the script. Fix this by using the absolute path for DESTDIR when we cd. Fixes: "Fix copying files to boot partition in disk_image" Signed-off-by: Brian Woods <brian.woods@xilinx.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts/disk_image')
-rwxr-xr-xscripts/disk_image17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/disk_image b/scripts/disk_image
index 88a1663..e085f43 100755
--- a/scripts/disk_image
+++ b/scripts/disk_image
@@ -81,6 +81,7 @@ else
fi
UBOOT_OUT_ABS="$(readlink -f $UBOOT_OUT)"
+DESTDIR_ABS="$(readlink -f $DESTDIR)"
check_depends
@@ -196,22 +197,22 @@ 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}/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/"
+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/"
i=0
while test $i -lt $NUM_DOMUS
do
- cp --parents "${DOMU_KERNEL[$i]}" "${DESTDIR}/part/disk1/"
+ cp --parents "${DOMU_KERNEL[$i]}" "${DESTDIR_ABS}/part/disk1/"
if test "${DOMU_RAMDISK[$i]}"
then
- cp --parents "${DOMU_RAMDISK[$i]}" "${DESTDIR}/part/disk1/"
+ cp --parents "${DOMU_RAMDISK[$i]}" "${DESTDIR_ABS}/part/disk1/"
fi
if test "${DOMU_PASSTHROUGH_DTB[$i]}"
then
- cp --parents "${DOMU_PASSTHROUGH_DTB[$i]}" "${DESTDIR}/part/disk1/"
+ cp --parents "${DOMU_PASSTHROUGH_DTB[$i]}" "${DESTDIR_ABS}/part/disk1/"
fi
i=$(( $i + 1 ))
done