makedev-syntax.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // -*- mode:doc -*- ;
  2. [[makedev-syntax]]
  3. Makedev syntax documentation
  4. ----------------------------
  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 line for each file, with the following layout:
  11. |===========================================================
  12. |name |type |mode |uid |gid |major |minor |start |inc |count
  13. |===========================================================
  14. There are a few non-trivial blocks here:
  15. - +name+ is the path to the file you want to create/modify
  16. - +type+ is the type of the file, being one of:
  17. * f: a regular file
  18. * d: a directory
  19. * c: a character device file
  20. * b: a block device file
  21. * p: a named pipe
  22. - +mode+, +uid+ and +gid+ are the usual permissions settings
  23. - +major+ and +minor+ are here for device files - set to - for other
  24. files
  25. - +start+, +inc+ and +count+ are for when you want to create a batch
  26. of files, and can be reduced to a loop, beginning at +start+,
  27. incrementing its counter by +inc+ until it reaches +count+
  28. Let's say you want to change the permissions of a given file; using
  29. this syntax, you will need to put:
  30. -------------------------------------------------------------------
  31. /usr/bin/foobar f 644 0 0 - - - - -
  32. -------------------------------------------------------------------
  33. On the other hand, if you want to create the device file +/dev/hda+
  34. and the corresponding 15 files for the partitions, you will need for
  35. +/dev/hda+:
  36. -------------------------------------------------------------------
  37. /dev/hda b 640 0 0 3 0 0 0 -
  38. -------------------------------------------------------------------
  39. and then for device files corresponding to the partitions of
  40. +/dev/hda+, +/dev/hdaX+, +X+ ranging from 1 to 15:
  41. -------------------------------------------------------------------
  42. /dev/hda b 640 0 0 3 1 1 1 15
  43. -------------------------------------------------------------------