]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- apply rc-scripts-modprobe-cache.patch and rc-scripts-selinuxfs.patch patches from...
authorAdam Osuchowski <adwol@pld-linux.org>
Tue, 4 Sep 2018 15:10:15 +0000 (17:10 +0200)
committerAdam Osuchowski <adwol@pld-linux.org>
Tue, 4 Sep 2018 15:10:15 +0000 (17:10 +0200)
rc.d/rc.sysinit

index 6fdca19f8448013b5544ac579ba22b48031374c2..b5fc94fff66196da6f4e172c50aa1707cccc7e7d 100755 (executable)
@@ -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
This page took 0.161693 seconds and 4 git commands to generate.