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-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On 
Behalf Of Francois P. Gallichand
Sent: Tuesday, December 16, 2014 3:34 AM
To: yocto@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]

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to