Re: [OE-core] [PATCH] initramfs-framework/udev: umount /run/media/XXX

2020-05-28 Thread hongxu

On 5/27/20 6:40 PM, hongxu wrote:

On 5/27/20 5:52 PM, Richard Purdie wrote:

On Mon, 2020-05-25 at 11:06 +0800, hongxu wrote:

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.

This feels like a workaround. Would we be better off not installing the
mount scripts into the initramfs in the first place?


Follow your suggestion, I just tested it to remove the script, and 
everything works well,


I will remove it in V2


Hi RP,

As the oe-selftest result, the mount scripts (/run/media/XXX) was used by

meta/recipes-core/initrdscripts/files/init-install.sh, we could not 
remove mount.sh in V2


How about this workaround V1

//Hongxu


//Hongxu


Cheers,

Richard








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

View/Reply Online (#138876): 
https://lists.openembedded.org/g/openembedded-core/message/138876
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]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] initramfs-framework/udev: umount /run/media/XXX

2020-05-27 Thread hongxu

On 5/27/20 5:52 PM, Richard Purdie wrote:

On Mon, 2020-05-25 at 11:06 +0800, hongxu wrote:

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.

This feels like a workaround. Would we be better off not installing the
mount scripts into the initramfs in the first place?


Follow your suggestion, I just tested it to remove the script, and 
everything works well,


I will remove it in V2

//Hongxu


Cheers,

Richard



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

View/Reply Online (#138775): 
https://lists.openembedded.org/g/openembedded-core/message/138775
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]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] initramfs-framework/udev: umount /run/media/XXX

2020-05-27 Thread Richard Purdie
On Mon, 2020-05-25 at 11:06 +0800, hongxu wrote:
> 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.

This feels like a workaround. Would we be better off not installing the
mount scripts into the initramfs in the first place?

Cheers,

Richard

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

View/Reply Online (#138772): 
https://lists.openembedded.org/g/openembedded-core/message/138772
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]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] initramfs-framework/udev: umount /run/media/XXX

2020-05-24 Thread hongxu
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 
---
 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]
-=-=-=-=-=-=-=-=-=-=-=-