Fremantle updates: easy-chroot 0.2.7, easy-deb-chroot 0.9.42
[easy-deb-chroot] / fremantle / easy-chroot / src / sbin / qchroot
index 2143465..799ae5b 100755 (executable)
@@ -45,6 +45,10 @@ if [ "$MOUNTSUCCESS" = "0" ] ; then
   #Open e-mail attachments, etc
   mount -o bind /var/tmp "$CHROOT/var/tmp"
 
+  #ArchLinux suggestions
+  mount -o bind /dev/shm "$CHROOT/dev/shm"
+  mount -o bind /sys "$CHROOT/sys"
+
   #Any external devices
   echo ... >/dev/stderr
   MNTD=`cat /proc/mounts | grep ' /media/' | awk '{print $2}'`
@@ -66,8 +70,9 @@ if [ "$MOUNTSUCCESS" = "0" ] ; then
   
   #Make DBus work
   mount -o bind /var/run/dbus "$CHROOT/var/run/dbus"
+  mount -o bind /var/lib/dbus "$CHROOT/var/lib/dbus"
 
-  #Make DBus work
+  #Make pulseaudio work
   mount -o bind /var/run/pulse "$CHROOT/var/run/pulse"
 
   #Speed hacks: lower the priority of processes
@@ -121,11 +126,20 @@ fi
 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'`
+fi
+
 if [ "x$CHRLABEL" = "x" ] ; then
   CHRLABEL=chroot
 fi
+
 echo -ne "\033]0;$CHRLABEL\007" >/dev/stderr
 export PS1="[\u@$CHRLABEL: \w]"