+
+# make sure we do not end up with an empty /selinux
+# libvirt gets all confused when that happens
+cd ${vdir}
+if [ -d selinux ] ; then
+ if [ "$(ls -A selinux)" ] ; then
+ echo "* sliceimage.post: WARNING: ${vdir}/selinux is not empty - preserving"
+ else
+ echo "* sliceimage.post: REMOVING empty ${vdir}/selinux"
+ rmdir selinux
+ fi
+fi
+
+# for when runing under lxc, make sure we don't try to fsck from a slice
+sed -i -e 's,1 1,0 0,' ${vdir}/etc/fstab
+
+# a workaround for running f12 slices under f18; as per Andy findings, we
+# remove /etc/event.d/tty[23456] inside the slice image
+# this is not required in f>=16 since these files are upstart-specific anyway
+rm -f ${vdir}/etc/event.d/tty[23456]
+
+# mid 2015 (I know..) : fix for fedora 14 slices
+# use fedora's archive, and other yum-related issues
+if [[ "$vdir" =~ .*f14.* ]] ; then
+ echo "* sliceimage.post: rectifying fedora14 slice image with fedora-release-14-2.noarch.rpm"
+ rpm --root=$vdir -U http://mirror.onelab.eu/third-party/fedora-release-14-2.noarch.rpm
+fi
+
+cd -