rebuild trc6500-master-file package to limit conflicts with trc6500 packages
[debian6500.git] / trc6500-master-file / debian / debian-postinst
diff --git a/trc6500-master-file/debian/debian-postinst b/trc6500-master-file/debian/debian-postinst
new file mode 100755 (executable)
index 0000000..4d212a3
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# since equivs can't handle symlinks, here we are doing them by hand. As of writing this script (2015-05-29), there are 11 symlinks to take care of.
+
+# I don't know why things were that way before, but I'm told to set them that way again.
+echo 'Moving things around..'
+[ -h /home ] || mv /home /var/media/backup
+mkdir -p /var/media/backup/dump/{core,dump_delay_line,dump_track_base,log,prod,rec,trace}
+ln -sf /var/media/backup/dump /
+ln -sf /var/media/backup/home /
+ln -sf /var/media/backup/rec /
+ln -sf /var/media/prod /var/media/backup/
+ln -sf /etc/hosts.30MHzMDF /etc/hosts.30MHz
+ln -sf /etc/hosts.8MHzMHF /etc/hosts.8MHz
+ln -sf /usr/lib/syslinux/menu.c32 /opt/tftp/menu.c32
+ln -sf /initrd.img /opt/tftp/initrd.img 
+ln -sf /vmlinuz /opt/tftp/vmlinuz
+ln -sf /usr/lib/syslinux/pxelinux.0 /opt/tftp/pxelinux.0
+ln -sf /usr/lib/syslinux/memdisk /opt/tftp/memdisk
+echo 'Things moved.'
+
+# 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 "">/var/log/atftpd.log
+chown nobody /var/log/atftpd.log
+
+update-initramfs -u
+
+cd /opt/cluster
+# now this file is locked away during install and replaced by a dummy. So we put a duplicate of this in a script executed on first boot after the install.
+# this is still here because it is planned we install/update this on established systems
+[ -f /sbin/start-stop-daemon.REAL ] || make all
+echo 'Finalized.'
+
+