read only: fix problem when mounting external devices

In commit a84d011 this was fixed for mount_digiparts.sh, but
was missing the fix in the mount.sh script.

In that commit there is a full explanation about why this
solves the issue.

https://onedigi.atlassian.net/browse/DEL-8721

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2024-01-03 12:40:17 +01:00
parent 0cba27a016
commit 0aa5003267
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,12 @@ do_install:append() {
install -d ${D}/mnt/linux
install -d ${D}/mnt/update
install -d ${D}/mnt/data
# Change mount.sh to check "/sbin/init.orig" additionally to determine if a system is using systemd.
sed -i '/^BASE_INIT=/a BASE_INIT_ORIG="$(readlink -f "@base_sbindir@/init.orig")"' \
${D}${sysconfdir}/udev/scripts/mount.sh
sed -i 's/if \[ "x$BASE_INIT" = "x$INIT_SYSTEMD" \];then/if \[ "x$BASE_INIT" = "x$INIT_SYSTEMD" \] || \[ "x$BASE_INIT_ORIG" = "x$INIT_SYSTEMD" \]; then/' \
${D}${sysconfdir}/udev/scripts/mount.sh
sed -i -e 's|@base_sbindir@|${base_sbindir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
fi
install -m 0755 ${WORKDIR}/mount_digiparts.sh ${D}${sysconfdir}/udev/scripts/