All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions about udev rule and systemd-udev,relevant to mounting block device
@ 2018-03-01 10:35 Hongzhi, Song
  2018-03-02  5:44   ` Hongzhi, Song
  0 siblings, 1 reply; 5+ messages in thread
From: Hongzhi, Song @ 2018-03-01 10:35 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

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".


[-- Attachment #2: Type: text/html, Size: 2159 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] Questions about udev rule and systemd-udev,relevant to mounting block device
  2018-03-01 10:35 Questions about udev rule and systemd-udev,relevant to mounting block device Hongzhi, Song
@ 2018-03-02  5:44   ` Hongzhi, Song
  0 siblings, 0 replies; 5+ messages in thread
From: Hongzhi, Song @ 2018-03-02  5:44 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

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".
>
>
>


[-- Attachment #2: Type: text/html, Size: 2799 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Questions about udev rule and systemd-udev,relevant to mounting block device
@ 2018-03-02  5:44   ` Hongzhi, Song
  0 siblings, 0 replies; 5+ messages in thread
From: Hongzhi, Song @ 2018-03-02  5:44 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

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".
>
>
>


[-- Attachment #2: Type: text/html, Size: 2799 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] Questions about udev rule and systemd-udev,relevant to mounting block device
  2018-03-02  5:44   ` Hongzhi, Song
@ 2018-03-02 13:50     ` Vincent Prince
  -1 siblings, 0 replies; 5+ messages in thread
From: Vincent Prince @ 2018-03-02 13:50 UTC (permalink / raw)
  To: Hongzhi, Song
  Cc: Yocto-mailing-list, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

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@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@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

[-- Attachment #2: Type: text/html, Size: 4913 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Questions about udev rule and systemd-udev,relevant to mounting block device
@ 2018-03-02 13:50     ` Vincent Prince
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent Prince @ 2018-03-02 13:50 UTC (permalink / raw)
  To: Hongzhi, Song
  Cc: Yocto-mailing-list, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

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@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@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

[-- Attachment #2: Type: text/html, Size: 4913 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-02 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 10:35 Questions about udev rule and systemd-udev,relevant to mounting block device Hongzhi, Song
2018-03-02  5:44 ` [OE-core] " Hongzhi, Song
2018-03-02  5:44   ` Hongzhi, Song
2018-03-02 13:50   ` [OE-core] " Vincent Prince
2018-03-02 13:50     ` Vincent Prince

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.