#!/bin/sh # this file is executed right at the end of installation, just before reboot. # it operates from the point of view of the target computer, so / is the target's HDD and so on # importantly enough, this is actually followed-up after reboot by a custom /etc/rc.local file, which erases itself after running (so it only runs on first reboot) # the (abundant) feedback messages should not be visible, but they should appear on the installer's syslog. Also yes, I know writing "task finished" after something that might fail isn't the greatest thing. # note that much of what used to be here was put in the postinst file for the deb package we unpack mount /dev/cdrom /media/cdrom # first we install the packages we couldn't install automatically echo 'Installing additional package : firmware-bnx2...' dpkg -i /media/cdrom/simple-cdd/firmware-bnx2_20230210-5_all.deb echo 'Additional packages installed' #debugging echo 'force-confnew' > /etc/dpkg/dpkg.cfg.d/trc6500 # now we unpack our master archive and replace all those conf files and scripts and things echo 'Unpacking master config files...' dpkg -i /media/cdrom/simple-cdd/trc6500-master-file* # version-proof echo 'Files unpacked' echo 'Adding TRC6500 public key to keyring...' cat /media/cdrom/simple-cdd/TRC6500.pub | apt-key add - echo 'Key added' echo 'Removing exim packages...' dpkg -l | awk '/exim/ {print $2}' | xargs dpkg --remove bsd-mailx find /media/cdrom0 -name libgnutls-openssl\*_\* -o -name ssmtp_\* -o -name bsd-mailx_\* | xargs dpkg --install echo 'Exim remove' # our interfaces file gets written over for some reason, we'll copy it and restore it on first boot # note : after install, we'll be executing our own rc.local on first boot echo 'Copying first-boot script (/etc/rc.local)...' cp /etc/network/interfaces /etc/network/interfaces.original mv /etc/rc.local /etc/rc.local.original cp /media/cdrom/simple-cdd/myrc.local /etc/rc.local echo 'Script copied' echo 'Deleting simple-cdd files on disk...' rm -r /usr/local/simple-cdd rm -r /etc/dpkg/dpkg.cfg.d/trc6500 echo 'Files deleted' echo 'Umount cdrom' umount /media/cdrom exit 0