|
Harald Hoyer |
55891e |
From 16457c869d3fac6a94e204f1edac1ad9fffae55a Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
55891e |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
55891e |
Date: Tue, 20 Sep 2011 11:16:53 +0200
|
|
Harald Hoyer |
55891e |
Subject: [PATCH] mount securityfs in a seperate dracut module
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
---
|
|
Harald Hoyer |
55891e |
modules.d/96securityfs/module-setup.sh | 15 +++++++++++++++
|
|
Harald Hoyer |
55891e |
modules.d/96securityfs/securityfs.sh | 10 ++++++++++
|
|
Harald Hoyer |
55891e |
modules.d/98integrity/module-setup.sh | 2 +-
|
|
Harald Hoyer |
55891e |
modules.d/99base/init | 6 ------
|
|
Harald Hoyer |
55891e |
4 files changed, 26 insertions(+), 7 deletions(-)
|
|
Harald Hoyer |
55891e |
create mode 100755 modules.d/96securityfs/module-setup.sh
|
|
Harald Hoyer |
55891e |
create mode 100755 modules.d/96securityfs/securityfs.sh
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
diff --git a/modules.d/96securityfs/module-setup.sh b/modules.d/96securityfs/module-setup.sh
|
|
Harald Hoyer |
55891e |
new file mode 100755
|
|
Harald Hoyer |
55891e |
index 0000000..fbe3aa3
|
|
Harald Hoyer |
55891e |
--- /dev/null
|
|
Harald Hoyer |
55891e |
+++ b/modules.d/96securityfs/module-setup.sh
|
|
Harald Hoyer |
55891e |
@@ -0,0 +1,15 @@
|
|
Harald Hoyer |
55891e |
+#!/bin/bash
|
|
Harald Hoyer |
55891e |
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
Harald Hoyer |
55891e |
+# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
Harald Hoyer |
55891e |
+
|
|
Harald Hoyer |
55891e |
+check() {
|
|
Harald Hoyer |
55891e |
+ return 255
|
|
Harald Hoyer |
55891e |
+}
|
|
Harald Hoyer |
55891e |
+
|
|
Harald Hoyer |
55891e |
+depends() {
|
|
Harald Hoyer |
55891e |
+ return 0
|
|
Harald Hoyer |
55891e |
+}
|
|
Harald Hoyer |
55891e |
+
|
|
Harald Hoyer |
55891e |
+install() {
|
|
Harald Hoyer |
55891e |
+ inst_hook cmdline 60 "$moddir/securityfs.sh"
|
|
Harald Hoyer |
55891e |
+}
|
|
Harald Hoyer |
55891e |
diff --git a/modules.d/96securityfs/securityfs.sh b/modules.d/96securityfs/securityfs.sh
|
|
Harald Hoyer |
55891e |
new file mode 100755
|
|
Harald Hoyer |
55891e |
index 0000000..03ee4dd
|
|
Harald Hoyer |
55891e |
--- /dev/null
|
|
Harald Hoyer |
55891e |
+++ b/modules.d/96securityfs/securityfs.sh
|
|
Harald Hoyer |
55891e |
@@ -0,0 +1,10 @@
|
|
Harald Hoyer |
55891e |
+#!/bin/sh
|
|
Harald Hoyer |
55891e |
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
Harald Hoyer |
55891e |
+# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
Harald Hoyer |
55891e |
+
|
|
Harald Hoyer |
55891e |
+SECURITYFSDIR="/sys/kernel/security"
|
|
Harald Hoyer |
55891e |
+export SECURITYFSDIR
|
|
Harald Hoyer |
55891e |
+
|
|
Harald Hoyer |
55891e |
+if ! ismounted "${SECURITYFSDIR}"; then
|
|
Harald Hoyer |
55891e |
+ mount -t securityfs -o nosuid,noexec,nodev securityfs ${SECURITYFSDIR} >/dev/null 2>&1
|
|
Harald Hoyer |
55891e |
+fi
|
|
Harald Hoyer |
55891e |
diff --git a/modules.d/98integrity/module-setup.sh b/modules.d/98integrity/module-setup.sh
|
|
Harald Hoyer |
55891e |
index cab9027..7d5771c 100755
|
|
Harald Hoyer |
55891e |
--- a/modules.d/98integrity/module-setup.sh
|
|
Harald Hoyer |
55891e |
+++ b/modules.d/98integrity/module-setup.sh
|
|
Harald Hoyer |
55891e |
@@ -7,7 +7,7 @@ check() {
|
|
Harald Hoyer |
55891e |
}
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
depends() {
|
|
Harald Hoyer |
55891e |
- echo masterkey
|
|
Harald Hoyer |
55891e |
+ echo masterkey securityfs
|
|
Harald Hoyer |
55891e |
return 0
|
|
Harald Hoyer |
55891e |
}
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
diff --git a/modules.d/99base/init b/modules.d/99base/init
|
|
Harald Hoyer |
55891e |
index fa808ca..06d61a8 100755
|
|
Harald Hoyer |
55891e |
--- a/modules.d/99base/init
|
|
Harald Hoyer |
55891e |
+++ b/modules.d/99base/init
|
|
Harald Hoyer |
55891e |
@@ -86,12 +86,6 @@ RD_DEBUG=""
|
|
Harald Hoyer |
55891e |
[ ! -d /sys/kernel ] && \
|
|
Harald Hoyer |
55891e |
mount -t sysfs -o nosuid,noexec,nodev sysfs /sys >/dev/null 2>&1
|
|
Harald Hoyer |
55891e |
|
|
Harald Hoyer |
55891e |
-SECURITYFSDIR="/sys/kernel/security"
|
|
Harald Hoyer |
55891e |
-export SECURITYFSDIR
|
|
Harald Hoyer |
55891e |
-if ! ismounted "${SECURITYFSDIR}"; then
|
|
Harald Hoyer |
55891e |
- mount -t securityfs -o nosuid,noexec,nodev securityfs ${SECURITYFSDIR} >/dev/null 2>&1
|
|
Harald Hoyer |
55891e |
-fi
|
|
Harald Hoyer |
55891e |
-
|
|
Harald Hoyer |
55891e |
if [ -x /lib/systemd/systemd-timestamp ]; then
|
|
Harald Hoyer |
55891e |
RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp)
|
|
Harald Hoyer |
55891e |
else
|