add gateway for ipmi
[debian6500.git] / simple-cdd / profiles / trc6500.postinst
CommitLineData
9c7f26be
OL
1#!/bin/sh
2# this file is executed right at the end of installation, just before reboot.
3# it operates from the point of view of the target computer, so / is the target's HDD and so on
4# 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)
5# 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.
e043b5aa 6# note that much of what used to be here was put in the postinst file for the deb package we unpack
9c7f26be
OL
7
8
9mount /dev/cdrom /media/cdrom
10
11# first we install the packages we couldn't install automatically
bb4c8214 12echo 'Installing additional package : firmware-bnx2...'
9c7f26be 13dpkg -i /media/cdrom/simple-cdd/firmware-bnx2_0.36+wheezy.1_all.deb
bb4c8214 14echo 'Additional packages installed'
9c7f26be 15
e043b5aa
OL
16#debugging
17echo 'force-confnew' > /etc/dpkg/dpkg.cfg.d/trc6500
18
9c7f26be 19# now we unpack our master archive and replace all those conf files and scripts and things
bb4c8214 20echo 'Unpacking master config files...'
d4232c5c 21dpkg -i /media/cdrom/simple-cdd/trc6500-master-file* # version-proof
bb4c8214 22echo 'Files unpacked'
9c7f26be 23
bb4c8214 24echo 'Adding TRC6500 public key to keyring...'
9c7f26be 25cat /media/cdrom/simple-cdd/TRC6500.pub | apt-key add -
bb4c8214
LM
26echo 'Key added'
27
4e3ad0da
LM
28echo 'Removing exim packages...'
29dpkg -l | awk '/exim/ {print $2}' | xargs dpkg --remove bsd-mailx
30find /media/cdrom0 -name libgnutls-openssl\*_\* -o -name ssmtp_\* -o -name bsd-mailx_\* | xargs dpkg --install
31echo 'Exim remove
9c7f26be 32
9c7f26be
OL
33# our interfaces file gets written over for some reason, we'll copy it and restore it on first boot
34# note : after install, we'll be executing our own rc.local on first boot
bb4c8214 35echo 'Copying first-boot script (/etc/rc.local)...'
9c7f26be
OL
36cp /etc/network/interfaces /etc/network/interfaces.original
37mv /etc/rc.local /etc/rc.local.original
38cp /media/cdrom/simple-cdd/myrc.local /etc/rc.local
bb4c8214 39echo 'Script copied'
9c7f26be 40
bb4c8214 41echo 'Deleting simple-cdd files on disk...'
40346f7c 42rm -r /usr/local/simple-cdd
e043b5aa
OL
43rm -r /etc/dpkg/dpkg.cfg.d/trc6500
44echo 'Files deleted'
9c7f26be 45
4e3ad0da 46echo 'Umount cdrom'
9c7f26be 47umount /media/cdrom
4e3ad0da
LM
48
49exit 0