#!/bin/sh PREREQ="" DESCRIPTION="Adding live session user..." prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac . /scripts/casper-functions load_confmodule log_begin_msg "$DESCRIPTION" debconf_backup () { local question backup for question; do backup="$question-casper-backup" db_register debian-installer/dummy "$backup" db_get "$question" db_set "$backup" "$RET" db_fget "$question" seen db_fset "$backup" seen "$RET" done } debconf_restore () { local question backup for question; do backup="$question-casper-backup" db_get "$backup" db_set "$question" "$RET" db_fget "$backup" seen db_fset "$question" seen "$RET" db_unregister "$backup" done } debconf_backup \ passwd/root-password-crypted \ passwd/root-password passwd/root-password-again \ passwd/user-password-crypted \ passwd/user-password passwd/user-password-again \ passwd/user-fullname passwd/username passwd/user-uid # U6aMy0wojraho is just a blank password db_set passwd/root-password-crypted '*' db_set passwd/user-password-crypted U6aMy0wojraho db_set passwd/user-fullname "$USERFULLNAME" db_set passwd/username "$USERNAME" db_set passwd/user-uid 999 chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null # Clear out debconf database again to avoid confusing ubiquity later. debconf_restore \ passwd/root-password-crypted \ passwd/root-password passwd/root-password-again \ passwd/user-password-crypted \ passwd/user-password passwd/user-password-again \ passwd/user-fullname passwd/username passwd/user-uid if [ -f /root/etc/sudoers ]; then echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers fi # XXX - awful hack to stop xscreensaver locking the screen (#7150) echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment LTS="$(cut -d' ' -f3 /root/cdrom/.disk/info 2>/dev/null)" || LTS= RELEASE="$(cut -d' ' -f1-2 /root/cdrom/.disk/info 2>/dev/null)" || RELEASE= if [ "$LTS" = "LTS" ] && [ -n "$RELEASE" ]; then RELEASE="$RELEASE LTS" fi # LliureX RELEASE="LliureX Platinum" for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde4/ubiquity-kdeui.desktop; do if [ -f "/root/$file" ]; then sed -i "s/RELEASE/$RELEASE/" "/root$file" #mkdir -p "/root/home/$USERNAME/Desktop/" #mkdir -p "/root/home/$USERNAME/Desktop/" #mkdir -p "/root/home/$USERNAME/Desktop/" $LOCALELA="$(cat /proc/cmdline | sed -e "s/.*locale=\([^[:blank:]]*\).*/\1/g")" { [ -e "/usr/bin/xdg_translator" ] && DESKTOP_LOCALE="$(/usr/bin/xdg_translator $LOCALELA "Desktop")" ;} || DESKTOP_LOCALE="Desktop" chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/$DESKTOP_LOCALE chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/$DESKTOP_LOCALE/$(basename "$file") break fi done #LliureX echo "#!/usr/bin/env bash" >> /home/$USERNAME/.xsession echo "gnome-session --session=gnome" >> /home/$USERNAME/.xsession chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/.xsession chmod +x /home/$USERNAME/.xsession if [ -L /root/home/$USERNAME/Examples ]; then chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/ mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/ fi if [ -f /root/home/$USERNAME/examples.desktop ]; then chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/ mv /root/home/$USERNAME/examples.desktop /root/home/$USERNAME/Desktop/ fi # Ultimate script generation #mkdir -p root/etc/X11/Xsession.d/ cat < /root/etc/X11/Xsession.d/99fixtheubiquity if [ -e "/usr/bin/xdg_translator" ]; then DESKTOP_LOCALE="\$(/usr/bin/xdg_translator \$LANG "Desktop")" else DESKTOP_LOCALE="Desktop" fi cp -f /usr/share/applications/ubiquity-gtkui.desktop \$HOME/\$DESKTOP_LOCALE chmod +x \$HOME/\$DESKTOP_LOCALE/ubiquity-gtkui.desktop EOF [ ! -f /root/etc/X11/Xsession.d/99fixtheubiquity ] || chmod +x /root/etc/X11/Xsession.d/99fixtheubiquity #Kubuntu if [ -f "/root/usr/bin/plasma" ]; then if [ -f "/root/usr/share/kde4/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop" ]; then chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/Desktop chroot /root install -D -o $USERNAME -g $USERNAME /usr/share/kde4/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop /home/$USERNAME/Desktop/about-kubuntu.desktop fi fi #Ubuntu MID wants to be installed with --automatic if [ -f "/root/usr/share/ubuntu-mid-default-settings/mid-gui-start" ]; then if [ -f "/root/usr/share/applications/ubiquity-gtkui.desktop" ]; then sed -i 's/--desktop/--automatic --desktop/' "/root/usr/share/applications/ubiquity-gtkui.desktop" fi fi #Ubuntu MID uses kourou, and the ubiquity icon should be easy to find if [ -f "/root/usr/lib/hildon-desktop/kourou.py" ]; then if [ -f "/root/etc/xdg/menus/home.menu" ]; then sed -i '/<\/Include>/i\ ubiquity-gtkui.desktop' "/root/etc/xdg/menus/home.menu" fi fi log_end_msg