Buildroot SDK/Building customized image

From Chiliboard Wiki
Jump to: navigation, search

This document describes how to build your own system image using Buildroot. This description is based on the latest chili Buildroot available on github hosting: https://github.com/chilisom/buildroot.git

How to build customized system image

Please make short look on very good manual https://buildroot.org/downloads/manual/manual.html

  • Prepare your system. Install basic build tools like gcc and cpp.
sudo apt-get install build-essential libncurses5-dev
  • clone chili-buildroot from the git server. This is the best and recommended way because the git repository contains the latest sources.
    • Another option is to use ready SDK package which is old and can be used only as fast starting point to familiarize with device. For details, see Getting started.
$ git clone https://github.com/chilisom/buildroot.git
  • Change the current directory by:
$ cd buildroot_sdk_path/chili-buildroot*
or (git clone):
$ cd buildroot
  • Select the basic configuration of the Buildroot. Currently, the following configurations are defined:
chiliboard_nand0_ram128_defconfig
chiliboard_nand256_ram128_defconfig
chiliboard_nand256_ram256_defconfig
chiliboard_nand256_ram256_lcd_defconfig
chiliboard_nand512_ram512_defconfig
chiliboard_nand512_ram512_lcd_defconfig
There are also defined two complex configurations using Qt library.
chiliboard_nand256_ram128_qt4_defconfig
chiliboard_nand256_ram128_qt5_defconfig
NOTE: Only QT libraries are enabled in above configurations. To get LCD hardware working, correct DT file has to be used. Please refer to LCD_sandwich page.
Configuration details can be found in SDK Content. The appropriate configuration should be selected by command (eg. for 256MB NAND and 128 MB RAM):
$ make chiliboard_nand256_ram256_defconfig
  • Then modify the build options and select the required packages using:
$ make menuconfig
Now it is time to enable hardware LCD support for LCD_sandwich.
After modification, save the configuration.
  • Finally, build all:
$ make
  • By default, all final files will be created in the directory:
buildroot_path/output/images/
How to use these files, see Getting started.

Default system configuration

Below are shown the Buildroot settings used in all configurations for chiliboard.

System configuration --->
Init system --> systemd
*** /dev management using udev (from systemd) *** 
Target packages --->
Hardware handling --->
[*]   dbus
[*]   evtest
[*]   i2c-tools
Target packages --->
Filesystem and flash utilities --->
[*] mtd, jffs2 and ubi/ubifs tools
      *** MTD tools selection ***
[ ]   docfdisk (NEW)
[ ]   doc_loadbios (NEW)
[*]   flashcp (NEW)
[*]   flash_erase (NEW)
[*]   flash_lock (NEW)
[ ]   flash_otp_dump (NEW)
[ ]   flash_otp_info (NEW)
[ ]   flash_otp_lock (NEW)
[ ]   flash_otp_write (NEW)
[*]   flash_unlock (NEW)
[ ]   ftl_check (NEW)
[ ]   ftl_format (NEW)
[ ]   jffs2dump (NEW)
[*]   mkfs.jffs2
[*]   mkfs.ubifs
[*]   mtd_debug (NEW)
[*]   nanddump (NEW)
[*]   nandtest (NEW)
[*]   nandwrite (NEW)
[ ]   nftldump (NEW)
[ ]   nftl_format (NEW)
[ ]   recv_image (NEW)
[ ]   rfddump (NEW)
[ ]   rfdformat (NEW)
[ ]   serve_image (NEW)
[ ]   sumtool (NEW)
[*]   mtdinfo (NEW)
[*]   ubiattach (NEW)
[*]   ubicrc32 (NEW)
[*]   ubidetach (NEW)
[*]   ubiformat (NEW)
[*]   ubimkvol (NEW)
[*]   ubinfo (NEW)
[*]   ubinize (NEW)
[*]   ubirename (NEW)
[*]   ubirmvol (NEW)
[*]   ubirsvol (NEW)
[*]   ubiupdatevol (NEW)
[*]   ubiblock (NEW)

Additional packages used in images with Qt library

Touchscreen access library.

Target packages --->
Libraries --->
 Hardware handling  --->
  [*]   tslib

Support for hardware graphics accelerator SGX530 (used with Qt5).

Target packages --->
Hardware handling --->
 [*] ti-gfx
 [ ]   enable debug support
 [*]   install demos
 [*]   install eglimage version of libraries
       Target (es8.x (AM335x))  --->

SSH client and server.

