# HG changeset patch # User Pascal Bellard # Date 1358340521 -3600 # Node ID 03d0b5dd921346961bb5ba5e80dad9b83899e3bb # Parent b1986b2be1f03a77e2eaf330286aabd116a3b59e /etc/init.d/bootopts.sh: mount /home *before* create tux (for tazusb) diff -r b1986b2be1f0 -r 03d0b5dd9213 etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Sat Jan 05 00:07:04 2013 +0100 +++ b/etc/init.d/bootopts.sh Wed Jan 16 13:48:41 2013 +0100 @@ -15,36 +15,6 @@ echo $i } -# Default user account without password (uid=1000). In live mode the option -# user=name can be used, but user must be added before home= to have home dir. -# This option is not handled by a loop and case like others and has no -# effect on an installed system. -if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then - if fgrep -q "user=" /proc/cmdline; then - USER=$(cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/') - # Avoid usage of an existing system user or root. - if grep -q ^$USER /etc/passwd; then - USER=tux - fi - else - USER=tux - fi - echo -n "Configuring user and group: $USER..." - adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$USER $USER - passwd -d $USER >/dev/null - status - # Audio and cdrom group. - addgroup $USER audio - addgroup $USER cdrom - addgroup $USER video - addgroup $USER tty - # Slim default user. - if [ -f /etc/slim.conf ]; then - sed -i s/"default_user .*"/"default_user $USER"/\ - /etc/slim.conf - fi -fi - # Parse /proc/cmdline for boot options. echo "Checking for SliTaz cmdline options..." @@ -181,6 +151,36 @@ esac done +# Default user account without password (uid=1000). In live mode the option +# user=name can be used, but user must be added before home= to have home dir. +# This option is not handled by a loop and case like others and has no +# effect on an installed system. +if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then + if fgrep -q "user=" /proc/cmdline; then + USER=$(cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/') + # Avoid usage of an existing system user or root. + if grep -q ^$USER /etc/passwd; then + USER=tux + fi + else + USER=tux + fi + echo -n "Configuring user and group: $USER..." + adduser -D -s /bin/sh -g "SliTaz User" -G users -h /home/$USER $USER + passwd -d $USER >/dev/null + status + # Audio and cdrom group. + addgroup $USER audio + addgroup $USER cdrom + addgroup $USER video + addgroup $USER tty + # Slim default user. + if [ -f /etc/slim.conf ]; then + sed -i s/"default_user .*"/"default_user $USER"/\ + /etc/slim.conf + fi +fi + # If no default WM fallback to Openbox (we never know). if [ ! -f /etc/X11/wm.default ]; then echo "openbox" > /etc/X11/wm.default