Building Yocto HIO-Image-minimal with 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-minimal is a small image just capable of allowing the system to boot up with SSH and USB Wifi module driver support.

Minimum Spec Requirement

CPU 2 Core Processors
Memory Size 2G
Remaining Disk Space 30G
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-minimal).

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

Note :Freescale required user to read all the license agreement, Press "space" until the end and press "Y"

Adjust the configuration file for minimal image

Adjust the configuration file bblayers.conf

Use a text editor and add the following HIO related layers (italic bold) to build-minimal/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-hio \ 
  ${BSPDIR}/sources/meta-hio-demos \ 
"

Adjust the configuration file local.conf

Add the following (italic bold) to build-minimal/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()}"
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-minimal$ bitbake hio-image-minimal

Note: This is the initial compiling stage of Hio-Yocto Project. The compiling 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-minimal/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.
SD image hio-image-minimal-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.sdcard Include uboot, kernel, rootfs. Can be written to SDCard by using dd command or Win32DiskImager
rootfs hio-image-minimal-hio-imx6dl-board-YYYYmmddHHMMSS.rootfs.tar.bz2 Build-minimal File system. Build-minimal supports SSH, USB WiFi etc.


References: Build Version for Hio-Yocto Sample Image

  • hio-image-minimal
    • A small 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