Letting mdev + devtmpfs play together?

Floris Bos bos at je-eigen-domein.nl
Sun Apr 19 21:12:15 UTC 2015


Hi,

On 04/19/2015 06:57 PM, Denys Vlasenko wrote:
> On Sat, Apr 18, 2015 at 5:05 PM, Floris Bos <bos at je-eigen-domein.nl> wrote:
>> Hi,
>>
>> I was wondering if it is possible to configure mdev NOT to add and remove
>> device nodes, and let devtmpfs handle that part instead?
> examples/mdev.conf says:
>
> # Syntax:
> # [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
> # [-]$ENVVAR=regex    user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
> # [-]@maj,min[-min2]  user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
> #
> # [-]: do not stop on this match, continue reading mdev.conf
> # =: move, >: move and create a symlink
> # !: do not create device node
>     ^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks, missed that.

Now have as first rule:

-.*    root:root 600 !

and that seems to work fine to let devtmpfs do the creation and removal, 
while still being able to use mdev for responding to certain devices.

BTW did notice ! only works when FEATURE_MDEV_RENAME is enabled, which 
is a bit counter-intuitive.


>> Race condition while writing the first sequence number?
>>
>> Meanwhile 527 and later process normally.
>> However eventually 526 times out, writes 527 to .seq and the mess is
>> complete
> Yes, this is all wrong. 526 should have just go ahead and do its thing,
> but not write a new seqfile.
>
> This is not really surprising, the sequence handling code was
> even more buggy before.
>
> When I tried to use it, I had to fix several bugs.
>
> I have committed two fixes just now, can you try current git?

Thanks.
Can confirm that at least the lower number no longer overwrites the seq:

==
mdev[524]: first seq written
mdev[524]: 00:00:02.166766 ACTION:add SUBSYSTEM:block DEVNAME:mmcblk0p2 
DEVPATH:/devices/platform/soc/3f300000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p2
mdev[524]: dev 179,2
mdev[524]: rule matched, line 2
mdev[522]: 00:00:02.169764 ACTION:add SUBSYSTEM:block DEVNAME:mmcblk0 
DEVPATH:/devices/platform/soc/3f300000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0
mdev[522]: dev 179,0
mdev[522]: rule matched, line 2
mdev[524]: rule matched, line -1
mdev[525]: 00:00:02.170720 mdev.seq='524', need '525'
mdev[524]: 00:00:02.170911 exiting
mdev[523]: 00:00:02.172455 ACTION:add SUBSYSTEM:block DEVNAME:mmcblk0p1 
DEVPATH:/devices/platform/soc/3f300000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p1
mdev[523]: dev 179,1
mdev[523]: rule matched, line 2
mdev[522]: rule matched, line -1
mdev[522]: 00:00:02.173844 exiting
mdev[525]: 00:00:02.174127 ACTION:add SUBSYSTEM:block DEVNAME:mmcblk0p5 
DEVPATH:/devices/platform/soc/3f300000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p5
==



Yours sincerely,

Floris Bos


More information about the busybox mailing list