From 72819baa8397eafde951f1437b9cdcf964f44c1d Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Tue, 21 May 2024 21:08:57 +0200 Subject: [PATCH] - PLD merge: fix first use of modprobe_c, most likely usb or firewire controller setup, use /sys/fs/selinux as selinuxfs mount point if available --- rc.d/rc.sysinit | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 524fe97..750e16a 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,8 +124,8 @@ init_selinux() { if ! grep -Fq selinuxfs /proc/filesystems; then # no support in kernel, no chance SELINUX=no - elif ! is_fsmounted selinuxfs /selinux; then - mount -n -t selinuxfs selinuxfs /selinux + elif ! is_fsmounted selinuxfs $selinuxfsdir; then + mount -n -t selinuxfs selinuxfs $selinuxfsdir fi # Check SELinux status @@ -378,6 +379,12 @@ if [[ "$container" != lxc* ]]; then mount -n -o rw -t efivarfs efivarfs /sys/firmware/efi/efivars fi + if [ -d /sys/fs/selinux ]; then + # Linux 3.0+ + selinuxfsdir=/sys/fs/selinux + else + selinuxfsdir=/selinux + fi init_selinux # Choose Hardware profile @@ -647,8 +654,8 @@ if [[ "$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.45.2