3 ## live-config(7) - System Configuration Scripts
4 ## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
6 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7 ## This is free software, and you are welcome to redistribute it
8 ## under certain conditions; see COPYING for details.
13 # Checking if package is installed or already configured
14 if [ ! -e /var/lib/dpkg/info/user-setup.list ] || \
15 [ -e /var/lib/live/config/user-setup ]
22 # Reading kernel command line
23 for _PARAMETER in ${_CMDLINE}
25 case "${_PARAMETER}" in
26 live-config.user-default-groups=*|user-default-groups=*)
27 LIVE_USER_DEFAULT_GROUPS="${_PARAMETER#*user-default-groups=}"
30 live-config.user-fullname=*|user-fullname=*)
31 LIVE_USER_FULLNAME="${_PARAMETER#*user-fullname=}"
34 live-config.username=*|username=*)
35 LIVE_USERNAME="${_PARAMETER#*username=}"
43 Configure_user_setup ()
45 # Checking if package is already configured differently
46 if grep -q "^${LIVE_USERNAME}:" /etc/passwd
51 # Adjust formating of groups
52 if [ -n "${LIVE_USER_DEFAULT_GROUPS}" ]
54 LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|,| |g')"
57 # Make sure user is not in sudo group if sudo is disabled
58 if [ "${_NO_ROOT}" = "true" ]
60 LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|sudo||')"
63 # Default password is: live
64 # passwords can be generated with 'echo "live" | mkpasswd -s',
65 # a blank password is 'U6aMy0wojraho'.
66 _PASSWORD="8Ab05sVQ4LLps"
68 cat > /debconf.live << EOF
69 user-setup passwd/make-user boolean true
70 user-setup passwd/root-password-crypted string *
71 user-setup passwd/user-password-crypted string ${_PASSWORD}
72 user-setup passwd/user-default-groups string ${LIVE_USER_DEFAULT_GROUPS}
73 user-setup passwd/user-fullname string ${LIVE_USER_FULLNAME}
74 user-setup passwd/username string ${LIVE_USERNAME}
75 user-setup passwd/user-uid string 1000
78 debconf-set-selections < /debconf.live
81 # Workaround for bug in shadow
84 chmod 0600 /etc/passwd-
86 /usr/lib/user-setup/user-setup-apply 2>&1 \
87 | grep -v "Shadow passwords are now on"
91 touch /var/lib/live/config/user-setup