5 # initramfs-tools header
21 # live-initramfs header
23 . /scripts/live-functions
25 log_begin_msg "Adding live session user..."
27 # live-initramfs script
29 if [ "${BUILD_SYSTEM}" = "Debian" ]; then
30 user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
32 user_crypted="U6aMy0wojraho" # "ubuntu"
35 # U6aMy0wojraho is just a blank password
36 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
37 set passwd/root-password-crypted *
38 set passwd/user-password-crypted ${user_crypted}
39 set passwd/user-fullname $USERFULLNAME
40 set passwd/username $USERNAME
41 set passwd/user-uid 999
44 if [ "${BUILD_SYSTEM}" = "Debian" ]; then
45 chroot /root /usr/bin/env -i HOME="/root" \
46 TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
47 /usr/lib/user-setup/user-setup-apply > /dev/null
49 chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
52 # Clear out debconf database again to avoid confusing ubiquity later.
53 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
54 set passwd/root-password-crypted
55 set passwd/user-password-crypted
56 set passwd/user-fullname
64 if [ -f /root/etc/sudoers ]; then
65 if [ "${BUILD_SYSTEM}" = "Ubuntu" ]; then
66 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
68 # XXX - awful hack to stop xscreensaver locking the screen (#7150)
69 echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
71 for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
72 if [ -f "/root/$file" ]; then
73 chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
77 elif [ "${BUILD_SYSTEM}" = "Debian" ]; then
78 echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
80 chroot /root sudo -u "${USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${USERNAME}/.su-to-rootrc"
82 chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
83 chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
85 chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/config && cat > /home/${USERNAME}/.kde/share/config/kdesurc" << EOF
87 super-user-command=sudo
90 if [ -f /root/usr/share/apps/konsole/sumc.desktop ]
92 chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop"
95 if [ -f /root/usr/share/apps/konsole/su.desktop ]
97 chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop"
104 if [ -L /root/home/$USERNAME/Examples ]; then
105 chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
106 mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/