slitaz-boot-scripts rev 71

Option: mount (Mount all ext3 local partitions automaticaly
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 27 12:59:57 2008 +0200 (2008-04-27)
parents 1e93fd1b1640
children d0ddd8be99c4
files etc/init.d/bootopts.sh
line diff
     1.1 --- a/etc/init.d/bootopts.sh	Mon Apr 21 10:17:44 2008 +0000
     1.2 +++ b/etc/init.d/bootopts.sh	Sun Apr 27 12:59:57 2008 +0200
     1.3 @@ -49,6 +49,25 @@
     1.4  	fi
     1.5  }
     1.6  
     1.7 +# Mount all ext3 partitions found (opt: mount).
     1.8 +mount_partitions()
     1.9 +{
    1.10 +	# Get the list partitions.
    1.11 +	DEVICES_LIST=`fdisk -l | grep 83 | cut -d " " -f 1`
    1.12 +	
    1.13 +	# Mount filesystems rw.
    1.14 +	for device in $DEVICES_LIST
    1.15 +	do
    1.16 +		name=${device#/dev/}
    1.17 +		# Device can be already used by home=usb.
    1.18 +		if ! mount | grep ^$device >/dev/null; then
    1.19 +			echo "Mounting partition: $name on /mnt/$name"
    1.20 +			mkdir /mnt/$name
    1.21 +			mount $device /mnt/$name
    1.22 +		fi
    1.23 +	done
    1.24 +}
    1.25 +
    1.26  # Parse /proc/cmdline with grep.
    1.27  #
    1.28  
    1.29 @@ -119,8 +138,13 @@
    1.30  			echo "enlightenment" > /etc/X11/wm.default ;;
    1.31  	esac
    1.32  else
    1.33 -	# If no default WM fallback to JWM.
    1.34 +	# If no default WM fallback to Openbox.
    1.35  	if [ ! -f /etc/X11/wm.default ]; then
    1.36 -		echo "jwm" > /etc/X11/wm.default
    1.37 +		echo "openbox" > /etc/X11/wm.default
    1.38  	fi
    1.39  fi
    1.40 +
    1.41 +# Check for option mount.
    1.42 +if grep -q "mount" /proc/cmdline; then
    1.43 +	mount_partitions
    1.44 +fi