faq-troubleshooting.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. == Frequently Asked Questions & Troubleshooting
  4. [[faq-boot-hang-after-starting]]
  5. === The boot hangs after 'Starting network...'
  6. If the boot process seems to hang after the following messages
  7. (messages not necessarily exactly similar, depending on the list of
  8. packages selected):
  9. ------------------------
  10. Freeing init memory: 3972K
  11. Initializing random number generator... done.
  12. Starting network...
  13. Starting dropbear sshd: generating rsa key... generating dsa key... OK
  14. ------------------------
  15. then it means that your system is running, but didn't start a shell on
  16. the serial console. In order to have the system start a shell on your
  17. serial console, you have to go into the Buildroot configuration, in
  18. +System configuration+, modify +Run a getty (login prompt) after boot+
  19. and set the appropriate port and baud rate in the +getty options+
  20. submenu. This will automatically tune the +/etc/inittab+ file of the
  21. generated system so that a shell starts on the correct serial port.
  22. [[faq-no-compiler-on-target]]
  23. === Why is there no compiler on the target?
  24. It has been decided that support for the _native compiler on the
  25. target_ would be stopped from the Buildroot-2012.11 release because:
  26. * this feature was neither maintained nor tested, and often broken;
  27. * this feature was only available for Buildroot toolchains;
  28. * Buildroot mostly targets _small_ or _very small_ target hardware
  29. with limited resource onboard (CPU, ram, mass-storage), for which
  30. compiling on the target does not make much sense;
  31. * Buildroot aims at easing the cross-compilation, making native
  32. compilation on the target unnecessary.
  33. If you need a compiler on your target anyway, then Buildroot is not
  34. suitable for your purpose. In such case, you need a _real
  35. distribution_ and you should opt for something like:
  36. * http://www.openembedded.org[openembedded]
  37. * https://www.yoctoproject.org[yocto]
  38. * http://www.emdebian.org[emdebian]
  39. * https://fedoraproject.org/wiki/Architectures[Fedora]
  40. * http://en.opensuse.org/Portal:ARM[openSUSE ARM]
  41. * http://archlinuxarm.org[Arch Linux ARM]
  42. * ...
  43. [[faq-no-dev-files-on-target]]
  44. === Why are there no development files on the target?
  45. Since there is no compiler available on the target (see
  46. xref:faq-no-compiler-on-target[]), it does not make sense to waste
  47. space with headers or static libraries.
  48. Therefore, those files are always removed from the target since the
  49. Buildroot-2012.11 release.
  50. [[faq-no-doc-on-target]]
  51. === Why is there no documentation on the target?
  52. Because Buildroot mostly targets _small_ or _very small_ target
  53. hardware with limited resource onboard (CPU, ram, mass-storage), it
  54. does not make sense to waste space with the documentation data.
  55. If you need documentation data on your target anyway, then Buildroot
  56. is not suitable for your purpose, and you should look for a _real
  57. distribution_ (see: xref:faq-no-compiler-on-target[]).
  58. [[faq-why-not-visible-package]]
  59. === Why are some packages not visible in the Buildroot config menu?
  60. If a package exists in the Buildroot tree and does not appear in the
  61. config menu, this most likely means that some of the package's
  62. dependencies are not met.
  63. To know more about the dependencies of a package, search for the
  64. package symbol in the config menu (see xref:make-tips[]).
  65. Then, you may have to recursively enable several options (which
  66. correspond to the unmet dependencies) to finally be able to select
  67. the package.
  68. If the package is not visible due to some unmet toolchain options,
  69. then you should certainly run a full rebuild (see xref:make-tips[] for
  70. more explanations).
  71. [[faq-why-not-use-target-as-chroot]]
  72. === Why not use the target directory as a chroot directory?
  73. There are plenty of reasons to *not* use the target directory a chroot
  74. one, among these:
  75. * file ownerships, modes and permissions are not correctly set in the
  76. target directory;
  77. * device nodes are not created in the target directory.
  78. For these reasons, commands run through chroot, using the target
  79. directory as the new root, will most likely fail.
  80. If you want to run the target filesystem inside a chroot, or as an NFS
  81. root, then use the tarball image generated in +images/+ and extract it
  82. as root.
  83. [[faq-no-binary-packages]]
  84. === Why doesn't Buildroot generate binary packages (.deb, .ipkg...)?
  85. One feature that is often discussed on the Buildroot list is the
  86. general topic of "package management". To summarize, the idea
  87. would be to add some tracking of which Buildroot package installs
  88. what files, with the goals of:
  89. * being able to remove files installed by a package when this package
  90. gets unselected from the menuconfig;
  91. * being able to generate binary packages (ipk or other format) that
  92. can be installed on the target without re-generating a new root
  93. filesystem image.
  94. In general, most people think it is easy to do: just track which package
  95. installed what and remove it when the package is unselected. However, it
  96. is much more complicated than that:
  97. * It is not only about the +target/+ directory, but also the sysroot in
  98. +host/<tuple>/sysroot+ and the +host/+ directory itself. All files
  99. installed in those directories by various packages must be tracked.
  100. * When a package is unselected from the configuration, it is not
  101. sufficient to remove just the files it installed. One must also
  102. remove all its reverse dependencies (i.e. packages relying on it)
  103. and rebuild all those packages. For example, package A depends
  104. optionally on the OpenSSL library. Both are selected, and Buildroot
  105. is built. Package A is built with crypto support using OpenSSL.
  106. Later on, OpenSSL gets unselected from the configuration, but
  107. package A remains (since OpenSSL is an optional dependency, this
  108. is possible.) If only OpenSSL files are removed, then the files
  109. installed by package A are broken: they use a library that is no
  110. longer present on the target. Although this is technically doable,
  111. it adds a lot of complexity to Buildroot, which goes against the
  112. simplicity we try to stick to.
  113. * In addition to the previous problem, there is the case where the
  114. optional dependency is not even known to Buildroot. For example,
  115. package A in version 1.0 never used OpenSSL, but in version 2.0 it
  116. automatically uses OpenSSL if available. If the Buildroot .mk file
  117. hasn't been updated to take this into account, then package A will
  118. not be part of the reverse dependencies of OpenSSL and will not be
  119. removed and rebuilt when OpenSSL is removed. For sure, the .mk file
  120. of package A should be fixed to mention this optional dependency,
  121. but in the mean time, you can have non-reproducible behaviors.
  122. * The request is to also allow changes in the menuconfig to be
  123. applied on the output directory without having to rebuild
  124. everything from scratch. However, this is very difficult to achieve
  125. in a reliable way: what happens when the suboptions of a package
  126. are changed (we would have to detect this, and rebuild the package
  127. from scratch and potentially all its reverse dependencies), what
  128. happens if toolchain options are changed, etc. At the moment, what
  129. Buildroot does is clear and simple so its behaviour is very
  130. reliable and it is easy to support users. If configuration changes
  131. done in menuconfig are applied after the next make, then it has to
  132. work correctly and properly in all situations, and not have some
  133. bizarre corner cases. The risk is to get bug reports like "I have
  134. enabled package A, B and C, then ran make, then disabled package
  135. C and enabled package D and ran make, then re-enabled package C
  136. and enabled package E and then there is a build failure". Or worse
  137. "I did some configuration, then built, then did some changes,
  138. built, some more changes, built, some more changes, built, and now
  139. it fails, but I don't remember all the changes I did and in which
  140. order". This will be impossible to support.
  141. For all these reasons, the conclusion is that adding tracking of
  142. installed files to remove them when the package is unselected, or to
  143. generate a repository of binary packages, is something that is very
  144. hard to achieve reliably and will add a lot of complexity.
  145. On this matter, the Buildroot developers make this position statement:
  146. * Buildroot strives to make it easy to generate a root filesystem (hence
  147. the name, by the way.) That is what we want to make Buildroot good at:
  148. building root filesystems.
  149. * Buildroot is not meant to be a distribution (or rather, a distribution
  150. generator.) It is the opinion of most Buildroot developers that this
  151. is not a goal we should pursue. We believe that there are other tools
  152. better suited to generate a distro than Buildroot is. For example,
  153. http://openembedded.org/[Open Embedded], or https://openwrt.org/[openWRT],
  154. are such tools.
  155. * We prefer to push Buildroot in a direction that makes it easy (or even
  156. easier) to generate complete root filesystems. This is what makes
  157. Buildroot stands out in the crowd (among other things, of course!)
  158. * We believe that for most embedded Linux systems, binary packages are
  159. not necessary, and potentially harmful. When binary packages are
  160. used, it means that the system can be partially upgraded, which
  161. creates an enormous number of possible combinations of package
  162. versions that should be tested before doing the upgrade on the
  163. embedded device. On the other hand, by doing complete system
  164. upgrades by upgrading the entire root filesystem image at once,
  165. the image deployed to the embedded system is guaranteed to really
  166. be the one that has been tested and validated.
  167. [[faq-speeding-up-build]]
  168. === How to speed-up the build process?
  169. Since Buildroot often involves doing full rebuilds of the entire
  170. system that can be quite long, we provide below a number of tips to
  171. help reduce the build time:
  172. * Use a pre-built external toolchain instead of the default Buildroot
  173. internal toolchain. By using a pre-built Linaro toolchain (on ARM)
  174. or a Sourcery CodeBench toolchain (for ARM, x86, x86-64, MIPS,
  175. etc.), you will save the build time of the toolchain at each
  176. complete rebuild, approximately 15 to 20 minutes. Note that
  177. temporarily using an external toolchain does not prevent you to
  178. switch back to an internal toolchain (that may provide a higher
  179. level of customization) once the rest of your system is working;
  180. * Use the +ccache+ compiler cache (see: xref:ccache[]);
  181. * Learn about rebuilding only the few packages you actually care
  182. about (see xref:rebuild-pkg[]), but beware that sometimes full
  183. rebuilds are anyway necessary (see xref:full-rebuild[]);
  184. * Make sure you are not using a virtual machine for the Linux system
  185. used to run Buildroot. Most of the virtual machine technologies are
  186. known to cause a significant performance impact on I/O, which is
  187. really important for building source code;
  188. * Make sure that you're using only local files: do not attempt to do
  189. a build over NFS, which significantly slows down the build. Having
  190. the Buildroot download folder available locally also helps a bit.
  191. * Buy new hardware. SSDs and lots of RAM are key to speeding up the
  192. builds.
  193. * Experiment with top-level parallel build, see
  194. xref:top-level-parallel-build[].