slitaz-boot-scripts rev 166

Default user may exist have a uid 1001, 1002, etc.
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 26 17:18:51 2009 +0200 (2009-04-26)
parents d7d2f465d02a
children b779b19a1271
files etc/init.d/bootopts.sh
line diff
     1.1 --- a/etc/init.d/bootopts.sh	Sun Apr 26 17:12:27 2009 +0200
     1.2 +++ b/etc/init.d/bootopts.sh	Sun Apr 26 17:18:51 2009 +0200
     1.3 @@ -17,7 +17,7 @@
     1.4  # user=name can be used, but user must be add before home= to have home dir.
     1.5  # This option is not handled by a loop and case like other and without
     1.6  # effect on a installed system.
     1.7 -if ! grep -q "1000:1000" /etc/passwd; then
     1.8 +if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then
     1.9  	if grep -q "user=" /proc/cmdline; then
    1.10  		USER=`cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/'`
    1.11  		# Avoid usage of an existing system user or root.
    1.12 @@ -123,6 +123,15 @@
    1.13  				chown -R $USER.$USER /home/$USER
    1.14  			else
    1.15  				rm -rf /tmp/$USER-files
    1.16 +			fi
    1.17 +			# Install all packages in /home/boot/packages. In live (CD and USB) mode
    1.18 +			# the option home= mount the device on /home, so we already have a boot 
    1.19 +			# directory with the Kernel and rootfs.
    1.20 +			if [ -d "/home/boot/packages" ]; then
    1.21 +				for pkg in /home/boot/packages/*.tazpkg
    1.22 +				do
    1.23 +					tazpkg install $pkg
    1.24 +				done
    1.25  			fi ;;
    1.26  		laptop)
    1.27  			# Laptop option to load ac and battery Kernel modules.
    1.28 @@ -193,13 +202,3 @@
    1.29  	echo "Activating swap memory..."
    1.30  	swapon -a
    1.31  fi
    1.32 -
    1.33 -# Install all packages in /home/boot/packages. In live (CD and USB) mode
    1.34 -# the option home= will mount the device on /home, so we already have
    1.35 -# a boot directory with the Kernel and rootfs.
    1.36 -if [ -d "/home/boot/packages" ]; then
    1.37 -	for pkg in /home/boot/packages/*.tazpkg
    1.38 -	do
    1.39 -		tazpkg install $pkg
    1.40 -	done
    1.41 -fi