From: Marcin Krol Date: Tue, 21 May 2024 19:08:57 +0000 (+0200) Subject: - PLD merge: fix first use of modprobe_c, most likely usb or firewire controller... X-Git-Tag: 0.5.4~6 X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=72819baa8397eafde951f1437b9cdcf964f44c1d;p=rc-scripts.git - 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 --- 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