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