All of lore.kernel.org
 help / color / mirror / Atom feed
From: "hongxu" <hongxu.jia@windriver.com>
To: <openembedded-core@lists.openembedded.org>,
	<richard.purdie@linuxfoundation.org>
Subject: [oe-core][PATCH 1/4] initramfs-framework/udev: umount /run/media/XXX
Date: Fri, 25 Sep 2020 00:05:32 -0700	[thread overview]
Message-ID: <20200925070535.59518-2-hongxu.jia@windriver.com> (raw)
In-Reply-To: <20200925070535.59518-1-hongxu.jia@windriver.com>

In initramfs-framework, udev (initramfs-module-udev) calls hook mount.sh to
mount /run/media/XXX which is used by setup-live (initramfs-module-setup-live).
The setup-live calls install-XXX.sh and use /run/media/XXX to do installation

The side effect is while setup-live is not used, after it switches to rootfs,
and the mounted disk could not be released

Release the mounted disk before switch root and after kill udev

Signed-off-by: Hongxu Jia <hongxu.jia@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.21.0


  reply	other threads:[~2020-09-25  7:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  7:05 Review request 0/4: multiple fixes for oe-core hongxu
2020-09-25  7:05 ` hongxu [this message]
2021-06-11  7:36   ` [oe-core][PATCH 1/4] initramfs-framework/udev: umount /run/media/XXX Yu, Mingli
2021-06-11 16:46     ` Alexander Kanavin
2020-09-25  7:05 ` [oe-core][PATCH 2/4] util-linux: fix calling uuidd failed with /run/uuidd not found hongxu
2021-06-11  7:35   ` Yu, Mingli
2020-09-25  7:05 ` [oe-core][PATCH 3/4] archive: fix racing between do_ar_patched and do_kernel_configme hongxu
2021-06-11  7:38   ` Yu, Mingli
2020-09-25  7:05 ` [oe-core][PATCH 4/4] alsa-state: run alsactl store in pkg_postinst hongxu
2021-06-11  7:39   ` Yu, Mingli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925070535.59518-2-hongxu.jia@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.