A better way of managing device nodes

Creating device nodes statically with mknod is quite hard work and inflexible. There are other ways to create device nodes automatically on demand:

  • devtmpfs: This is a pseudo filesystem that you mount over /dev at boot time. The kernel populates it with device nodes for all the devices that the kernel currently knows about and creates nodes for new devices as they are detected at runtime. The nodes are owned by root and have default permissions of 0600. Some well-known device nodes, such as /dev/null and /dev/random, override the default to 0666 (see struct memdev in drivers/char/mem.c).
  • mdev: This is a BusyBox applet that is used to populate a directory with device nodes and to create new nodes as needed. There ...

Get Embedded Linux for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.