30convertfs/convertfs.sh: call setfiles w/o path & check for existence

master
Harald Hoyer 2012-02-07 20:56:14 +01:00
parent 567cc5d814
commit ce18bc4e97
1 changed files with 2 additions and 2 deletions

View File

@ -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."