]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
30convertfs/convertfs.sh: call setfiles w/o path & check for existence
authorHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 19:56:14 +0000 (20:56 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 19:57:12 +0000 (20:57 +0100)
modules.d/30convertfs/convertfs.sh

index 9ee47d32d2fb62499e79e4adeaf166f54d289e69..ab4e97a942fd266f4f776c6171d2198cf66a1116 100755 (executable)
@@ -167,9 +167,9 @@ echo "Run ldconfig."
 ldconfig -r "$ROOT"
 
 . $ROOT/etc/selinux/config
-if [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then
+if [ -n "$(command -v setfiles)" ] && [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then
     echo "Fixing SELinux labels"
-    /usr/sbin/setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
+    setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
 fi
 
 echo "Done."