5 if [ -z "${vdir}" ] ; then
7 echo "Provide the directory of the root filesystem to operate on"
11 # reset root password to be empty
12 echo "in slice image: resetting root password"
13 sed -i -e "s/root:[\*|x]/root:/" ${vdir}/etc/passwd
15 # modify the sudoers file to remove the 'requiretty' attribute
16 echo "in slice image: removing requiretty from /etc/sudoers"
17 sed -i -e 's,^\(Defaults.*requiretty\),#\1,' ${vdir}/etc/sudoers
19 # disable Upstart by creating a symlink to /bin/true
20 #mv ${vdir}/sbin/initctl ${vdir}/sbin/initctl.orig
21 chroot ${vdir} mv /sbin/initctl /sbin/initctl.orig
22 chroot ${vdir} ln /bin/true /sbin/initctl
24 # Fix up /etc/init.d/halt
25 # xxx this would be wrong in f>=16 because there's no /sbin anymore
26 # but I suspect this is for vserver only..
27 echo "in slice image: fixing /etc/init.d/halt"
28 cat > ${vdir}/etc/init.d/halt <<EOF
30 exec /sbin/killall5 -15
33 # make sure we do not end up with an empty /selinux
34 # libvirt gets all confused when that happens
36 if [ -d selinux ] ; then
37 if [ "$(ls -A selinux)" ] ; then
38 echo "sliceimage.post: WARNING: ${vdir}/selinux is not empty - preserving"
40 echo "sliceimage.post: REMOVING empty ${vdir}/selinux"