X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=simple-cdd%2Fprofiles%2Ftrc6500.postinst;fp=simple-cdd%2Fprofiles%2Ftrc6500.postinst;h=0ad5d6033935beda7368aa64da05294613e6d3e1;hb=9c7f26beb3643499203fca3668ba7024e6823af4;hp=0000000000000000000000000000000000000000;hpb=6ded6f01e55bbc73e2505f8fdaaf6a4410a038b0;p=debian6500.git diff --git a/simple-cdd/profiles/trc6500.postinst b/simple-cdd/profiles/trc6500.postinst new file mode 100755 index 0000000..0ad5d60 --- /dev/null +++ b/simple-cdd/profiles/trc6500.postinst @@ -0,0 +1,69 @@ +#!/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. + + +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_0.36+wheezy.1_all.deb +echo 'Additional packages installed.' + +# now we unpack our master archive and replace all those conf files and scripts and things +echo 'Unpacking master config files..' +tar xzf /media/cdrom/simple-cdd/master.tar -C / +echo 'Files unpacked.' + +# I don't know why things were that way before, but I'm told to set them that way again. +echo 'Moving things around..' +mv /home /var/media/backup +mkdir -p /var/media/backup/dump/{core,dump_delay_line,dump_track_base,log,prod,rec,trace} +ln -s /var/media/backup/home /home +echo 'Things moved.' + +echo 'Adding TRC6500 public key to keyring..' +cat /media/cdrom/simple-cdd/TRC6500.pub | apt-key add - +echo 'Key added.' + +# now enable all the scripts and such.. +echo 'Enabling on-startup scripts..' +update-rc.d waitswitches defaults +update-rc.d waitswitches enable +update-rc.d etherwake defaults +update-rc.d etherwake enable +update-rc.d ipmiwake defaults +update-rc.d ipmiwake enable +update-rc.d wakeonlan defaults +update-rc.d wakeonlan enable +update-rc.d waitslaves defaults +update-rc.d shutdownallblades defaults +update-rc.d checkudevrules enable +update-rc.d checkudevrules defaults +echo 'Scripts enabled.' + +# and these other things too +echo 'Finalizing configuration..' +chown webconfig /etc/webconfig/alias.csv /etc/dhcp/dhcpd.conf* +cp /etc/dhcp/dhcpd.conf.blank /etc/dhcp/dhcpd.conf +chsh -s /usr/bin/pdmenu trc6500 + +# from that sync_master.sh script.. Apparently there from Git shenanigans. +chmod go-rwx /root/.ssh/id_rsa +chmod go-rwx /opt/cluster/slave/root/.ssh +chmod go-rwx /opt/cluster/slave/root/.ssh/id_rsa +chmod a+rwx /opt/tftp +echo 'Finalized.' + +# 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 'Placing 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.' + + +umount /media/cdrom