Udev to create a node device from the character device specified in / proc / devices

I have a PCI device for which I was able to configure the DKMS module. The kernel module is loaded, and I see that the device appears in / proc / devices.

The driver had a load_driver.sh script that creates a node device using mknod. I want to create a udev rule that will automatically create this node when the driver loads. How can i do this?

+4
source share
1 answer

Honestly, I have no idea, but I looked at my own system.

Checking my own udev rules, I found that VirtualBox seems to do this using this udev rule:

SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"

, , "".

0

All Articles