How to create the nodes automatically

Mikkel L. Ellertson mikkel at infinity-ltd.com
Thu Feb 2 16:30:48 UTC 2006


Srinivas G. wrote:
> Dear All,
> 
> I have developed a simple character driver for accessing the custom PCI
> board in Fedora Core 3. It is working fine. I am creating the device
> nodes manually using the mknod command after inserting my module into
> the kernel space. But when I restart the system the nodes are not there.
> But the module is present. I have added the MODULE_DEVICE_TABLE in my
> module for loading it at boot time. I have read about the
> MODULE_DEVICE_TABLE in LDD3. It will add the module name to the
> modules.pcimap and modules.dep file. 
> 
> My question is: 
> Is there any way to create the nodes automatically after restarting the
> system if the module exists?
> 
> I have heard about devfs. But I did not know about it.
> Could any one please respond to my question?
> 
> Thanks in advance. 
> 
> Regards,
> Srinivas G
> 
You will need to write a udev rule that create the /dev entries
when it sees the hardware. You could create a static rule that
creates them every time the system boots, but a better way would
be to have them created when the module is loaded.

See http://fedora.redhat.com/docs/udev/ for more information about
udev and links about writing rules.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the fedora-list mailing list