adding-board-support.adoc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[adding-board-support]]
  4. == Adding support for a particular board
  5. Buildroot contains basic configurations for several publicly available
  6. hardware boards, so that users of such a board can easily build a system
  7. that is known to work. You are welcome to add support for other boards
  8. to Buildroot too.
  9. To do so, you need to create a normal Buildroot configuration that
  10. builds a basic system for the hardware: (internal) toolchain, kernel,
  11. bootloader, filesystem and a simple BusyBox-only userspace. No specific
  12. package should be selected: the configuration should be as minimal as
  13. possible, and should only build a working basic BusyBox system for the
  14. target platform. You can of course use more complicated configurations
  15. for your internal projects, but the Buildroot project will only
  16. integrate basic board configurations. This is because package
  17. selections are highly application-specific.
  18. Once you have a known working configuration, run +make
  19. savedefconfig+. This will generate a minimal +defconfig+ file at the
  20. root of the Buildroot source tree. Move this file into the +configs/+
  21. directory, and rename it +<boardname>_defconfig+. If the configuration
  22. is a bit more complicated, it is nice to manually reformat it and
  23. separate it into sections, with a comment before each section. Typical
  24. sections are _Architecture_, _Toolchain options_ (typically just linux
  25. headers version), _Firmware_, _Bootloader_, _Kernel_, and _Filesystem_.
  26. Always use fixed versions or commit hashes for the different
  27. components, not the "latest" version. For example, set
  28. +BR2_LINUX_KERNEL_CUSTOM_VERSION=y+ and
  29. +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE+ to the kernel version you tested
  30. with. If you are using the buildroot toolchain +BR2_TOOLCHAIN_BUILDROOT+
  31. (which is the default), additionally ensure that the same kernel headers
  32. are used (+BR2_KERNEL_HEADERS_AS_KERNEL+, which is also the default) and
  33. set the custom kernel headers series to match your kernel version
  34. (+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_*+).
  35. It is recommended to use as much as possible upstream versions of the
  36. Linux kernel and bootloaders, and to use as much as possible default
  37. kernel and bootloader configurations. If they are incorrect for your
  38. board, or no default exists, we encourage you to send fixes to the
  39. corresponding upstream projects.
  40. However, in the mean time, you may want to store kernel or bootloader
  41. configuration or patches specific to your target platform. To do so,
  42. create a directory +board/<manufacturer>+ and a subdirectory
  43. +board/<manufacturer>/<boardname>+. You can then store your patches
  44. and configurations in these directories, and reference them from the main
  45. Buildroot configuration. Refer to xref:customize[] for more details.
  46. Before submitting patches for new boards it is recommended to test it by
  47. building it using latest gitlab-CI docker container. To do this use
  48. +utils/docker-run+ script and inside it issue these commands:
  49. ----
  50. $ make <boardname>_defconfig
  51. $ make
  52. ----
  53. By default, Buildroot developers use the official image hosted on the
  54. https://gitlab.com/buildroot.org/buildroot/container_registry/2395076[gitlab.com
  55. registry] and it should be convenient for most usage. If you still want
  56. to build your own docker image, you can base it off the official image
  57. as the +FROM+ directive of your own _Dockerfile_:
  58. ----
  59. FROM registry.gitlab.com/buildroot.org/buildroot/base:YYYYMMDD.HHMM
  60. RUN ...
  61. COPY ...
  62. ----
  63. The current version _YYYYMMDD.HHMM_ can be found in the +.gitlab-ci.yml+
  64. file at the top of the Buildroot source tree; all past versions are
  65. listed in the aforementioned registry as well.