summaryrefslogtreecommitdiff
path: root/scripts/casper-bottom/10adduser
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:24 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 14:46:24 +0200
commit6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e (patch)
tree333a05a0a341c98203688dc4d01589340eca951c /scripts/casper-bottom/10adduser
parenta4a7503df76005df67b006e1324004c808830c32 (diff)
downloadlive-boot-6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e.tar.gz
live-boot-6c1a2cfab139bb4a61e7bcf5f4cafe3b7498f64e.zip
Adding casper 1.66+debian-1.
Diffstat (limited to 'scripts/casper-bottom/10adduser')
-rwxr-xr-xscripts/casper-bottom/10adduser39
1 files changed, 24 insertions, 15 deletions
diff --git a/scripts/casper-bottom/10adduser b/scripts/casper-bottom/10adduser
index 700f8c3..e85f947 100755
--- a/scripts/casper-bottom/10adduser
+++ b/scripts/casper-bottom/10adduser
@@ -20,18 +20,28 @@ esac
log_begin_msg "$DESCRIPTION"
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
+else
+ user_crypted="U6aMy0wojraho" # "ubuntu"
+fi
+
# 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 UMxWpqk1F1hww
-set passwd/user-fullname $USERFULLNAME
+set passwd/user-password-crypted ${user_crypted}
+set passwd/user-fullname $USERFULLNAME
set passwd/username $USERNAME
set passwd/user-uid 999
EOF
-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
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ 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
+else
+ chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
+fi
# Clear out debconf database again to avoid confusing ubiquity later.
chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
@@ -43,17 +53,16 @@ set passwd/user-uid
EOF
if [ -f /root/etc/sudoers ]; then
- 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
+ if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ # 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
+ 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