diff mbox series

[3/4] base-files: Install /etc/mtab in a systemd-friendly way

Message ID 4baea9df11ee5e91a5a425a63d91fcb4b22d03a2.1783357184.git.joerg.sommer@navimatix.de
State New
Headers show
Series [1/4] files/fs-perms.txt: Replace /srv by $servicedir | expand

Commit Message

Jörg Sommer July 6, 2026, 4:59 p.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

The old mtab pointed to /proc/mounts which itself is a symlink. Systemd
therefore tries to replace it with a symlink to /proc/self/mounts, but fails
on a read-only rootfs:

    systemd-tmpfiles: symlink(../proc/self/mounts, /etc/mtab) failed: Read-only file system

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index d4d777b485..aafc0aa923 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -109,7 +109,7 @@  do_install () {
 	install -m 0644 ${S}/host.conf ${D}${sysconfdir}/host.conf
 	install -m 0644 ${S}/motd ${D}${sysconfdir}/motd
 
-	ln -sf /proc/mounts ${D}${sysconfdir}/mtab
+	ln -sf ../proc/self/mounts ${D}${sysconfdir}/mtab
 
 	# deal with hostname
 	if [ "${hostname}" ]; then