The input specifications for a generic i.MX 6 solo machine have been mostly documented in the meta-fsl-arm-extra layer. The output image that is produced from these input specifications is an image that consists of the u-boot boot loader, i.MX 6 Solo/Dual kernel, and ext3 root filesystem.
In an effort to build a custom Linux distribution for the i.MX 6 Solo/Dual with the least amount of packages in the shortest amount of time, slimming down the input specifications, configuring the distribution, and naming it should only require modification of a few files. Here are the steps.
The new distribution will be called the bsec distribution. The bsec distribution will consist of a minimal Linux image, u-boot boot loader, and ext3 root filesystem configured for the i.MX 6 based riotboard.
Perform the following steps on the host.
$ mkdir $HOME/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x $HOME/bin/repo
$ echo "PATH=$PATH:$HOME/bin" >> $HOME/.bashrc
$ source .bashrc
$ mkdir -p $HOME/src/fsl-community-bsp
$ cd $HOME/src/fsl-community-bsp
$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dizzy
$ repo sync
$ MACHINE=imx6dl-riotboard . ./setup-environment build
$ cd $HOME/src/fsl-community-bsp/sources
$ mkdir -p meta-bsec/conf/distro
$ mkdir -p meta-bsec/recipes-bsec/images
$ cd poky/meta/recipes-core/images
$ cp core-image-minimal.bb ../../../../meta-bsec/recipes-bsec/images/bsec-image.bb
sources/meta-bsec/conf/layer.conf should contain the following
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "bsec"
BBFILE_PATTERN_bsec = "^${LAYERDIR}/"
BBFILE_PRIORITY_bsec = "6" sources/meta-bsec/conf/distro/bsecdist.conf should contain the following
require conf/distro/poky.conf
DISTRO = "bsecdist"
DISTRO_NAME = "bsecdist distribution"
DISTRO_VERSION = "1.0"
DISTRO_CODENAME = "bsc"
SDK_VENDOR = "-bsecdistsdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
MAINTAINER = "bsecdist <e-mail-address>"
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1" 6. Added the new layer to bblayers.conf
build/conf/bblayers.conf should contain the following
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-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-fsl-arm \
${BSPDIR}/sources/meta-fsl-arm-extra \
${BSPDIR}/sources/meta-fsl-demos \
${BSPDIR}/sources/poky/meta-selinux \
${BSPDIR}/sources/meta-bsec \
"
7. Set the distribution to the bsec distribution in local.conf
build/conf/local.conf should contain the following
MACHINE ??= 'imx6dl-riotboard'
DISTRO ?= 'bsecdist'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
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_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"
BB_NUMBER_THREADS = '1'
PARALLEL_MAKE = '-j 1'
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
8. Pull the OpenEmbedded SELinux meta layer for later configuration
$ cd sources/poky
$ git clone -b dizzy git://git.yoctoproject.org/meta-selinux
$ cd ../..
9. Perform the build
$ cd build
$ bitbake bsec-image
10. Write the image to the SD card
$ cd tmp/deploy/images/imx6dl-riotboard
$ sudo dd if=bsec-image-imx6dl-riotboard.sdcard of=/dev/sdX bs=1M
$ sudo sync At this point, the jumpers on the riotboard should be set to boot from the SD card. Next, power on the riotboard with the new SD card. If HDMI is connected, the Das u-boot software engineering logo should appear on the display.
bsecdist distribution 1.0 imx6dl-riotboard /dev/ttymxc1
imx6dl-riotboard login:
Review the input specifications for the riotboard machine should be simple. Start with the following files
sources/meta-fsl-arm-extra/conf/machine/imx6dl-riotboard.conf
sources/poky/meta-yocto/conf/distro/poky.conf
sources/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc
sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc_3.17.bb
sources/poky/meta/conf/machine/include/tune-cortexa9.inc
The input specifications for this image are raw and generic. They define software support for ALL of the on-board peripherals with the e-fuses left open.
Finally, the output image was 29 MB and is comprised of the u-boot boot loader, the Linux kernel, and the root file system. This is a decent place to start before adding more software to the BSP.