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 # make sure we do not end up with an empty /selinux
20 # libvirt gets all confused when that happens
22 if [ -d selinux ] ; then
23 if [ "$(ls -A selinux)" ] ; then
24 echo "sliceimage.post: WARNING: ${vdir}/selinux is not empty - preserving"
26 echo "sliceimage.post: REMOVING empty ${vdir}/selinux"
31 # for when runing under lxc, make sure we don't try to fsck from a slice
32 sed -i -e 's,1 1,0 0,' ${vdir}/etc/fstab