diff mbox series

overlayfs-etc: Unmount /sys and /proc before init

Message ID 20250325094013.3926549-2-pavel@zhukoff.net
State Accepted, archived
Commit 94b3f86bac16ac3be468e23e1f6aad69cdf502d3
Headers show
Series overlayfs-etc: Unmount /sys and /proc before init | expand

Commit Message

Pavel Zhukov March 25, 2025, 9:40 a.m. UTC
/sys filesystem mounted by the preinit script causes shadowing of
/sys/firmware/efi/ by double /sys mounting on systemd enabled systems
[1]. As the result EFI tooling is broken

[1]
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,relatime)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
---
 meta/files/overlayfs-etc-preinit.sh.in | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/files/overlayfs-etc-preinit.sh.in b/meta/files/overlayfs-etc-preinit.sh.in
index b05e3957a3..973887649a 100644
--- a/meta/files/overlayfs-etc-preinit.sh.in
+++ b/meta/files/overlayfs-etc-preinit.sh.in
@@ -48,5 +48,8 @@  else
     echo "PREINIT: Mounting </data> failed!"
 fi
 
+umount /sys
+umount /proc
+
 echo "PREINIT: done; starting </sbin/init>"
 exec {SBIN_INIT_NAME}