# HG changeset patch # User Pascal Bellard # Date 1203427274 -3600 # Node ID 93db726efd01bf448ac4685088a8b47abd4a3ae5 # Parent fcbb99288f65d4d8c78bd9c205526cff49d3e5a5 bootopts.sh: allow UUID and label with home= (thanks Andrew !) diff -r fcbb99288f65 -r 93db726efd01 etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Fri Feb 15 15:04:35 2008 +0100 +++ b/etc/init.d/bootopts.sh Tue Feb 19 14:21:14 2008 +0100 @@ -10,12 +10,18 @@ echo "Home has been specified to $DEVICE..." echo "Sleeping 10 s to let the kernel detect the device... " sleep 10 - if grep -q "$DEVICE" /proc/partitions ; then - echo "Mounting /home on /dev/$DEVICE... " + + DEVID=$DEVICE + if [ -x /sbin/blkid ]; then + #can be label, uuid or devname + DEVID=`/sbin/blkid | grep $DEVICE | cut -d: -f1` + fi + if [ -n "$DEVID" ] && grep -q "$DEVID" /proc/partitions ; then + echo "Mounting /home on /dev/$DEVID... " mv /home/hacker /tmp/hacker-home - mount -t ext3 /dev/$DEVICE /home + mount -o uid=500,gid=500 /dev/$DEVID /home else - echo "Unable to find $DEVICE in /proc/partitions... " + echo "Unable to find $DEVID... " fi # Move all hacker dir if needed. if [ ! -d "/home/hacker" ] ; then