diff mbox series

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

Message ID 8b2633f8540d0417d0014b0a3803c4e8b0a37a92.1784232384.git.joerg.sommer@navimatix.de
State New
Headers show
Series [v2] base-files: Install /etc/mtab in a systemd-friendly way | expand

Commit Message

Jörg Sommer July 16, 2026, 8:06 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 | 3 ++-
 1 file changed, 2 insertions(+), 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 99ac19eb58..87814b8e12 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,8 @@  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
+	# systemd likes to have a relative link
+	ln -sf --relative ${D}/proc/self/mounts ${D}${sysconfdir}/mtab
 
 	# deal with hostname
 	if [ "${hostname}" ]; then