/usr/share/initramfs-tools/scripts/casper-bottom/25adduser is in casper 1.376.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159  | #!/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 [ -d /root/etc/sudoers.d/ ]; then
    echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" > /root/etc/sudoers.d/casper
fi
LTS="$(cut -d' ' -f3 /root/cdrom/.disk/info 2>/dev/null)" || LTS=
RELEASE="$(cut -d' ' -f1-2 /root/cdrom/.disk/info 2>/dev/null | sed 's/-/ /')" || RELEASE=
if [ "$LTS" = "LTS" ] && [ -n "$RELEASE" ]; then
	RELEASE="$RELEASE LTS"
fi
for file in /usr/share/applications/ubiquity.desktop /usr/share/applications/kde4/ubiquity-kdeui.desktop; do
    if [ -f "/root/$file" ]; then
        sed -i "s/RELEASE/$RELEASE/" "/root$file"
        chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/Desktop
        chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
        break
    fi
done
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
#GDM
if [ -d /root/etc/gdm3 ]; then
    sed -i '/^[UG]ID_MIN/s/\<1000$/ 999/' /root/etc/login.defs
    #inject a systemd unit to update AccountsService properties during boot
    if [ -z "${PERSISTENT}" ]; then
        cat > /root/lib/systemd/system/passwd-del.service << EOF
[Unit]
Description=Run passwd -d to ensure AccountsService properties are set correctly
After=accounts-daemon.service
Before=display-manager.service
[Service]
ExecStart=-/usr/bin/dbus-run-session passwd -d $USERNAME
Type=oneshot
EOF
        ln -s /lib/systemd/system/passwd-del.service \
              /root/etc/systemd/system/display-manager.service.wants/
    fi
fi
# Kubuntu
if [ -f "/root/usr/bin/plasma-desktop" ]; then
    if [ -f "/root/usr/share/kde4/apps/khelpcenter/plugins/kubuntu/a_welcome.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/a_welcome.desktop /home/$USERNAME/Desktop/a_welcome.desktop
    fi
fi
#Kubuntu Plasma 5, turn on folderview
if [ -f "/root/usr/bin/plasmashell" ]; then
    if [ -f "/root/usr/share/kubuntu-default-settings/layout.js" ]; then
      chroot /root install -D -o $USERNAME -g $USERNAME /usr/share/kubuntu-default-settings/layout.js /usr/share/plasma/shells/org.kde.plasma.desktop/contents/layout.js
    fi
fi
# Kubuntu Netbook
if [ -f "/root/usr/bin/plasma-netbook" ]; then
    config="/root/usr/share/kubuntu-netbook-default-settings/share/apps/plasma/layout-templates/org.kde.plasma-netbook.defaultSal/contents/layout.js"
    escaped_desktop="\/usr\/share\/applications\/kde4\/ubiquity-kdeui.desktop"
    if [ -f $config ]; then
      sed -i "s/\/\/__UBIQUITY_PLACEHOLDER__\/\//\"$escaped_desktop\"/" $config
    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.desktop" ]; then
    sed -i 's/--desktop/--automatic --desktop/' "/root/usr/share/applications/ubiquity.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\		<Filename>ubiquity.desktop</Filename>' "/root/etc/xdg/menus/home.menu"
  fi
fi
log_end_msg
 |