slitaz-boot-scripts rev 325

/etc/init.d/bootopts.sh: mount /home *before* create tux (for tazusb)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 16 13:48:41 2013 +0100 (2013-01-16)
parents b1986b2be1f0
children f74f7daf1ed4
files etc/init.d/bootopts.sh
line diff
     1.1 --- a/etc/init.d/bootopts.sh	Sat Jan 05 00:07:04 2013 +0100
     1.2 +++ b/etc/init.d/bootopts.sh	Wed Jan 16 13:48:41 2013 +0100
     1.3 @@ -15,36 +15,6 @@
     1.4  	echo $i
     1.5  }
     1.6  
     1.7 -# Default user account without password (uid=1000). In live mode the option
     1.8 -# user=name can be used, but user must be added before home= to have home dir.
     1.9 -# This option is not handled by a loop and case like others and has no
    1.10 -# effect on an installed system.
    1.11 -if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then
    1.12 -	if fgrep -q "user=" /proc/cmdline; then
    1.13 -		USER=$(cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/')
    1.14 -		# Avoid usage of an existing system user or root.
    1.15 -		if grep -q ^$USER /etc/passwd; then
    1.16 -			USER=tux
    1.17 -		fi
    1.18 -	else
    1.19 -		USER=tux
    1.20 -	fi
    1.21 -	echo -n "Configuring user and group: $USER..."
    1.22 -	adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$USER $USER
    1.23 -	passwd -d $USER >/dev/null
    1.24 -	status
    1.25 -	# Audio and cdrom group.
    1.26 -	addgroup $USER audio
    1.27 -	addgroup $USER cdrom
    1.28 -	addgroup $USER video
    1.29 -	addgroup $USER tty
    1.30 -	# Slim default user.
    1.31 -	if [ -f /etc/slim.conf ]; then
    1.32 -		sed -i s/"default_user .*"/"default_user        $USER"/\
    1.33 -			/etc/slim.conf
    1.34 -	fi
    1.35 -fi
    1.36 -
    1.37  # Parse /proc/cmdline for boot options.
    1.38  echo "Checking for SliTaz cmdline options..."
    1.39  
    1.40 @@ -181,6 +151,36 @@
    1.41  	esac
    1.42  done
    1.43  
    1.44 +# Default user account without password (uid=1000). In live mode the option
    1.45 +# user=name can be used, but user must be added before home= to have home dir.
    1.46 +# This option is not handled by a loop and case like others and has no
    1.47 +# effect on an installed system.
    1.48 +if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then
    1.49 +	if fgrep -q "user=" /proc/cmdline; then
    1.50 +		USER=$(cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/')
    1.51 +		# Avoid usage of an existing system user or root.
    1.52 +		if grep -q ^$USER /etc/passwd; then
    1.53 +			USER=tux
    1.54 +		fi
    1.55 +	else
    1.56 +		USER=tux
    1.57 +	fi
    1.58 +	echo -n "Configuring user and group: $USER..."
    1.59 +	adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$USER $USER
    1.60 +	passwd -d $USER >/dev/null
    1.61 +	status
    1.62 +	# Audio and cdrom group.
    1.63 +	addgroup $USER audio
    1.64 +	addgroup $USER cdrom
    1.65 +	addgroup $USER video
    1.66 +	addgroup $USER tty
    1.67 +	# Slim default user.
    1.68 +	if [ -f /etc/slim.conf ]; then
    1.69 +		sed -i s/"default_user .*"/"default_user        $USER"/\
    1.70 +			/etc/slim.conf
    1.71 +	fi
    1.72 +fi
    1.73 +
    1.74  # If no default WM fallback to Openbox (we never know).
    1.75  if [ ! -f /etc/X11/wm.default ]; then
    1.76  	echo "openbox" > /etc/X11/wm.default