README 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. When building a target filesystem, it is desirable to not have to
  2. become root and then run 'mknod' a thousand times. Using a device
  3. table you can create device nodes and directories "on the fly".
  4. You can do all sorts of interesting things with a device table file.
  5. For example, if you want to adjust the permissions on a particular
  6. file you can just add an entry like:
  7. /sbin/foobar f 2755 0 0 - - - - -
  8. and (assuming the file /sbin/foobar exists) it will be made setuid
  9. root (regardless of what its permissions are on the host filesystem.
  10. Furthermore, you can use a single table entry to create a many device
  11. minors. For example, if I wanted to create /dev/hda and
  12. /dev/hda[0-15] I could just use the following two table entries:
  13. /dev/hda b 640 0 0 3 0 0 0 -
  14. /dev/hda b 640 0 0 3 1 1 1 15
  15. Device table entries take the form of:
  16. <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
  17. where name is the file name, type can be one of:
  18. f: A regular file
  19. d: Directory
  20. c: Character special device file
  21. b: Block special device file
  22. p: Fifo (named pipe)
  23. uid is the user id for the target file, gid is the group id for the
  24. target file. The rest of the entries (major, minor, etc) apply only
  25. to device special files.