This is an old revision of the document!


How to customize Buildroot

Buildroot allows to keep customizations outside Buildroot main project.

We are using this mechanism to extend & customize Buildroot configuration for liteSOM based projects and it is recommenced to start with one of our example to build infrastructure for your project.

Please take into account that below you can find one of the possible way how to customize Buildroot; for more details please read Buildroot User Manual and Customizing the generated target filesystem.

This project will allow you to build complete firmware image for liteboard and lcd with resistive touchscreen.

Main intention is to keep all customizations outside Buildroot project but still allow user to configure kernel, BusyBox and Buildroot or to modify Device Tree without any problems.

Download Buildroot release you want to use, for example

wget https://buildroot.org/downloads/buildroot-2016.11.1.tar.gz

Extract downloaded file

tar xf buildroot-2016.11.1.tar.gz

During this how to we will extend Buildroot setup by customizations from Grinn examples repository, please clone this repository

git clone https://github.com/grinn-pub/examples.git

Tell Buildroot to use additional br2-external directory by setting (once per project setup) BR2_EXTERNAL variable as presented below

cd buildroot-2016-11.1
make BR2_EXTERNAL=/tmp/examples list-defconfigs

where /tmp/examples should point to cloned Grinn examples repository.

Target list-defconfigs shows list of available defconfigs. After built-in configs you should see configs provided by the external customizations (like Grinn examples).

make BR2_EXTERNAL=/tmp/examples list-defconfigs
Built-in configs:
  acmesystems_aria_g25_128mb_defconfig - Build for acmesystems_aria_g25_128mb
  acmesystems_aria_g25_256mb_defconfig - Build for acmesystems_aria_g25_256mb
  [...]

External configs in "Grinn examples":
  grinn_liteboard_lcd_res_defconfig   - Build for grinn_liteboard_lcd_res

To configure Buildroot for liteSOM + lcd please use grinn_liteboard_lcd_res_defconfig configuration.

make grinn_liteboard_lcd_res_defconfig

Project compilation

You can compile project in this same way as usual

make all

Project output

Like for other Buildroot based projects directory output/images/ contains all files required to program liteboard.

You can program SD card via following command

dd if=output/images/sdcard.img of=/dev/<SD-CARD> bs=4M

More details about this customization

.
├── configs
│   └── grinn_liteboard_lcd_res_defconfig

Complete configuration for Buildroot is available in configs/grinn_liteboard_lcd_res_defconfig file.

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   ├── imx6ul-liteboard-lcd-res.dts │   ├── post-build.sh </pre>

Buildroot configuration for liteboard doesn't contain any configuration for LCD nor touchscreen therefore this demo will use customized device tree file ([https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/imx6ul-liteboard-lcd-res.dts imx6ul-liteboard-lcd-res.dts]).

During kernel compilation this file will be compiled and output will be stored as

imx6ul-liteboard-lcd-res.dtb

. You can find this file inside

output/images

directory.

Unfortunately on the target during boot procedure U-Boot will try to load

imx6ul-liteboard.dtb

file which will be not available on uSD card. Therefore every build Buildroot via

post-build.sh

script will adjust name of the Device Tree Blob file to the expected by the U-Boot.

Kernel configuration

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   ├── linux.defconfig </pre>

Customized Linux configuration is stored in

linux.defconfig

file. It will be used by the Buildroot to initialize proper kernel configuration.

Extra files

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   └── rootfs │   └── etc │   ├── profile.d │   │   └── tslib.sh │   └── udev │   └── rules.d │   └── 60-touchscreen.rules </pre>

To simplify/unify board setup two config files should be available on running liteboard:

* [https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/rootfs/etc/profile.d/tslib.sh /etc/profile.d/tslib.h] - to configure device for [https://github.com/kergoth/tslib tslib] library, * [https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/rootfs/etc/udev/rules.d/60-touchscreen.rules /etc/rules.d/60-touchscreen.rules] - to guarantee permanent name for the touchscreen device.

Each time when

make all

command will be called Buildroot will automatically copy

rootfs

directory content to the target

root

directory used in the next step to generate image for the liteboard.More details about this customization

Buildroot configuration

<pre> . ├── configs │   └── grinn_liteboard_lcd_res_defconfig </pre>

Complete configuration for buildroot is available in

configs/grinn_liteboard_lcd_res_defconfig

file. Each time when

make grinn_liteboard_lcd_res_defconfig

is called Buildroot is configured as defined within this file.

Device tree

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   ├── imx6ul-liteboard-lcd-res.dts │   ├── post-build.sh </pre>

Buildroot configuration for liteboard doesn't contain any configuration for LCD nor touchscreen therefore this demo will use customized device tree file ([https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/imx6ul-liteboard-lcd-res.dts imx6ul-liteboard-lcd-res.dts]).

During kernel compilation this file will be compiled and output will be stored as

imx6ul-liteboard-lcd-res.dtb

. You can find this file inside

output/images

directory.

Unfortunately on the target during boot procedure U-Boot will try to load

imx6ul-liteboard.dtb

file which will be not available on uSD card. Therefore every build Buildroot via

post-build.sh

script will adjust name of the Device Tree Blob file to the expected by the U-Boot.

Kernel configuration

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   ├── linux.defconfig </pre>

Customized Linux configuration is stored in

linux.defconfig

file. It will be used by the Buildroot to initialize proper kernel configuration.

Extra files

<pre> . ├── board │   └── grinn │   └── liteboard-lcd-res │   └── rootfs │   └── etc │   ├── profile.d │   │   └── tslib.sh │   └── udev │   └── rules.d │   └── 60-touchscreen.rules </pre>

To simplify/unify board setup two config files should be available on running liteboard:

* [https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/rootfs/etc/profile.d/tslib.sh /etc/profile.d/tslib.h] - to configure device for [https://github.com/kergoth/tslib tslib] library, * [https://github.com/grinn-pub/examples/blob/master/board/grinn/liteboard-lcd-res/rootfs/etc/udev/rules.d/60-touchscreen.rules /etc/rules.d/60-touchscreen.rules] - to guarantee permanent name for the touchscreen device.

Each time when

make all

command will be called Buildroot will automatically copy

rootfs

directory content to the target

root

directory used in the next step to generate image for the liteboard.

  • litesom/customization.1486316226.txt.gz
  • Last modified: 2017/02/05 17:37
  • by filug