Import from Clearcase LIV_TRC6500_V2.2.3
[debian6500.git] / install / cluster / Makefile
1 current_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2
3 .PHONY: all root slave bios initrd clean
4 help:
5 @echo This make file contains severals targets:
6 @echo ' - help: print this help;'
7 @echo ' - root: creates root tarball;'
8 @echo ' - slave: creates slave tarballs;'
9 @echo ' - bios: creates bios tarball;'
10 @echo ' - initrd: update initrd;'
11 @echo ' - clean: remove created tarballs, and cleanup file system in order to build ISO.'
12
13
14 all: root slave bios
15
16 root slave bios:
17 $(current_dir)bin/create_$@_tarball.sh
18
19 initrd:
20 update-initramfs -u
21
22 clean:
23 service trc6500 stop
24 -rm /opt/tftp/*.tgz
25 aptitude remove $(shell apt-mark showmanual trc6500\*|egrep -v webconfig\|rproxy) ace tao myccm
26 cp -f /etc/dhcp/dhcpd.conf.blank /etc/dhcp/dhcpd.conf
27 chown webconfig: /etc/dhcp/dhcpd.conf*
28 echo "Etc/Zulu" > /etc/timezone
29 sed -i 's/XKBLAYOUT=.*/XKBLAYOUT="us"/;s/XKBVARIANT=.*/XKBVARIANT=""/;s/XKBOPTIONS=.*/XKBOPTIONS=""/' /etc/default/keyboard
30 find -P /dump/ -mindepth 2 -maxdepth 2 -print -exec rm -rf -v {} \;
31 find -P /home/ -mindepth 1 -maxdepth 1 ! -wholename '/home/trc6500' -exec rm -rf -v {} \;
32 find -P /opt/ -mindepth 1 -maxdepth 1 -regextype posix-egrep ! -regex '.*/(bios|cluster|ipmi|tftp)$$' -exec rm -rf -v {} \;
33 find -P /root/ -mindepth 1 -maxdepth 1 -name ".*" -o -name bin -o -exec rm -rf -v {} \;
34 -mkdir --parents /opt/trc6500/debian-rep
35 rm -f /root/.bash_history
36 rm -rf $(shell mount|awk '/type ext/ {print $$3 "/lost+found/*"}')
37 rm -rf /var/lib/nfs/v4recovery/*
38 find /var/log/ -type f -exec rm -f {} \;
39 touch /var/log/btmp /var/log/wtmp /var/log/lastlog
40 chmod ug+rw,o-rw,a-x /var/log/btmp
41 chmod ug+rw,o+r,o-w,a-x /var/log/wtmp /var/log/lastlog
42 chown root:utmp /var/log/btmp /var/log/wtmp /var/log/lastlog
43 find / -name trc6500_list_patched_files.txt -exec rm -f {} \;