]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
base-files: Install /etc/mtab in a systemd-friendly way
authorJörg Sommer <joerg.sommer@navimatix.de>
Thu, 16 Jul 2026 20:06:47 +0000 (22:06 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 Jul 2026 09:33:11 +0000 (10:33 +0100)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/base-files/base-files_3.0.14.bb

index 0cd6600782f915d09eba2e834c132dcf3e2bc97e..332c094eee565a6135e6706247e05819481aa6bb 100644 (file)
@@ -102,7 +102,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