#!/bin/bash . config || exit 0 set -e set -x # Customize the outer ISO image sed -i -s -e \ "s/DISKNAME.*/DISKNAME NilmDBuntu $VERSION by Jim Paris/" \ ${ISO}/README.diskdefines # The .disk/info file is important -- it's used by ubiquity to extract # out the distro name in dialogs, and I think casper might use it too echo "NilmDBuntu $VERSION by Jim Paris" > ${ISO}/.disk/info rm -f ${ISO}/.disk/release_notes_url # Set up preseed file cp ${ISO}/preseed/xubuntu.seed ${ISO}/preseed/nilmdbuntu.seed cat >> ${ISO}/preseed/nilmdbuntu.seed <<"EOF" # Late commands: # - Regenerate SSH host keys # - Remove "quiet splash" from grub command line d-i preseed/late_command string \ in-target rm /etc/ssh/ssh_host_*; \ in-target dpkg-reconfigure openssh-server; \ in-target sed -i -s 's/quiet splash//g' /etc/default/grub; \ in-target update-grub; \ echo "done" # Default user. Ubiquity should let them change this 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 passwd/auto-login boolean true EOF # Rename Xubuntu to NilmDBuntu in boot scripts; also changes # preseed file to the custom one sed -i -s \ -e "s/Xubuntu/NilmDBuntu/g;" \ -e "s/Kubuntu/NilmDBuntu/g;" \ -e "s/Ubuntu/NilmDBuntu/g;" \ -e "s-preseed/xubuntu-preseed/nilmdbuntu-g;" \ -e "s-preseed/kubuntu-preseed/nilmdbuntu-g;" \ -e "s-preseed/ubuntu-preseed/nilmdbuntu-g;" \ ${ISO}/isolinux/txt.cfg ${ISO}/boot/grub/{grub,loopback}.cfg # Remove quiet and splash from boot command lines. Easier than a # custom plymouth theme and it's helpful. sed -i -s -e "s/ quiet splash//g;" \ ${ISO}/isolinux/txt.cfg ${ISO}/boot/grub/{grub,loopback}.cfg # Run the customize-inner.sh script inside the chroot sudo cp customize-inner.sh ${FS}/root/customize-inner.sh sudo chmod +x ${FS}/root/customize-inner.sh ./enter.sh "cd /root ; ./customize-inner.sh"