From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2] udev-extraconf: update mount.sh to use /run/media instead of /media
Date: Sun, 06 Apr 2014 18:46:39 -0400 [thread overview]
Message-ID: <20140406224639.GD3370@denix.org> (raw)
In-Reply-To: <1396324451-26983-1-git-send-email-denis@denix.org>
ping
On Mon, Mar 31, 2014 at 11:54:11PM -0400, Denys Dmytriyenko wrote:
> From: Denys Dmytriyenko <denys@ti.com>
>
> This is done to work around the issue of auto-mounting block devices
> (i.e. SD cards) when root filesystem is still in read-only mode and
> creating /media/<device> mount-points by udev is not possible. That
> is due to udev (/etc/rcS.d/S03udev) getting started earlier than
> checkroot (/etc/rcS.d/S10checkroot.sh) gets a chance to re-mount the
> rootfs as read-write.
>
> Although, canonical FHS specifies /media/<device> as a mount point
> for removable media devices, the latest 2.3 version was released in
> 2004 and since then FreeDesktop/udisks and other tools adopted the
> new /run/media/<user>/<device> location. That was done to overcome
> read-only rootfs limitation, since /run is usually a tmpfs mounted
> partition, plus avoid name-clash between users.
>
> For our embedded systems environment we assume single-user operation
> and hence simplify mount point to just /run/media/<device>. But for
> proper per-user mounting to /run/media/<user>/<device>, some sort of
> session management is required along with the tool like udisks, that
> is out of scope of this simple udev-based auto-mounting.
>
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> ---
> v2 - drop PR, bump PV, elaborate on session/user mounting option
>
> meta/recipes-core/udev/udev-extraconf/mount.sh | 14 +++++++-------
> .../udev/{udev-extraconf_1.0.bb => udev-extraconf_1.1.bb} | 2 --
> 2 files changed, 7 insertions(+), 9 deletions(-)
> rename meta/recipes-core/udev/{udev-extraconf_1.0.bb => udev-extraconf_1.1.bb} (99%)
>
> diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
> index cb57e47..3e4f21f 100644
> --- a/meta/recipes-core/udev/udev-extraconf/mount.sh
> +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
> @@ -20,7 +20,7 @@ done
> automount() {
> name="`basename "$DEVNAME"`"
>
> - ! test -d "/media/$name" && mkdir -p "/media/$name"
> + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
> # Silent util-linux's version of mounting auto
> if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
> then
> @@ -38,12 +38,12 @@ automount() {
> ;;
> esac
>
> - if ! $MOUNT -t auto $DEVNAME "/media/$name"
> + if ! $MOUNT -t auto $DEVNAME "/run/media/$name"
> then
> - #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
> - rm_dir "/media/$name"
> + #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!"
> + rm_dir "/run/media/$name"
> else
> - logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
> + logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful"
> touch "/tmp/.automount-$name"
> fi
> }
> @@ -60,7 +60,7 @@ rm_dir() {
>
> # No ID_FS_TYPE for cdrom device, yet it should be mounted
> name="`basename "$DEVNAME"`"
> -[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
> +[ -e /sys/block/$name/device/run/media ] && media_type=`cat /sys/block/$name/device/run/media`
>
> if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
> if [ -x "$PMOUNT" ]; then
> @@ -87,5 +87,5 @@ if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
>
> # Remove empty directories from auto-mounter
> name="`basename "$DEVNAME"`"
> - test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
> + test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name"
> fi
> diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb
> similarity index 99%
> rename from meta/recipes-core/udev/udev-extraconf_1.0.bb
> rename to meta/recipes-core/udev/udev-extraconf_1.1.bb
> index 3810b28..d69056d 100644
> --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
> +++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb
> @@ -4,8 +4,6 @@ LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
> file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>
> -PR = "r16"
> -
> SRC_URI = " \
> file://automount.rules \
> file://mount.sh \
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
next prev parent reply other threads:[~2014-04-06 22:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 3:54 [PATCH v2] udev-extraconf: update mount.sh to use /run/media instead of /media Denys Dmytriyenko
2014-04-06 22:46 ` Denys Dmytriyenko [this message]
2014-04-07 15:49 ` Saul Wold
2014-04-07 21:05 ` Denys Dmytriyenko
2014-04-07 22:22 ` Richard Purdie
2014-04-21 17:26 ` Denys Dmytriyenko
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=20140406224639.GD3370@denix.org \
--to=denis@denix.org \
--cc=openembedded-core@lists.openembedded.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.