Mounting an image requires full path & partition #

Use readlink to get the full path of the image.
Mount the first partition.
Print out the location of the mount.

Change-Id: I0deba1907f390f0d308ae6c8ed5448afbbf7688a
This commit is contained in:
Ramy Asselin 2015-03-05 13:55:34 -08:00
parent d1ff3c4ab3
commit 207c3df031
1 changed files with 7 additions and 2 deletions

View File

@ -21,5 +21,10 @@ IMAGE=$1
rm -rf /tmp/newimage
mkdir -p /tmp/newimage
qemu-nbd -c /dev/nbd1 $1
mount /dev/nbd1 /tmp/newimage
#qemu-nbd needs the absolute path of the image
qemu-nbd -c /dev/nbd1 `readlink -e $IMAGE`
#mount the first partition
mount /dev/nbd1p1 /tmp/newimage
echo "Image $IMAGE mounted to /tmp/newimage"