sliceimage vs vserver in pkgs
[build.git] / config.planetlab / sliceimage.post
diff --git a/config.planetlab/sliceimage.post b/config.planetlab/sliceimage.post
new file mode 100644 (file)
index 0000000..7d518f4
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+vdir=$1
+
+if [ -z "${vdir}" ] ; then
+       echo "ERROR: $0"
+       echo "Provide the directory of the root filesystem to operate on"
+       exit
+fi
+
+# reset root password to be empty
+echo "Resetting root password in vserver-reference image"
+sed -i -e "s/root:[\*|x]/root:/" ${vdir}/etc/passwd
+
+# modify the sudoers file to remove the 'requiretty' attribute
+echo "Removing requiretty from default /etc/sudoers file"
+sed -i -e 's,^\(Defaults.*requiretty\),#\1,' ${vdir}/etc/sudoers
+
+# Fix up /etc/init.d/halt 
+echo "Fixing /etc/init.d/halt in vserver-reference image"
+cat > ${vdir}/etc/init.d/halt <<EOF
+#!/bin/bash
+exec /sbin/killall5 -15
+EOF