# echo ezchroot $IMGFILE $CHROOT $*
+# Strip off a trailing slash
+LASTCHAR=`echo $CHROOT | cut -c ${#CHROOT}`
+if [ "$LASTCHAR" = "/" ] ; then
+ echo "..stripping trailing slash..." >/dev/stderr
+ CHROOT=`echo $CHROOT | cut -c 0-$((${#CHROOT}-1))`
+fi
+
qmount $IMGFILE $CHROOT
MOUNTSUCCESS=$?
trap "rm -f $CHROOT/var/lock/chroot-complete ; echo -ne '\033]0;osso_xterm\007' ; exit" INT TERM EXIT
echo $IMGFILE $@ > "$CHROOT/var/lock/chroot-complete"
-#If the file is mounted on loop, use that label.
-
#Custom prompt and xterm title. Reduces confusion.
CHRLABEL=`blkid -s LABEL $IMGFILE | cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
#If the file is mounted on loop, use that label.
if [ "x$CHRLABEL" = "x" ] ; then
- CHRLABEL=`blkid -s LABEL /dev/loop0 | cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
+
+ # first find the loop
+ LOOPNO=`mount | grep loop | grep $CHROOT | awk '{print $1}'`
+
+ if [ "x$LOOPNO" != "x" ] ; then
+ CHRLABEL=`blkid -s LABEL $LOOPNO | cut -d' ' -f2 | cut -d'=' -f2 | sed 's/"//g'`
+ fi
fi
if [ "x$CHRLABEL" = "x" ] ; then