I'm writing a kernel module and I'd like the module to create a device in /dev/ by itself when loaded (and remove it when unloaded).
Most tutorials I've seen recommend making a script to load the module and use mknod.
I believe it's not possible to use the mknod() system call for obvious reasons, but I also believe there's a way of doing it. Is it a good practice? How to do it?