makedev-syntax.txt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[makedev-syntax]]
  4. Makedev syntax documentation
  5. ----------------------------
  6. The makedev syntax is used in several places in Buildroot to
  7. define changes to be made for permissions, or which device files to
  8. create and how to create them, in order to avoid calls to mknod.
  9. This syntax is derived from the makedev utility, and more complete
  10. documentation can be found in the +package/makedevs/README+ file.
  11. It takes the form of a line for each file, with the following layout:
  12. |===========================================================
  13. |name |type |mode |uid |gid |major |minor |start |inc |count
  14. |===========================================================
  15. There are a few non-trivial blocks here:
  16. - +name+ is the path to the file you want to create/modify
  17. - +type+ is the type of the file, being one of:
  18. * f: a regular file
  19. * d: a directory
  20. * c: a character device file
  21. * b: a block device file
  22. * p: a named pipe
  23. - +mode+, +uid+ and +gid+ are the usual permissions settings
  24. - +major+ and +minor+ are here for device files - set to - for other
  25. files
  26. - +start+, +inc+ and +count+ are for when you want to create a batch
  27. of files, and can be reduced to a loop, beginning at +start+,
  28. incrementing its counter by +inc+ until it reaches +count+
  29. Let's say you want to change the permissions of a given file; using
  30. this syntax, you will need to put:
  31. -------------------------------------------------------------------
  32. /usr/bin/foobar f 644 0 0 - - - - -
  33. -------------------------------------------------------------------
  34. On the other hand, if you want to create the device file +/dev/hda+
  35. and the corresponding 15 files for the partitions, you will need for
  36. +/dev/hda+:
  37. -------------------------------------------------------------------
  38. /dev/hda b 640 0 0 3 0 0 0 -
  39. -------------------------------------------------------------------
  40. and then for device files corresponding to the partitions of
  41. +/dev/hda+, +/dev/hdaX+, +X+ ranging from 1 to 15:
  42. -------------------------------------------------------------------
  43. /dev/hda b 640 0 0 3 1 1 1 15
  44. -------------------------------------------------------------------