makedev-syntax.txt 1.9 KB

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