# filter only what is wanted by this script: aliases and options
modprobe_c_cache=$(modprobe -c | grep -E '^(alias|options)')
+ echo "$modprobe_c_cache"
}
# parse kernel cmdline
if ! grep -Fq selinuxfs /proc/filesystems; then
# no support in kernel, no chance
SELINUX=no
+ return
fi
- if ! is_fsmounted selinuxfs /selinux; then
- mount -n -o gid=17 -t selinuxfs selinuxfs /selinux
+ if ! is_fsmounted selinuxfs $selinuxfsdir; then
+ mount -n -o gid=17 -t selinuxfs selinuxfs $selinuxfsdir
fi
# Check SELinux status
mount -n -o gid=17 -t securityfs securityfs /sys/kernel/security
fi
+ if [ -d /sys/fs/selinux ]; then
+ # Linux 3.0+
+ selinuxfsdir=/sys/fs/selinux
+ else
+ selinuxfsdir=/selinux
+ fi
init_selinux
# PLD Linux LiveCD support
fi
fi
- if is_fsmounted selinuxfs /selinux; then
- mount -f -t selinuxfs selinuxfs /selinux 2> /dev/null
+ if is_fsmounted selinuxfs $selinuxfsdir; then
+ mount -f -t selinuxfs selinuxfs $selinuxfsdir 2> /dev/null
fi
if [ ! -f /proc/modules ]; then