Setting tag bootstrapfs-2.0-7
[build.git] / config.planetlab / bootstrapfs.post
index 2413251..d2092e1 100644 (file)
@@ -18,9 +18,14 @@ for service in network util-vserver; do
 done
 
 # Remove unneeded services
-for service in vprocunhide vservers-default; do
-    chroot ${vdir} /sbin/chkconfig $service off
-done
+# turn off firstboot if present, might cause the node to hang
+chroot ${vdir} /sbin/chkconfig firstboot off || :
+# this is to automatically restart vservers, let nm do that
+chroot ${vdir} /sbin/chkconfig vservers-default off || :
+# vprocunhide is required with kernels that have CONFIG_VSERVER_PROC_SECURE enabled
+# which is the case for our k32 kernel
+chroot ${vdir} /sbin/chkconfig vprocunhide on || :
+
 
 # Disable splaying of cron.
 echo > ${vdir}/etc/sysconfig/crontab
@@ -28,8 +33,16 @@ echo > ${vdir}/etc/sysconfig/crontab
 # Add site_admin account
 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
 
+# Remove 32bit packages from 64bit system (http://wiki.centos.org/FAQ/General#head-357346ff0bf7c14b0849c3bcce39677aaca528e9) 
+# use rpm instead of yum as /proc is not mounted at that poing 
+if echo ${vdir} | grep -q x86_64 ; then
+    chroot ${vdir} rpm -qa --qf '%{name}.%{arch}\n' | grep 'i[36]86$' | xargs chroot ${vdir} rpm -e
+fi
+
 # NOTE:  This is added to relieve one site's Cisco router configuration that
 # fails to recognize the host once the arping is sent out.
+# NOTE: this is pretty fragile, and fails on fedora 10 that as of today (oct. 20 2009) 
+# has initscripts-8.86.3-1.i386 which reads almost identical but with /sbin/arping instead
 cat <<\EOF | patch -d ${vdir}/etc/sysconfig/network-scripts/
 --- ifup-eth   2008-07-08 13:19:49.000000000 -0400
 +++ ifup-eth-orig      2008-07-08 13:20:02.000000000 -0400