From b156ef0d68e7f1390486111cf69631e3bdfa3a04 Mon Sep 17 00:00:00 2001 From: "dyoung@redhat.com" Date: Wed, 5 Jun 2013 16:01:17 +0800 Subject: [PATCH] depends on dracut selinux module depends on 98selinux if 1st kernel selinux is enabled so we can load_policy and correctly label the vmcore/vmcore-dmesg files. Since dracut always mount rootfs, the 98selinux will chroot and load_policy, so this will be ok for Fedora. In case rootfs mount failure we have to check and relable vmcore files, will add the kdumpctl relabeling code in another patch. add 'dracut_args --printsize' to /etc/kdump.conf, it shows below added size: selinux install size: 16k Tested on F19: With this patch applied, vmcore selinux attr is ok. v1->v2: use sestatus 2>/dev/null to mute error messages Signed-off-by: Dave Young Acked-by: Vivek Goyal --- dracut-module-setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index fd178b1..72b503d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -13,7 +13,12 @@ check() { } depends() { - echo "base shutdown" + local _dep="base shutdown" + + if sestatus 2>/dev/null | grep -q "SELinux status.*enabled"; then + _dep="$_dep selinux" + fi + echo $_dep return 0 }