customize-packages.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[customize-packages]]
  4. === Adding project-specific packages
  5. In general, any new package should be added directly in the +package+
  6. directory and submitted to the Buildroot upstream project. How to add
  7. packages to Buildroot in general is explained in full detail in
  8. xref:adding-packages[] and will not be repeated here. However, your
  9. project may need some proprietary packages that cannot be upstreamed.
  10. This section will explain how you can keep such project-specific
  11. packages in a project-specific directory.
  12. As shown in xref:customize-dir-structure[], the recommended location for
  13. project-specific packages is +package/<company>/+. If you are using the
  14. br2-external tree feature (see xref:outside-br-custom[]) the recommended
  15. location is to put them in a sub-directory named +package/+ in your
  16. br2-external tree.
  17. However, Buildroot will not be aware of the packages in this location,
  18. unless we perform some additional steps. As explained in
  19. xref:adding-packages[], a package in Buildroot basically consists of two
  20. files: a +.mk+ file (describing how to build the package) and a
  21. +Config.in+ file (describing the configuration options for this
  22. package).
  23. Buildroot will automatically include the +.mk+ files in first-level
  24. subdirectories of the +package+ directory (using the pattern
  25. +package/\*/*.mk+). If we want Buildroot to include +.mk+ files from
  26. deeper subdirectories (like +package/<company>/package1/+) then we
  27. simply have to add a +.mk+ file in a first-level subdirectory that
  28. includes these additional +.mk+ files. Therefore, create a file
  29. +package/<company>/<company>.mk+ with following contents (assuming you
  30. have only one extra directory level below +package/<company>/+):
  31. -----
  32. include $(sort $(wildcard package/<company>/*/*.mk))
  33. -----
  34. For the +Config.in+ files, create a file +package/<company>/Config.in+
  35. that includes the +Config.in+ files of all your packages. An exhaustive
  36. list has to be provided since wildcards are not supported in the source command of kconfig.
  37. For example:
  38. -----
  39. source "package/<company>/package1/Config.in"
  40. source "package/<company>/package2/Config.in"
  41. -----
  42. Include this new file +package/<company>/Config.in+ from
  43. +package/Config.in+, preferably in a company-specific menu to make
  44. merges with future Buildroot versions easier.
  45. If using a br2-external tree, refer to xref:outside-br-custom[] for how
  46. to fill in those files.