Skip to content
Advertisement

Creating a new directory in /dev using udev rule

This is the code snippet responsible for creating the device:

master_dev = device_create(dev_cl, NULL, MKDEV(major, minor), NULL, "synchmess");

My udev rule is the following:

KERNEL=="synchmess", NAME="/synch/synchmess", MODE="0444"

From my understanding, this rule should match against the device name given by the kernel module (synchmess) and create the /dev subdirectory “synch”. However, the synchmess device shows under /dev with the correct permissions, but i can’t seem to figure out how to create the directory.

Advertisement

Answer

Try "synch!synchmess" as the last arg to dev_create(); reference:
lists.kernelnewbies.org

Also see this item on Stack Overflow
udev rules, mkdir

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement