From 190f13a75e67e0bdb662188da79b8be31e0aae01 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 13 Jan 2023 23:17:06 +0000 Subject: [PATCH] init: attempt to mount efivarfs Mount efivarfs to /sys/firmware/efi/efivars if available. Tested-by: Oskari Rauta Signed-off-by: Daniel Golle --- initd/early.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/initd/early.c b/initd/early.c index 4857525..04aa10d 100644 --- a/initd/early.c +++ b/initd/early.c @@ -58,13 +58,14 @@ early_mounts(void) unsigned int oldumask = umask(0); if (!is_container()) { - mount("proc", "/proc", "proc", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); - mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, 0); + mount("proc", "/proc", "proc", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL); + mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL); + mount("efivars", "/sys/firmware/efi/efivars", "efivarfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL); mount("cgroup2", "/sys/fs/cgroup", "cgroup2", MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RELATIME, "nsdelegate"); mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=0755,size=512K"); ignore(symlink("/tmp/shm", "/dev/shm")); mkdir("/dev/pts", 0755); - mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, 0); + mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, NULL); early_dev(); } -- 2.30.2