* [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media
@ 2014-03-28 21:29 Denys Dmytriyenko
2014-03-29 15:17 ` Otavio Salvador
0 siblings, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2014-03-28 21:29 UTC (permalink / raw)
To: openembedded-core; +Cc: Denys Dmytriyenko
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>.
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
| 14 +++++++-------
| 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
--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
--git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.0.bb
index 3810b28..bae997c 100644
--- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
+++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
@@ -4,7 +4,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-PR = "r16"
+PR = "r17"
SRC_URI = " \
file://automount.rules \
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media
2014-03-28 21:29 [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media Denys Dmytriyenko
@ 2014-03-29 15:17 ` Otavio Salvador
2014-03-29 20:59 ` Denys Dmytriyenko
0 siblings, 1 reply; 4+ messages in thread
From: Otavio Salvador @ 2014-03-29 15:17 UTC (permalink / raw)
To: Denys Dmytriyenko
Cc: Denys Dmytriyenko,
Patches and discussions about the oe-core layer
Hello Denys,
On Fri, Mar 28, 2014 at 6:29 PM, Denys Dmytriyenko <denis@denix.org> 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.
Agreed.
> For our embedded systems environment we assume single-user operation
> and hence simplify mount point to just /run/media/<device>.
Please don't. I have customers using multiple users in an embedded
device and so I think it is better to adopt udisks standard here
instead of diverging from it without a reasoning.
...
> 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"
Please see above...
...
> --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
> +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
> @@ -4,7 +4,7 @@ LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
> file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>
> -PR = "r16"
> +PR = "r17"
Don't change PR; in fact with this change I'd say to move it to 1.1 and drop PR.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media
2014-03-29 15:17 ` Otavio Salvador
@ 2014-03-29 20:59 ` Denys Dmytriyenko
2014-03-29 21:05 ` Otavio Salvador
0 siblings, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2014-03-29 20:59 UTC (permalink / raw)
To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer
On Sat, Mar 29, 2014 at 12:17:23PM -0300, Otavio Salvador wrote:
> Hello Denys,
>
> On Fri, Mar 28, 2014 at 6:29 PM, Denys Dmytriyenko <denis@denix.org> 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.
>
> Agreed.
>
> > For our embedded systems environment we assume single-user operation
> > and hence simplify mount point to just /run/media/<device>.
>
> Please don't. I have customers using multiple users in an embedded
> device and so I think it is better to adopt udisks standard here
> instead of diverging from it without a reasoning.
I guess I should have phrased it a bit better...
This part is a system-wide automount. It gets to run even when no user is
logged in. In order to do per-user mounting, some sort of session management
is required. For example, udisks, we both mentioned, starts along with the
session, when a user logs in, hence allowing per-user mounts.
Since this approach uses udev and gets triggered on addition or removal of
block devices, described in the corresponding rules, it happens on system
level and is not dependant on a session or logged in user. When a session
based approach is used with udisks, these rules should be disabled though.
The two approaches are rather mutually exclusive, but both are valid. There
are cases when this system-level automount is desired (e.g. in industrial use
cases) since there are no users are ever expected to log in or interact with
the system.
So, this is not meant to replace or provide session-based mounting...
> ...
> > 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"
>
> Please see above...
>
> ...
>
> > --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
> > +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
> > @@ -4,7 +4,7 @@ LICENSE = "MIT"
> > LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
> > file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> >
> > -PR = "r16"
> > +PR = "r17"
>
> Don't change PR; in fact with this change I'd say to move it to 1.1 and drop PR.
I thought about it - either PV or PR needs to change. But I wasn't sure about
bumping PV...
--
Denys
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media
2014-03-29 20:59 ` Denys Dmytriyenko
@ 2014-03-29 21:05 ` Otavio Salvador
0 siblings, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2014-03-29 21:05 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: Patches and discussions about the oe-core layer
On Sat, Mar 29, 2014 at 5:59 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> On Sat, Mar 29, 2014 at 12:17:23PM -0300, Otavio Salvador wrote:
>> Hello Denys,
>>
>> On Fri, Mar 28, 2014 at 6:29 PM, Denys Dmytriyenko <denis@denix.org> 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.
>>
>> Agreed.
>>
>> > For our embedded systems environment we assume single-user operation
>> > and hence simplify mount point to just /run/media/<device>.
>>
>> Please don't. I have customers using multiple users in an embedded
>> device and so I think it is better to adopt udisks standard here
>> instead of diverging from it without a reasoning.
>
> I guess I should have phrased it a bit better...
>
> This part is a system-wide automount. It gets to run even when no user is
> logged in. In order to do per-user mounting, some sort of session management
> is required. For example, udisks, we both mentioned, starts along with the
> session, when a user logs in, hence allowing per-user mounts.
>
> Since this approach uses udev and gets triggered on addition or removal of
> block devices, described in the corresponding rules, it happens on system
> level and is not dependant on a session or logged in user. When a session
> based approach is used with udisks, these rules should be disabled though.
>
> The two approaches are rather mutually exclusive, but both are valid. There
> are cases when this system-level automount is desired (e.g. in industrial use
> cases) since there are no users are ever expected to log in or interact with
> the system.
>
> So, this is not meant to replace or provide session-based mounting...
Agreed; I missed this but I fully agree now :)
>> ...
>> > 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"
>>
>> Please see above...
>>
>> ...
>>
>> > --- a/meta/recipes-core/udev/udev-extraconf_1.0.bb
>> > +++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
>> > @@ -4,7 +4,7 @@ LICENSE = "MIT"
>> > LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
>> > file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>> >
>> > -PR = "r16"
>> > +PR = "r17"
>>
>> Don't change PR; in fact with this change I'd say to move it to 1.1 and drop PR.
>
> I thought about it - either PV or PR needs to change. But I wasn't sure about
> bumping PV...
I am all for the PV bumping...
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-29 21:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28 21:29 [PATCH] [RFC] udev-extraconf: update mount.sh to use /run/media instead of /media Denys Dmytriyenko
2014-03-29 15:17 ` Otavio Salvador
2014-03-29 20:59 ` Denys Dmytriyenko
2014-03-29 21:05 ` Otavio Salvador
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.