using.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. // -*- mode:doc; -*-
  2. Using Buildroot
  3. ---------------
  4. Buildroot has a nice configuration tool similar to the one you can
  5. find in the http://www.kernel.org/[Linux kernel] or in
  6. http://www.busybox.net/[Busybox]. Note that you can *and should build
  7. everything as a normal user*. There is no need to be root to configure
  8. and use Buildroot. The first step is to run the configuration
  9. assistant:
  10. --------------------
  11. $ make menuconfig
  12. --------------------
  13. to run the curses-based configurator, or
  14. --------------------
  15. $ make xconfig
  16. --------------------
  17. or
  18. --------------------
  19. $ make gconfig
  20. --------------------
  21. to run the Qt or GTK-based configurators.
  22. All of these "make" commands will need to build a configuration
  23. utility (including the interface), so you may need to install
  24. "development" packages for relevant libraries used by the
  25. configuration utilities. Check the xref:requirement[] to know what
  26. Buildroot needs, and specifically the xref:requirement-optional[system requirements]
  27. to get the dependencies of favorite interface.
  28. For each menu entry in the configuration tool, you can find associated
  29. help that describes the purpose of the entry.
  30. Once everything is configured, the configuration tool generates a
  31. +.config+ file that contains the description of your
  32. configuration. It will be used by the Makefiles to do what's needed.
  33. Let's go:
  34. --------------------
  35. $ make
  36. --------------------
  37. You *should never* use +make -jN+ with Buildroot: it does not support
  38. 'top-level parallel make'. Instead, use the +BR2_JLEVEL+ option to
  39. tell Buildroot to run each package compilation with +make -jN+.
  40. This command will generally perform the following steps:
  41. * Download source files (as required)
  42. * Configure, build and install the cross-compiling toolchain using the
  43. appropriate toolchain backend is used, or simply import a toolchain
  44. if an external toolchain
  45. * Build/install selected target packages
  46. * Build a kernel image, if selected
  47. * Build a bootloader image, if selected
  48. * Create a root filesystem in selected formats
  49. Buildroot output is stored in a single directory, +output/+.
  50. This directory contains several subdirectories:
  51. * +images/+ where all the images (kernel image, bootloader and root
  52. filesystem images) are stored.
  53. * +build/+ where all the components except for the cross-compilation
  54. toolchain are built (this includes tools needed to run Buildroot on
  55. the host and packages compiled for the target). The +build/+
  56. directory contains one subdirectory for each of these components.
  57. * +staging/+ which contains a hierarchy similar to a root filesystem
  58. hierarchy. This directory contains the installation of the
  59. cross-compilation toolchain and all the userspace packages selected
  60. for the target. However, this directory is 'not' intended to be
  61. the root filesystem for the target: it contains a lot of development
  62. files, unstripped binaries and libraries that make it far too big
  63. for an embedded system. These development files are used to compile
  64. libraries and applications for the target that depend on other
  65. libraries.
  66. * +target/+ which contains 'almost' the complete root filesystem for
  67. the target: everything needed is present except the device files in
  68. +/dev/+ (Buildroot can't create them because Buildroot doesn't run
  69. as root and doesn't want to run as root). Therefore, this directory
  70. *should not be used on your target*. Instead, you should use one of
  71. the images built in the +images/+ directory. If you need an
  72. extracted image of the root filesystem for booting over NFS, then
  73. use the tarball image generated in +images/+ and extract it as
  74. root. Compared to +staging/+, +target/+ contains only the files and
  75. libraries needed to run the selected target applications: the
  76. development files (headers, etc.) are not present, unless the
  77. +development files in target filesystem+ option is selected.
  78. * +host/+ contains the installation of tools compiled for the host
  79. that are needed for the proper execution of Buildroot, including the
  80. cross-compilation toolchain.
  81. * +toolchain/+ contains the build directories for the various
  82. components of the cross-compilation toolchain.
  83. These commands, +make menuconfig|gconfig|xconfig+ and +make+, are the
  84. basic ones that allow to easily and quickly generate images fitting
  85. your needs, with all the supports and applications you enabled.
  86. More details about the "make" command usage are given in
  87. xref:make-tips[].
  88. Complying with opensource licenses
  89. ----------------------------------
  90. [[legal-info]]
  91. All of the end products of Buildroot (toolchain, root filesystem, kernel,
  92. bootloaders) contain opensource software, released under various licenses.
  93. Using opensource software gives you the freedom to build rich embedded
  94. systems choosing from a wide range of packages, but also gives some
  95. obligations that you must know and honour.
  96. Some licenses require you to publish the license text in the documentation of
  97. your product. Other require you to redistribute the source code of the
  98. software to those that receive your product.
  99. The exact requirements of each license is documented in each package, and it is
  100. your (or your legal office's) responsibility to comply with these requirements.
  101. To make this easier for you, Buildroot can collect for you some material you
  102. will probably need. To produce this material, after you configured Buildroot
  103. with +make menuconfig+, +make xconfig+ or +make gconfig+, run:
  104. --------------------
  105. make legal-info
  106. --------------------
  107. Buildroot will collect legally-relevant material in your output directory,
  108. under the +legal-info/+ subdirectory.
  109. There you will find:
  110. * A +README+ file, that summarizes the produced material and contains warnings
  111. about material that Buildroot could not produce.
  112. * +buildroot.config+: this is the Buildroot configuration file that is usually
  113. produced with +make menuconfig+, and which is necessary to reproduce the
  114. build.
  115. * The source code for all packages; this is saved in the +sources/+
  116. subdirectory (except for proprietary packages, whose source code is not
  117. saved);
  118. patches applied to some packages by Buildroot are distributed with the
  119. Buildroot sources and are not duplicated in the +sources/+ subdirectory.
  120. * A manifest file listing the configured packages, their version, license and
  121. related information.
  122. Some of these information might be not defined in Buildroot; in this case
  123. they are clearly marked as "unknown" or similar.
  124. * A +licenses/+ subdirectory, which contains the license text of packages.
  125. If the license file(s) are not defined in Buildroot, the file is not produced
  126. and a warning in the +README+ indicates this.
  127. Please note that the aim of the +legal-info+ feature of Buildroot is to
  128. produce all the material that is somehow relevant for legal compliance with the
  129. package licenses. Buildroot does not try to produce the exact material that
  130. you must somehow make public. It does surely produce some more material than is
  131. needed for a strict legal compliance. For example, it produces the source code
  132. for packages released under BSD-like licenses, that you might not want to
  133. redistribute in source form.
  134. Moreover, due to technical limitations, Buildroot does not produce some
  135. material that you will or may need, such as the toolchain source code and the
  136. Buildroot source code itself.
  137. When you run +make legal-info+, Buildroot produces warnings in the +README+
  138. file to inform you of relevant material that could not be saved.
  139. Here is a list of the licenses that are most widely used by packages in
  140. Buildroot, with the name used in the manifest file:
  141. * +GPLv2+:
  142. http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[
  143. GNU General Public License, version 2];
  144. * +GPLv2++:
  145. http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[
  146. GNU General Public License, version 2]
  147. or (at your option) any later version;
  148. * +GPLv3+:
  149. http://www.gnu.org/licenses/gpl.html[
  150. GNU General Public License, version 3];
  151. * +GPLv3++:
  152. http://www.gnu.org/licenses/gpl.html[
  153. GNU General Public License, version 3]
  154. or (at your option) any later version;
  155. * +GPL+:
  156. http://www.gnu.org/licenses/gpl.html[
  157. GNU General Public License] (any version);
  158. * +LGPLv2.1+:
  159. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html[
  160. GNU Lesser General Public License, version 2.1];
  161. * +LGPLv2.1++:
  162. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html[
  163. GNU Lesser General Public License, version 2.1]
  164. or (at your option) any later version;
  165. * +LGPLv3+:
  166. http://www.gnu.org/licenses/lgpl.html[
  167. GNU Lesser General Public License, version 3];
  168. * +LGPLv3++:
  169. http://www.gnu.org/licenses/lgpl.html[
  170. GNU Lesser General Public License, version 3]
  171. or (at your option) any later version;
  172. * +LGPL+:
  173. http://www.gnu.org/licenses/lgpl.html[
  174. GNU Lesser General Public License] (any version);
  175. * +BSD-4c+: Original BSD 4-clause license;
  176. * +BSD-3c+: BSD 3-clause license;
  177. * +BSD-2c+: BSD 2-clause license;
  178. * +PROPRIETARY+: marks a non-opensource package;
  179. Buildroot does not save any licensing info or source code for these packages.
  180. Complying with the Buildroot license
  181. ------------------------------------
  182. Buildroot itself is an opensource software, released under the
  183. http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[GNU General Public
  184. License, version 2] or (at your option) any later version.
  185. However, being a build system, it is not normally part of the end product:
  186. if you develop the root filesystem, kernel, bootloader or toolchain for a
  187. device, the code of Buildroot is only present on the development machine, not
  188. in the device storage.
  189. Nevertheless, the general view of the Buildroot developers is that you should
  190. release the Buildroot source code along with the source code of other packages
  191. when releasing a product that contains GPL-licensed software.
  192. This is because the
  193. http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[GNU GPL]
  194. defines the "'complete source code'" for an executable work as "'all the
  195. source code for all modules it contains, plus any associated interface
  196. definition files, plus the scripts used to control compilation and installation
  197. of the executable'".
  198. Buildroot is part of the 'scripts used to control compilation and
  199. installation of the executable', and as such it is considered part of the
  200. material that must be redistributed.
  201. Keep in mind this is only the Buildroot developers' opinion, and you should
  202. consult your legal department or lawyer in case of any doubt.