From 1062272ed0bc43356bd849cd7277ab2dd73db515 Mon Sep 17 00:00:00 2001 From: Adam Osuchowski Date: Tue, 4 Sep 2018 17:10:15 +0200 Subject: [PATCH] - apply rc-scripts-modprobe-cache.patch and rc-scripts-selinuxfs.patch patches from packages/rc-scripts --- rc.d/rc.sysinit | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 6fdca19f..b5fc94ff 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -47,6 +47,7 @@ modprobe_c() { # 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 @@ -123,10 +124,11 @@ init_selinux() { 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 @@ -430,6 +432,12 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then 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 @@ -701,8 +709,8 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then 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 -- 2.43.0