4 DESCRIPTION="Adding live session user..."
6 . /scripts/casper-functions
21 log_begin_msg "$DESCRIPTION"
23 if [ "${BUILD_SYSTEM}" == "Debian" ]; then
24 user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
26 user_crypted="U6aMy0wojraho" # "ubuntu"
29 # U6aMy0wojraho is just a blank password
30 chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
31 set passwd/root-password-crypted *
32 set passwd/user-password-crypted ${user_crypted}
33 set passwd/user-fullname $USERFULLNAME
34 set passwd/username $USERNAME
35 set passwd/user-uid 999
38 if [ "${BUILD_SYSTEM}" == "Debian" ]; then
39 chroot /root /usr/bin/env -i HOME="/root" \
40 TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
41 /usr/lib/user-setup/user-setup-apply > /dev/null
43 chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
46 # Clear out debconf database again to avoid confusing ubiquity later.
47 chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
48 set passwd/root-password-crypted
49 set passwd/user-password-crypted
50 set passwd/user-fullname
55 if [ -f /root/etc/sudoers ]; then
56 if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
57 # XXX - awful hack to stop xscreensaver locking the screen (#7150)
58 echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
59 grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
60 for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
61 if [ -f "/root/$file" ]; then
62 chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
66 else # We are in debian :-)
67 echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
71 if [ -L /root/home/$USERNAME/Examples ]; then
72 chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
73 mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/