Adding casper 1.63+debian-1.
[live-boot-grml.git] / scripts / casper-bottom / 10adduser
index a37d831..700f8c3 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 PREREQ=""
-DESCRIPTION="Adding live CD user..."
+DESCRIPTION="Adding live session user..."
 
 . /scripts/functions
 
@@ -20,15 +20,18 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
+# U6aMy0wojraho is just a blank password
 chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
 set passwd/root-password-crypted *
-set passwd/user-password-crypted U6aMy0wojraho
+set passwd/user-password-crypted UMxWpqk1F1hww
 set passwd/user-fullname $USERFULLNAME 
 set passwd/username $USERNAME
 set passwd/user-uid 999
 EOF
 
-chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
+chroot /root /usr/bin/env -i HOME="/root" \
+       TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
+       /usr/lib/user-setup/user-setup-apply > /dev/null
 
 # Clear out debconf database again to avoid confusing ubiquity later.
 chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
@@ -40,18 +43,21 @@ set passwd/user-uid
 EOF
 
 if [ -f /root/etc/sudoers ]; then
-    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
-fi
-
-# XXX - awful hack to stop xscreensaver locking the screen (#7150)
-echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
-
-for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
-    if [ -f "/root/$file" ]; then
-        chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
-        break
+       if [ -x /sbin/udevplug ]; then 
+               # FIXME: ugly hack, admin is not present in debian so we do here ubuntu stuff
+               # XXX - awful hack to stop xscreensaver locking the screen (#7150)
+               echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
+        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
+               for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
+                   if [ -f "/root/$file" ]; then
+                       chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
+                       break
+               fi
+               done
+    else # We are in debian :-)
+        echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers           
     fi
-done
+fi
 
 if [ -L /root/home/$USERNAME/Examples ]; then
     chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/