Building Yocto HIO-Image-x11 with Qt5 SSH and WiFi

From HIO Wiki
Jump to: navigation, search

About

This tutorial is the next step after Setting up Yocto Environment. We will compile from scratch an image that can be run in HIO core-board.
hio-image-x11 is a full image that is based on Yocto Project's core image-sato with X11 Window System, SSH, USB Wifi module driver and Qt 5.2.1 framework

Minimum Spec Requirement

CPU 2 Core Processors
Memory Size 2G
Remaining Disk Space 60G
Operating System Ubuntu 12.04 LTS, Ubuntu 14.04 LTS

Setup Machine system variable and build directory

Different HIO board has different machine variable, select it from the table below.

HIO Board Machine Variable
HIO-EMB-1200 Dual Core hio-imx6dl-board
HIO-EMB-1200 Quad Core hio-imx6q-board
HIO i.MX6 Starter Kit hio-imx6dl-board
HIO i.MX6 POE Kit hio-imx6dl-board
3.5" Wallpad hio-imx6dl-ppc4535
7" Wallpad hio-imx6dl-ppc4507
10" Wallpad hio-imx6dl-ppc4510

In Terminal, input the following command to setup system variable and build directory (build-x11).

~/hio-yocto-bsp/$ export MACHINE=<Input Machine Variable>
~/hio-yocto-bsp/$ . ./setup-environment build-x11

Adjust the configuration file for X11 Image

Adjust the configuration file bblayers.conf

Use a test editor and add the following HIO and Qt related layers (italic bold) to build-x11/conf/bblayers.conf file

LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-yocto \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-fsl-arm \
  ${BSPDIR}/sources/meta-fsl-arm-extra \
  ${BSPDIR}/sources/meta-fsl-demos \
  ${BSPDIR}/sources/meta-qt5 \
  ${BSPDIR}/sources/meta-openembedded/meta-ruby \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  ${BSPDIR}/sources/meta-hio \
  ${BSPDIR}/sources/meta-hio-demos \
"

Adjust the configuration file local.conf

Add the following (italic bold) to build-x11/conf/local.conf file

Note: remember to add ssh-server-openssh that is next to EXTRA_IMAGE_FEATURES. The BB_NUMBER_THREADS and PARALLEL_MAKE number are based on the processor of the current device. It is automatically generated and varies for different computers.


MACHINE ??= 'hio-imx6dl-board
DISTRO ?= 'poky'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks   ssh-server-openssh"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K" 
PACKAGECONFIG_pn-qemu-native = "sdl"
PACKAGECONFIG_pn-nativesdk-qemu = "sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
LICENSE_FLAGS_WHITELIST = "commercial" PREFERRED_VERSION_hio-image = "1.01" SOURCE_MIRROR_URL ?= "http://www.hioproject.org/support/images/source_mirror/sources/" INHERIT += "own-mirrors" BB_GENERATE_MIRROR_TARBALLS = "1"
DL_DIR ?= "${BSPDIR}/downloads/" ACCEPT_FSL_EULA = "1"

Using Bitbake to Compile the image

Run the following bitbake command to compile the image.

~/hio-yocto-bsp/build-x11$ bitbake hio-image-x11

Note: For initial compiling stage of Hio-Yocto Project, the process will take several hours. Recompiling the same image will be quick after.

Yocto Image Build Deploy Files

After successfully compiled, the following important files are generated.
They are located in /build-x11/tmp/deploy/images/hio-imx6dl-board/

File and Item Name Description
Board Hio-imx6dl-board Model 1200+1240+1250+1280 (Default IO setting)
Uboot u-boot-hio-imx6dl-board-2014.01-r0.imx Boot loader.
Kernel uImage--3.10.17-r0-hio-imx6dl-board-YYYYmmddHHMMSS.dtb Kernel Tree Structure files, include hardware information.
uImage--3.10.17-r0-hio-imx6dl-board-YYYYmmddHHMMSS.bin Compressed Kernel file.
.SDCard hio-image-x11-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.sdcard Include uboot, kernel, rootfs. Can be written to SDCard by using dd command or Win32DiskImager
rootfs hio-image-x11-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.tar.bz2 X11 file System. Use X11 Desktop environment, SATO framework. Support SSH, USB Wifi, QT 5 etc.


References: Build Version for Hio-Yocto Sample Image

  • hio-image-minimal
    • Amall image that can only capable of allowing the system to boot with SSH and USB WiFi module driver support.
  • hio-image-fb
    • Based on hio-image-mimimal and added QT 5.2.1 frame buffer framework.
  • hio-image-x11
    • A full image that is based on Yocto Project's core image-sato with X11 Window System, SSH, USB Wifi module driver and Qt 5.2.1 framework
  • hio-image-xfce
    • A full image with Xfce Desktop Environment, SSH, USB WiFi module driver and Qt 5.2.1 framework


Next Step: Prepare SD Card for boot or update