In initramfs-framework, before swith_root rootfs, if udev have time to
run (before being killed), it will invoke hook mount.sh (which is provided
by udev-extraconf) to mount /run/media/XXX.

Release the mounted disk after udev being killed.

Signed-off-by: Hongxu Jia <hongxu....@windriver.com>
---
 meta/recipes-core/initrdscripts/initramfs-framework/udev | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev 
b/meta/recipes-core/initrdscripts/initramfs-framework/udev
index 4898b89246..8b62080c68 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/udev
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -8,6 +8,11 @@ udev_shutdown_hook_handler() {
        if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
                udevadm settle
                killall `basename $_UDEV_DAEMON` 2>/dev/null
+
+               # Umount other media which is mounted by udev
+               for dir in `awk '/\/dev.* \/run\/media/{print $2}' 
/proc/mounts`; do
+                       umount $dir
+               done
        fi
 }
 
-- 
2.18.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#138651): 
https://lists.openembedded.org/g/openembedded-core/message/138651
Mute This Topic: https://lists.openembedded.org/mt/74450071/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to