X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=fremantle%2Feasy-chroot%2Fsrc%2Fsbin%2Fqmount;h=12c808f7939fa26638747b3b33a2851536062978;hb=d17ba37c01c5014a82c318b8dfeb09bd27cf209b;hp=f44d3dbdaac532cf28b6b5042abeb2ce11c54abf;hpb=af7fe7476a5e0a0bdb128020fe30522b15c070e7;p=easy-deb-chroot diff --git a/fremantle/easy-chroot/src/sbin/qmount b/fremantle/easy-chroot/src/sbin/qmount index f44d3db..12c808f 100755 --- a/fremantle/easy-chroot/src/sbin/qmount +++ b/fremantle/easy-chroot/src/sbin/qmount @@ -46,6 +46,13 @@ if [ "x$MNTPT" = "x" ] || [ "x`echo $MNTPT | grep '/'`" = "x" ] ; then exit 9 fi +# Strip off a trailing slash +LASTCHAR=`echo $MNTPT | cut -c ${#MNTPT}` +if [ "$LASTCHAR" = "/" ] ; then + echo "..stripping trailing slash..." >/dev/stderr + MNTPT=`echo $MNTPT | cut -c 0-$((${#MNTPT}-1))` +fi + #Check to see if already mounted if [ -f "$MNTPT/var/lock/qmount-complete" ] ; then echo "$MNTPT has a qmount already!" >/dev/stderr @@ -139,7 +146,7 @@ if [ ! -f "$MNTPT/var/lock/qmount-complete" ] ; then # use "regular" loop echo "mounting $IMGFILE on loop" >/dev/stderr - NEXTLOOP="" + NEXTLOOP=`mount | grep loop | tail -1 | awk '{print $1}' | awk -F "/" '{print $3}' | cut -c 5-6 | awk '{print $0+1}'` if [ "x$NEXTLOOP" = "x" ] ; then NEXTLOOP=0 fi