We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1586af0 commit 4d59421Copy full SHA for 4d59421
dracut-initramfs-restore.sh
@@ -75,9 +75,12 @@ if [[ -d squash ]]; then
75
fi
76
77
78
-if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then
+if grep -q -w selinux /sys/kernel/security/lsm 2> /dev/null \
79
+ && [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then
80
. /etc/selinux/config
- [ -n "${SELINUXTYPE}" ] && /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
81
+ if [[ $SELINUX != "disabled" && -n $SELINUXTYPE ]]; then
82
+ /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
83
+ fi
84
85
86
exit 0
0 commit comments