faq-troubleshooting.txt 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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 does not make much sense.
  31. If you need a compiler on your target anyway, then Buildroot is not
  32. suitable for your purpose. In such case, you need a _real
  33. distribution_ and you should opt for something like:
  34. * http://www.openembedded.org[openembedded]
  35. * https://www.yoctoproject.org[yocto]
  36. * http://www.emdebian.org[emdebian]
  37. * https://fedoraproject.org/wiki/Architectures[Fedora]
  38. * http://en.opensuse.org/Portal:ARM[openSUSE ARM]
  39. * http://archlinuxarm.org[Arch Linux ARM]
  40. * ...
  41. [[faq-no-dev-files-on-target]]
  42. == Why are there no development files on the target?
  43. Since there is no compiler available on the target (see
  44. xref:faq-no-compiler-on-target[]), it does not make sense to waste
  45. space with headers or static libraries.
  46. Therefore, those files are always removed from the target since the
  47. Buildroot-2012.11 release.
  48. [[faq-no-doc-on-target]]
  49. == Why is there no documentation on the target?
  50. Because Buildroot mostly targets _small_ or _very small_ target
  51. hardware with limited resource onboard (CPU, ram, mass-storage), it
  52. does not make sense to waste space with the documentation data.
  53. If you need documentation data on your target anyway, then Buildroot
  54. is not suitable for your purpose, and you should look for a _real
  55. distribution_ (see: xref:faq-no-compiler-on-target[]).
  56. [[faq-why-not-visible-package]]
  57. == Why are some packages not visible in the Buildroot config menu?
  58. If a package exists in the Buildroot tree and does not appear in the
  59. config menu, this most likely means that some of the package's
  60. dependencies are not met.
  61. To know more about the dependencies of a package, search for the
  62. package symbol in the config menu (see xref:make-tips[]).
  63. Then, you may have to recursively enable several options (which
  64. correspond to the unmet dependencies) to finally be able to select
  65. the package.
  66. If the package is not visible due to some unmet toolchain options,
  67. then you should certainly run a full rebuild (see xref:make-tips[] for
  68. more explanations).
  69. [[faq-why-not-use-target-as-chroot]]
  70. == Why not use the target directory as a chroot directory?
  71. There are plenty of reasons to *not* use the target directory a chroot
  72. one, among these:
  73. * file ownerships, modes and permissions are not correctly set in the
  74. target directory;
  75. * device nodes are not created in the target directory.
  76. For these reasons, commands run through chroot, using the target
  77. directory as the new root, will most likely fail.
  78. If you want to run the target filesystem inside a chroot, or as an NFS
  79. root, then use the tarball image generated in +images/+ and extract it
  80. as root.
  81. [[faq-no-binary-packages]]
  82. == Why doesn't Buildroot generate binary packages (.deb, .ipkg...)?
  83. One feature that is often discussed on the Buildroot list is the
  84. general topic of "package management". To summarize, the idea
  85. would be to add some tracking of which Buildroot package installs
  86. what files, with the goals of:
  87. * being able to remove files installed by a package when this package
  88. gets unselected from the menuconfig;
  89. * being able to generate binary packages (ipk or other format) that
  90. can be installed on the target without re-generating a new root
  91. filesystem image.
  92. In general, most people think it is easy to do: just track which package
  93. installed what and remove it when the package is unselected. However, it
  94. is much more complicated than that:
  95. * It is not only about the +target/+ directory, but also the sysroot in
  96. +host/usr/<tuple>/sysroot+ and the +host/+ directory itself. All files
  97. installed in those directories by various packages must be tracked.
  98. * When a package is unselected from the configuration, it is not
  99. sufficient to remove just the files it installed. One must also
  100. remove all its reverse dependencies (i.e. packages relying on it)
  101. and rebuild all those packages. For example, package A depends
  102. optionally on the OpenSSL library. Both are selected, and Buildroot
  103. is built. Package A is built with crypto support using OpenSSL.
  104. Later on, OpenSSL gets unselected from the configuration, but
  105. package A remains (since OpenSSL is an optional dependency, this
  106. is possible.) If only OpenSSL files are removed, then the files
  107. installed by package A are broken: they use a library that is no
  108. longer present on the target. Although this is technically doable,
  109. it adds a lot of complexity to Buildroot, which goes against the
  110. simplicity we try to stick to.
  111. * In addition to the previous problem, there is the case where the
  112. optional dependency is not even known to Buildroot. For example,
  113. package A in version 1.0 never used OpenSSL, but in version 2.0 it
  114. automatically uses OpenSSL if available. If the Buildroot .mk file
  115. hasn't been updated to take this into account, then package A will
  116. not be part of the reverse dependencies of OpenSSL and will not be
  117. removed and rebuilt when OpenSSL is removed. For sure, the .mk file
  118. of package A should be fixed to mention this optional dependency,
  119. but in the mean time, you can have non-reproducible behaviors.
  120. * The request is to also allow changes in the menuconfig to be
  121. applied on the output directory without having to rebuild
  122. everything from scratch. However, this is very difficult to achieve
  123. in a reliable way: what happens when the suboptions of a package
  124. are changed (we would have to detect this, and rebuild the package
  125. from scratch and potentially all its reverse dependencies), what
  126. happens if toolchain options are changed, etc. At the moment, what
  127. Buildroot does is clear and simple so its behaviour is very
  128. reliable and it is easy to support users. If configuration changes
  129. done in menuconfig are applied after the next make, then it has to
  130. work correctly and properly in all situations, and not have some
  131. bizarre corner cases. The risk is to get bug reports like "I have
  132. enabled package A, B and C, then ran make, then disabled package
  133. C and enabled package D and ran make, then re-enabled package C
  134. and enabled package E and then there is a build failure". Or worse
  135. "I did some configuration, then built, then did some changes,
  136. built, some more changes, built, some more changes, built, and now
  137. it fails, but I don't remember all the changes I did and in which
  138. order". This will be impossible to support.
  139. For all these reasons, the conclusion is that adding tracking of
  140. installed files to remove them when the package is unselected, or to
  141. generate a repository of binary packages, is something that is very
  142. hard to achieve reliably and will add a lot of complexity.
  143. On this matter, the Buildroot developers make this position statement:
  144. * Buildroot strives to make it easy to generate a root filesystem (hence
  145. the name, by the way.) That is what we want to make Buildroot good at:
  146. building root filesystems.
  147. * Buildroot is not meant to be a distribution (or rather, a distribution
  148. generator.) It is the opinion of most Buildroot developers that this
  149. is not a goal we should pursue. We believe that there are other tools
  150. better suited to generate a distro than Buildroot is. For example,
  151. http://openembedded.org/[Open Embedded], or https://openwrt.org/[openWRT],
  152. are such tools.
  153. * We prefer to push Buildroot in a direction that makes it easy (or even
  154. easier) to generate complete root filesystems. This is what makes
  155. Buildroot stands out in the crowd (among other things, of course!)
  156. * We believe that for most embedded Linux systems, binary packages are
  157. not necessary, and potentially harmful. When binary packages are
  158. used, it means that the system can be partially upgraded, which
  159. creates an enormous number of possible combinations of package
  160. versions that should be tested before doing the upgrade on the
  161. embedded device. On the other hand, by doing complete system
  162. upgrades by upgrading the entire root filesystem image at once,
  163. the image deployed to the embedded system is guaranteed to really
  164. be the one that has been tested and validated.