From defac991f4c683f33d73366fcb849c72e0f2715d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 30 Oct 2005 22:14:59 +0000 Subject: [PATCH] Mount securityfs filesystem on kernel >= 2.6.14. svn-id: @6504 --- rc.d/rc.shutdown | 4 ++-- rc.d/rc.sysinit | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rc.d/rc.shutdown b/rc.d/rc.shutdown index c03be395..fff14c34 100755 --- a/rc.d/rc.shutdown +++ b/rc.d/rc.shutdown @@ -51,7 +51,7 @@ if ! is_yes "$VSERVER"; then sig=-15 retry=3 force= - remaining=$(awk '!/(^#| proc | loopfs | devfs | devpts | shm | iso9660 | ramfs | tmpfs | sysfs | squashfs |^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts) + remaining=$(awk '!/(^#| proc | loopfs | devfs | devpts | shm | iso9660 | ramfs | tmpfs | sysfs | securityfs | squashfs |^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts) while [ -n "$remaining" -a "$retry" -gt 0 ] do show "Unmounting file systems" ; busy @@ -63,7 +63,7 @@ if ! is_yes "$VSERVER"; then fi sleep 2 - remaining=$(awk '!/(^#| proc | loopfs | devfs | devpts | shm | iso9660 | ramfs | tmpfs | sysfs | squashfs |^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts) + remaining=$(awk '!/(^#| proc | loopfs | devfs | devpts | shm | iso9660 | ramfs | tmpfs | sysfs | securityfs | squashfs |^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts) [ -z "$remaining" ] && break /sbin/fuser -k -m $sig $remaining > /dev/null sleep 5 diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 5107a15c..c2034465 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -63,6 +63,11 @@ fi # sysfs is also needed before any other things (under kernel > 2.5) if ! is_yes "$VSERVER" && grep -q sysfs /proc/filesystems 2>/dev/null ; then mount -n -o gid=17 -t sysfs sysfs /sys + if [ "$(kernelver)" -ge "002006014" ] && \ + grep -q securityfs /proc/filesystems 2>/dev/null ; then + mount -n -o gid=17 -t securityfs securityfs /sys/kernel/security + fi + fi # selinux @@ -389,6 +394,10 @@ if ! is_yes "$VSERVER"; then if grep -q sysfs /proc/filesystems 2>/dev/null ; then mount -f -t sysfs sysfs /sys + if [ "$(kernelver)" -ge "002006014" ] && \ + grep -q securityfs /proc/filesystems 2>/dev/null ; then + mount -f -t securityfs securityfs /sys/kernel/security + fi fi if grep -q selinuxfs /proc/filesystems 2>/dev/null ; then -- 2.44.0