[OE-core] Questions about udev rule and systemd-udev,relevant to mounting block device

Vincent Prince vincent.prince.fr at gmail.com
Fri Mar 2 13:50:41 UTC 2018


Hi,

I'm not sure what is your use case, but you can check usbmount[1][2]
or automount-usb[3] for example on how to use udev with systemd:

Regards,
Vincent

[1]https://github.com/rbrito/usbmount
[2]
https://github.com/nefethael/meta-random/blob/master/recipes-support/usbmount/usbmount_git.bb
[3]https://github.com/six-k/automount-usb


2018-03-02 6:44 GMT+01:00 Hongzhi, Song <hongzhi.song at windriver.com>:

> Hi all,
>
> Does anyone have suggestion for me?
>
> Thanks.
>
> Hongzhi.Song
>
> On 2018年03月01日 18:35, Hongzhi, Song wrote:
>
> Defect:
>
>     The exiting method of automount of udev in *oe-core/meta/ *is using
>
> *automount.rules* which call *mount.sh* that using */bin/mount* to mount
> device.
>
> But systemd-udevd detaches *mount()* operations done within the service
>
> from the rest of the system with MountFlag=slave, this means host can
>
> not access device. (e.g. Executing *mkfs.ext4 /dev/sda1/* prompts
>
> */dev/sda1 is apparently in use by the system; will not make a filesystem
> here!*)
>
>
> Solution:
>
>     Systemd upstream suggest that the best way is to use "systemd-mount"
>
> in udev rules, which will request the mount operation to be executed by
> PID 1.
>
> And I have tested it was effective.
>
>
> Uncertain:
>
>     The exiting method is designed for *SysV-init *which is not
> compatible to
>
> systemd-udev, at least that's what I think. So I think that we should
> design
>
> a new rule or organizational structure to be suitable for systemd-udev and
>
> to mount deferent device. Dose anyone help do this? Or I can make some
>
> improvements on the basis of the existing with "systemd-mount".
>
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180302/2114d027/attachment-0002.html>


More information about the Openembedded-core mailing list