|
- #!/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
-
- # Set up preseed file
- cp ${ISO}/preseed/xubuntu.seed ${ISO}/preseed/nilmdbuntu.seed
- cat >> ${ISO}/preseed/nilmdbuntu.seed <<"EOF"
- # Commands to run on successful install:
- # - Regenerate SSH host keys
- # - Remove "quiet splash" from grub command line
- # Ubiquity doesn't actually use preseed/late_command, so we do it
- # in ubiquity/success_command (which needs things mounted)
- ubiquity ubiquity/success_command string \
- echo "success_command running" >/target/var/log/installer/postinst.log; \
- for i in /dev /dev/pts /dev/shm /sys /sys/kernel/security /proc /cdrom; do \
- mount --bind $i /target/$i; done; \
- sed -i -e 's/quiet splash//g' /target/etc/default/grub; \
- chroot /target update-grub \
- >>/target/var/log/installer/postinst.log 2>&1; \
- rm -f /target/etc/ssh/ssh_host_*; \
- chroot /target dpkg-reconfigure openssh-server \
- >>/target/var/log/installer/postinst.log 2>&1; \
- for i in /dev/pts /dev/shm /dev /sys/kernel/security /sys /proc /cdrom; do \
- umount /target/$i; done; \
- echo "success_command done" >>/target/var/log/installer/postinst.log
-
- # 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
-
- # Set up isolinux how we want by editing its config
- TRY="Boot ^NilmDBuntu ${VERSION}"
- cp splash.png ${ISO}/isolinux/splash.png
- perl -n -i \
- -e '$n=1 if /^label/; $n=2 if /^label live-install/; next if $n==2;' \
- -e "s/menu label.*(Try|NilmDBuntu).*/menu label $TRY/g;" \
- -e "s,preseed/.*[.]seed,preseed/nilmdbuntu.seed,g;" \
- -e "s/ quiet splash//g;" \
- -e "print;" \
- ${ISO}/isolinux/txt.cfg
- sed -i -s -e "s/^ui gfxboot/# ui gfxboot/g;" ${ISO}/isolinux/isolinux.cfg
-
- # Set up grub similarly
- TRY="Boot NilmDBuntu ${VERSION}"
- perl -n -i \
- -e "next if /menuentry \"Install/../^}$/;" \
- -e "next if /menuentry \"OEM install/../^}$/;" \
- -e "s/menuentry \"(Try|NilmDBuntu).*\" {/menuentry \"${TRY}\" {/g;" \
- -e "s,preseed/.*[.]seed,preseed/nilmdbuntu.seed,g;" \
- -e "s/ quiet splash//g;" \
- -e "print;" \
- ${ISO}/boot/grub/{grub,loopback}.cfg
-
- if ! [ "$1" == "skip" ] ; then
-
- # Run the customize-inner.sh script inside the chroot
- sudo cp nilmdbuntu.png ${FS}/usr/share/xfce4/backdrops/nilmdbuntu.png
- 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"
-
- fi
|