slitaz-boot-scripts rev 25
bootopts.sh: allow UUID and label with home= (thanks Andrew !)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 19 14:21:14 2008 +0100 (2008-02-19) |
parents | fcbb99288f65 |
children | 0a34abfb23d2 |
files | etc/init.d/bootopts.sh |
line diff
1.1 --- a/etc/init.d/bootopts.sh Fri Feb 15 15:04:35 2008 +0100 1.2 +++ b/etc/init.d/bootopts.sh Tue Feb 19 14:21:14 2008 +0100 1.3 @@ -10,12 +10,18 @@ 1.4 echo "Home has been specified to $DEVICE..." 1.5 echo "Sleeping 10 s to let the kernel detect the device... " 1.6 sleep 10 1.7 - if grep -q "$DEVICE" /proc/partitions ; then 1.8 - echo "Mounting /home on /dev/$DEVICE... " 1.9 + 1.10 + DEVID=$DEVICE 1.11 + if [ -x /sbin/blkid ]; then 1.12 + #can be label, uuid or devname 1.13 + DEVID=`/sbin/blkid | grep $DEVICE | cut -d: -f1` 1.14 + fi 1.15 + if [ -n "$DEVID" ] && grep -q "$DEVID" /proc/partitions ; then 1.16 + echo "Mounting /home on /dev/$DEVID... " 1.17 mv /home/hacker /tmp/hacker-home 1.18 - mount -t ext3 /dev/$DEVICE /home 1.19 + mount -o uid=500,gid=500 /dev/$DEVID /home 1.20 else 1.21 - echo "Unable to find $DEVICE in /proc/partitions... " 1.22 + echo "Unable to find $DEVID... " 1.23 fi 1.24 # Move all hacker dir if needed. 1.25 if [ ! -d "/home/hacker" ] ; then