4e802319 |
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 |
0d157072 |
26 | aptitude clean |
4e802319 |
27 | cp -f /etc/dhcp/dhcpd.conf.blank /etc/dhcp/dhcpd.conf |
28 | chown webconfig: /etc/dhcp/dhcpd.conf* |
29 | echo "Etc/Zulu" > /etc/timezone |
30 | sed -i 's/XKBLAYOUT=.*/XKBLAYOUT="us"/;s/XKBVARIANT=.*/XKBVARIANT=""/;s/XKBOPTIONS=.*/XKBOPTIONS=""/' /etc/default/keyboard |
31 | find -P /dump/ -mindepth 2 -maxdepth 2 -print -exec rm -rf -v {} \; |
32 | find -P /home/ -mindepth 1 -maxdepth 1 ! -wholename '/home/trc6500' -exec rm -rf -v {} \; |
33 | find -P /opt/ -mindepth 1 -maxdepth 1 -regextype posix-egrep ! -regex '.*/(bios|cluster|ipmi|tftp)$$' -exec rm -rf -v {} \; |
34 | find -P /root/ -mindepth 1 -maxdepth 1 -name ".*" -o -name bin -o -exec rm -rf -v {} \; |
35 | -mkdir --parents /opt/trc6500/debian-rep |
36 | rm -f /root/.bash_history |
37 | rm -rf $(shell mount|awk '/type ext/ {print $$3 "/lost+found/*"}') |
38 | rm -rf /var/lib/nfs/v4recovery/* |
39 | find /var/log/ -type f -exec rm -f {} \; |
40 | touch /var/log/btmp /var/log/wtmp /var/log/lastlog |
41 | chmod ug+rw,o-rw,a-x /var/log/btmp |
42 | chmod ug+rw,o+r,o-w,a-x /var/log/wtmp /var/log/lastlog |
43 | chown root:utmp /var/log/btmp /var/log/wtmp /var/log/lastlog |
44 | find / -name trc6500_list_patched_files.txt -exec rm -f {} \; |
014e866d |
45 | echo date +%Y%m%d > /etc/trc6500_os_version |