# Commands to run at casper boot:
# - Regenerate SSH keys
# - Append /etc/hosts.nilm to /etc/hosts
#
# And the following hacks, which could also run in customize-inner.sh,
# but doing them here ensures that they'll only be present during the
# LiveCD session
# - Append some stuff to /etc/enviroment that's needed for Ubiquity to
# create the initial user properly, when we've already created it.
# - Hack Ubiquity to prevent changing the username, and to set
# a default password
d-i preseed/early_command string \
echo "early_command running" ; \
chroot /root sh -c "rm -f /etc/ssh/ssh_host_*" ; \
chroot /root sh -c "dpkg-reconfigure openssh-server" ; \
cat /root/etc/hosts.nilm >> /root/etc/hosts ; \
echo OVERRIDE_SYSTEM_USER=1 >> /root/etc/environment ; \
sed -i \
-e 's@id="login_encrypt">@id="login_encrypt">False@g' \
-e 's@id="fullname">@id="fullname">False@g' \
-e 's@id="username">@id="username">False@g' \
-e 's@"visibility">False@"visibility">True@g' \
-e 's@id="password">@id="password">nilm@g' \
-e 's@id="verified_password">@id="verified_password">nilm@g' \
/root/usr/share/ubiquity/gtk/stepUserInfo.ui ; \
echo "early_command done"
# chroot /root sh -c "echo UBIQUITY_AUTOMATIC=1 >> /etc/environment"
# Commands to run on successful install:
# (Ubiquity doesn't actually use preseed/late_command, so we do it
# in ubiquity/success_command (which needs things mounted))
# - Remove "quiet splash" from grub command line
# - Append /etc/hosts.nilm to /etc/hosts
ubiquity ubiquity/success_command string \
echo "success_command running" >/target/var/log/installer/postinst.log; \
mount --bind /dev /target/dev ; \
in-target sh -c "sed -i -e 's/quiet splash//g' /etc/default/grub" ; \
in-target sh -c "update-grub >>/var/log/installer/postinst.log 2>&1" ; \
in-target sh -c "cat /etc/hosts.nilm >> /etc/hosts " ; \
umount /target/dev ; \
echo "success_command done" >>/target/var/log/installer/postinst.log
ubiquity ubiquity/use_nonfree boolean true
# Default user. Ubiquity should let them change this.
# (To skip the dialog completely, set the first 4, and put
# UBIQUITY_AUTOMATIC in /etc/environment in early_command above)
d-i passwd/user-fullname string NILM User
d-i passwd/username string nilm
#d-i passwd/user-password password nilm
#d-i passwd/user-password-again password nilm
d-i user-setup/allow-password-weak boolean true
d-i user-setup/force-encrypt-home boolean false
d-i user-setup/encrypt-home boolean false
d-i passwd/auto-login boolean true
d-i netcfg/get_hostname seen true
d-i netcfg/get_hostname string nilmbuntu