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".
5 You can do all sorts of interesting things with a device table file.
6 For example, if you want to adjust the permissions on a particular
7 file you can just add an entry like:
9 /sbin/foobar f 2755 0 0 - - - - -
11 and (assuming the file /sbin/foobar exists) it will be made setuid
12 root (regardless of what its permissions are on the host filesystem.
14 Furthermore, you can use a single table entry to create a many device
15 minors. For example, if I wanted to create /dev/hda and
16 /dev/hda[0-15] I could just use the following two table entries:
18 /dev/hda b 640 0 0 3 0 0 0 -
19 /dev/hda b 640 0 0 3 1 1 1 15
21 Device table entries take the form of:
23 <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
25 where name is the file name, type can be one of:
29 c: Character special device file
30 b: Block special device file
33 uid is the user id for the target file, gid is the group id for the
34 target file. The rest of the entries (major, minor, etc) apply only
35 to device special files.