From 5cf59b06501235426ce581259588656a6b0752a9 Mon Sep 17 00:00:00 2001 From: Kuba <36666515+QB4-dev@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:55:55 +0200 Subject: [PATCH] udev-extraconf: mount.sh fix for overlayfs-etc If overlayfs-etc bbclas is used original /sbin/init is set to /sbin/init.orig and if systemd is used as init mount.sh script starts using mount command instead systemd-mount. The result is that automatically mounted devices are not visible in rootfs --- meta/recipes-core/udev/udev-extraconf/mount.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index b7e86dbc0e6..dea86d14593 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -8,6 +8,12 @@ BASE_INIT="`readlink -f "@base_sbindir@/init"`" INIT_SYSTEMD="@systemd_unitdir@/systemd" MOUNT_BASE="@MOUNT_BASE@" +# check if init.orig exists. This file is created by overlayfs-etc +# See more here: https://git.yoctoproject.org/poky/plain/meta/classes-recipe/overlayfs-etc.bbclass +if [ -f "@base_sbindir@/init.orig" ];then + BASE_INIT="`readlink -f "@base_sbindir@/init.orig"`" +fi + if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then # systemd as init uses systemd-mount to mount block devices MOUNT="/usr/bin/systemd-mount"