70844bf802c66c4c396c7152417b9d7c97bc2f78
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / makedevs / README
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
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:
8
9   /sbin/foobar f 2755 0 0 - - - - -
10
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.
13
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:
17
18   /dev/hda b 640 0 0 3 0 0 0 -
19   /dev/hda b 640 0 0 3 1 1 1 15
20
21 Device table entries take the form of:
22
23 <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
24
25 where name is the file name,  type can be one of:
26
27       f: A regular file
28       d: Directory
29       c: Character special device file
30       b: Block special device file
31       p: Fifo (named pipe)
32
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.