summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2017-03-10 13:12:42 +0100
committerDave Reisner <dreisner@archlinux.org>2017-03-10 13:19:24 +0100
commit70511e5ccb7e2500213e04173a70c067a7c9aa35 (patch)
tree3c2f80ed63d5360a76e98442d5dba61953d0ab6e
parent5249350c80a6158ebcf278e780f42c6abc3643f1 (diff)
downloadmkinitcpio-70511e5ccb7e2500213e04173a70c067a7c9aa35.tar.gz
mkinitcpio-70511e5ccb7e2500213e04173a70c067a7c9aa35.tar.xz
init: move early mounting to function, add efivars
ref: https://bugs.archlinux.org/task/52768
-rw-r--r--init6
-rw-r--r--init_functions12
2 files changed, 13 insertions, 5 deletions
diff --git a/init b/init
index 4891ed8..2cb3526 100644
--- a/init
+++ b/init
@@ -7,11 +7,7 @@ rd_logmask=0
. /init_functions
-mount -t proc proc /proc -o nosuid,noexec,nodev
-mount -t sysfs sys /sys -o nosuid,noexec,nodev
-mount -t devtmpfs dev /dev -o mode=0755,nosuid
-mount -t tmpfs run /run -o nosuid,nodev,mode=0755
-mkdir -m755 /run/initramfs
+mount_setup
# parse the kernel command line
parse_cmdline </proc/cmdline
diff --git a/init_functions b/init_functions
index d5a584e..dfe2036 100644
--- a/init_functions
+++ b/init_functions
@@ -481,4 +481,16 @@ rdlogger() {
rm -f /run/initramfs/rdlogger.pipe /run/initramfs/rdlogger.pid
}
+mount_setup() {
+ mount -t proc proc /proc -o nosuid,noexec,nodev
+ mount -t sysfs sys /sys -o nosuid,noexec,nodev
+ mount -t devtmpfs dev /dev -o mode=0755,nosuid
+ mount -t tmpfs run /run -o nosuid,nodev,mode=0755
+ mkdir -m755 /run/initramfs
+
+ if [ -e /sys/firmware/efi ]; then
+ mount -t efivarfs efivarfs /sys/firmware/efi/efivars -o nosuid,nodev,noexec
+ fi
+}
+
# vim: set ft=sh ts=4 sw=4 et: