- dont build wireless-tools anymore
[build.git] / config.planetlab / bootstrapfs.post
1 #!/bin/bash
2
3 vdir=$1
4 if [ -z "${vdir}" ] ; then
5         echo "ERROR: $0"
6         echo "Provide the directory of the root filesystem to operate on"
7         exit
8 fi
9
10 # Remove unneeded services
11 for service in util-vserver vprocunhide vservers-default; do
12     chroot ${vdir} /sbin/chkconfig $service off
13 done
14
15 # Disable splaying of cron.
16 echo > ${vdir}/etc/sysconfig/crontab
17
18 # sss
19 # update /etc/sysconfig/network-scripts/ifup
20 #  #if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
21       #echo $"Error, some other host already uses address ${IPADDR}."
22       #exit 1
23    #fi
24
25 # Add site_admin account
26 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
27
28 ( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
29 --- halt        2007-10-08 19:18:54.000000000 +0000
30 +++ halt2       2008-05-07 17:52:42.000000000 +0000
31 @@ -65,8 +65,10 @@
32  # Kill all processes.
33  [ "\${BASH+bash}" = bash ] && enable kill
34
35 +action $"Sending all VServers the TERM signal..."  ls -d /proc/virtual/[0-9]* | awk -F '/' '{print \$4}' | xargs -I{} /usr/sbin/vkill -s 15 --xid {} -- 0
36  action $"Sending all processes the TERM signal..." /sbin/killall5 -15
37  sleep 2
38 +action $"Sending all VServers the KILL signal..."  ls -d /proc/virtual/[0-9]* | awk -F '/' '{print \$4}' | xargs -I{} /usr/sbin/vkill -s 9 --xid {} -- 0
39  action $"Sending all processes the KILL signal..."  /sbin/killall5 -9
40
41  # Write to wtmp file before unmounting /var
42 EOF
43
44
45 ( cat <<EOF ) | patch -d ${vdir}/etc/sysconfig/network-scripts/
46 --- ifup-eth    2008-05-30 13:20:17.382681663 +0000
47 +++ ifup-eth-fixed      2008-06-03 16:41:25.284200756 +0000
48 @@ -214,10 +214,10 @@
49          /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
50      fi
51
52 -    if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
53 -       echo $"Error, some other host already uses address ${IPADDR}."
54 -       exit 1
55 -    fi
56 +#    if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
57 +#      echo $"Error, some other host already uses address ${IPADDR}."
58 +#      exit 1
59 +#    fi
60
61      if [ "${DEVICE}" = "lo" ]; then
62         SCOPE="scope host"
63 EOF