Target packages --->
Networking applications --->
 [*] dropbear
 [*]   client programs
 [ ]   disable reverse DNS lookups
 [*]   optimize for size
 [ ]   log dropbear access to wtmp
 [ ]   log dropbear access to lastlog

ALSA support.

Target packages --->
Audio and video applications  --->   
 [*] als-utils
     ALSA utils selection --->
 [*]    alsaconf
 [*]    alsactl
 [*]    alsamixer
 [*]    amixer
 [*]    aplay/arecord
 [*]    speaker-test

Configuration for Qt4 library

Target packages --->
Graphic libraries and applications (graphic/text)  --->
 Qt --->
--- Qt
      Qt installation (Qt embedded)  --->
[ ]   Compile with debug support
[*]   Compile and install Qt demos (with code)
[ ]   Install translation files
[*]   Compile and install Qt examples (with code)
      Library type (Shared library)  --->
[*]   Approve free license 
()    Config file
[ ]   Compatibility with Qt3
-*-   Gui Module
        Pixel depths  --->
        Fonts  --->
        freetype2 support (no freetype2 support)  --->
[*]     Enable GIF support
[ ]     Enable libmng support
        JPEG support (Use Qt bundled libjpeg)  --->
        PNG support (Use Qt bundled libpng)  --->
        TIFF support (Use Qt bundled libtiff)  --->
      zlib support (Qt zlib)  --->
[ ]   SQL Module  ----
      Graphics drivers  --->
         [*] Linux Framebuffer
         [ ] Transformed
         [ ] Qt Virtual Framebuffer
         [ ] VNC
         [ ] multiscreen
             *** directfb Qt driver not available (need directfb) ***
      Mouse drivers  --->
         [ ] pc
         [ ] linuxtp
         [*] linux input
         [*] tslib
         [ ] qvfb
              *** Mouse Options ***
         [ ] Hide the mouse cursor
      Keyboard drivers  --->
      *** Phonon module needs gstreamer ***
[ ]   DBus Module
[*]   XML Module
[ ]     XML Patterns Module
[ ]   Multimedia Module
[ ]   SVG Module
-*-   Network Module
[*]   WebKit Module
[*]   STL support
[ ]   Enable OpenSSL support
[*]   Script Module
[ ]   Script Tools Module
[ ]   Test Module

Configuration for Qt5 library

Target packages --->
Graphic libraries and applications (graphic/text)  --->
 Qt5 --->
--- Qt5
-*-   qt5base
[*]     Approve free license
[*]     Compile and install examples (with code)
-*-     concurrent module
[*]     MySQL Plugin
[*]     PostgreSQL Plugin
    SQLite 3 support (Qt SQLite)  --->
-*-     gui module
-*-       widgets module
-*-       OpenGL support
            OpenGL API (OpenGL ES 2.0+)  --->
[*]         opengl module
[*]       linuxfb support
[ ]       directfb support
          *** X.org XCB backend available if X.org is enabled ***
[*]       eglfs support
(linuxfb) Default graphical platform
[ ]       fontconfig support
[*]       GIF support
[*]       JPEG support
[*]       PNG support
-*-     DBus module
-*-     Enable ICU support
[*]     Enable Tslib support
[*]   qt5connectivity
-*-   qt5declarative
-*-     quick module
[*]   qt5enginio
[*]   qt5graphicaleffects
[*]   qt5imageformats
[*]   qt5multimedia
[*]   qt5quick1
[*]   qt5quickcontrols
-*-   qt5script
[*]   qt5sensors
[*]   qt5serialport
[*]   qt5svg
[*]   qt5webkit
[*]     qt5webkit examples
[*]   qt5websockets
-*-   qt5xmlpatterns

Modyfing filesystem content

The simplest way to modify existing files or add new files to target file system is to use root file system overlay (see Project-specific customization).

Enable rootfs overlay

Please run

$ make menuconfig

find following options:

System configuration  --->
()  Root filesystem overlay directories

write path do directory contain filesystem structure will be copied onto target file system. Let it be board/grinn/chiliboard/rootfs_overlay

System configuration  --->
(board/grinn/chiliboard/rootfs_overlay) Root filesystem overlay directories

Filesystem customization

To change content of /etc/issue

mkdir -p board/grinn/chiliboard/rootfs_overlay/etc
echo "Welcome to my new board" > board/grinn/chiliboard/rootfs_overlay/etc/issue

To put web page:

mkdir -p board/grinn/chiliboard/rootfs_overlay/var/www
echo "My test page" > board/grinn/chiliboard/rootfs_overlay/var/www/index.html

Generate target images

To apply changes:

$ make

and all files from specified directory will be copied onto target file system.