[yocto] USBmount and systemd-udev namespace conflict

Li, Xin lixin.fnst at cn.fujitsu.com
Mon Dec 15 17:22:36 PST 2014


Hi,

This is my way to use udev to automount a usb driver, perhaps it can help you.


1.       Add udev rules.

root # cat /etc/udev/rules.d/10-udevtest.rules

KERNEL=="sda",ACTION=="add",OWNER:="udev",GROUP:="udevs"

2.       Add user and group.

root # useradd udev

root # groupadd udevs

3.       start the udev  service

 root # systemctl start systemd-udevd.service

root # ps aux | grep udev

root     21927  0.3  0.0  26140  1388 ?        Ss   22:51   0:00 /lib/systemd/systemd-udevd

4.       insert usb driver

5.       check

root # ls /dev/sda -al

brw-rw---- 1 udev udevs 8, 0 Sep 15 03:13 /dev/sda
-----------------------------
Best regards,
Li

From: yocto-bounces at yoctoproject.org [mailto:yocto-bounces at yoctoproject.org] On Behalf Of Francois P. Gallichand
Sent: Tuesday, December 16, 2014 3:34 AM
To: yocto at yoctoproject.org
Subject: [yocto] USBmount and systemd-udev namespace conflict

Hello,

I need to automount a usb drive when it is plugged in. I found that the necessary udev rules are in the udev-extraconf package so I added that to my build. I tried it but it does not really work since when I insert the key, it is in fact mounted by udev but since the mount namespace of udev is private and not the same one as the shell I want to check if the key is mounted, I don’t see it. Is there a way to tell udev to mount using a global namespace so it can be seen be everybody?

Thanks.

François Gallichand
Engineer - Software Group
ABB Group
Analytical Business
(418)877-2944 x268

[ABB logo]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141216/f2ff0821/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3279 bytes
Desc: image001.png
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141216/f2ff0821/attachment.png>


More information about the yocto mailing list