Skip to contentSkip to conversation

mtd and udev

DISCUSSION Sven Fischer 2 participants 3 messages Nov 28, 2008 – Dec 1, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to use udev to dynamically generate mtd devices like mtdblock0 or mtd0 etc. I'm using Linux Kernel 2.6.24 on an ARM board.

I have setup two rules but to no avail:

ACTION="add", KERNEL="mtdblock[0-9]", SUBSYSTEMS="block", NAME="mtdblock/%n", SYMLINK+="%k"
ACTION="add", KERNEL="mtd[0-9]", SUBSYSTEMS="mtd", NAME="%k"

I tried to check them with udevtest, but it doesn't work. strace shows that it runs through the /sys subtree but it doesn't match anything against the above rules.

I have the impression mtd isn't meant to work together with udev at all. Am I right ? Or what can be the reason for this issue.

Help appreciated.

Best regards
Sven

#1 lore raw
Quoted 9 lines · Sven Fischer

I'm trying to use udev to dynamically generate mtd devices like mtdblock0 or mtd0 etc. I'm using Linux Kernel 2.6.24 on an ARM board.

I have setup two rules but to no avail:

ACTION="add", KERNEL="mtdblock[0-9]", SUBSYSTEMS="block", NAME="mtdblock/%n", SYMLINK+="%k"
ACTION="add", KERNEL="mtd[0-9]", SUBSYSTEMS="mtd", NAME="%k"

Quoted 6 lines

I tried to check them with udevtest, but it doesn't work. strace shows that it runs through the /sys subtree but it doesn't match anything against the above rules.

I have the impression mtd isn't meant to work together with udev at all. Am I right ? Or what can be the reason for this issue.

It should work fine with udev. But use SUBSYSTEM, not SUBSYSTEMS, you match on the event not a parent device.

And there is probably no reason to swap around node and symlink names, just create the symlinks, if you want them, but don't needlessly change the device node name.

Kay

#2 lore raw
In reply to Sven Fischer

Thanks a lot, such a stupid typo...;-) works like a charm now !

Sven

Quoted 25 lines · Kay Sievers
Quoted 9 lines · Sven Fischer

I'm trying to use udev to dynamically generate mtd devices like mtdblock0 or mtd0 etc. I'm using Linux Kernel 2.6.24 on an ARM board.

I have setup two rules but to no avail:

ACTION="add", KERNEL="mtdblock[0-9]", SUBSYSTEMS="block", NAME="mtdblock/%n", SYMLINK+="%k"
ACTION="add", KERNEL="mtd[0-9]", SUBSYSTEMS="mtd", NAME="%k"

Quoted 6 lines

I tried to check them with udevtest, but it doesn't work. strace shows that it runs through the /sys subtree but it doesn't match anything against the above rules.

I have the impression mtd isn't meant to work together with udev at all. Am I right ? Or what can be the reason for this issue.

It should work fine with udev. But use SUBSYSTEM, not SUBSYSTEMS, you match on the event not a parent device.

And there is probably no reason to swap around node and symlink names, just create the symlinks, if you want them, but don't needlessly change the device node name.

Kay