Show Contents

# Build standalone/external images

You can use the Linux source tree to build standalone/external images for your Digi Embedded Yocto platform.

## Prepare the sources and build environment

To follow a standalone/external build workflow, you need to:

1. Clone the Linux kernel repository (https://github.com/digi-embedded/linux.git) to your development machine if you haven't already done so:

    git clone https://github.com/digi-embedded/linux.git

2. Check out the branch of your choice:

    cd linux
    git checkout <branch name>

> You can use the following command to generate a list of branches by platform:

>     bitbake - c virtual/kernel | grep "^SRCBRANCH="

Note You can also create new branches for your own development needs, but you must periodically merge them with the official branches to get source code updates.

4. Set up the build environment so your current shell session has the variables needed for the build, such as toolchain path, cross-compile prefixes, and target architecture.

1. If you don't already have it, download the Digi Embedded Yocto toolchain from ftp://ftp1.digi.com/support/digiembeddedyocto/2.2/r3/sdk/ (select the toolchain for your platform) and run the self-extracting script. For example, to install the ConnectCore 6UL SBC Express (also known as the ConnectCore 6UL Starter Board) toolchain on your development machine, run:

    wget ftp://ftp1.digi.com/support/digiembeddedyocto/2.2/r3/sdk/ccimx6ulstarter/fb/dey-glibc-x86_64-core-image-base-cortexa7hf-neon-toolchain-2.2-r3.sh
    ./dey-glibc-x86_64-core-image-base-cortexa7hf-neon-toolchain-2.2-r3.sh

3. Source the environment setup script:

    source /path/to/toolchain/environment-setup-cortexa7hf-vfp-neon-dey-linux-gnueabi

4. Unset the LDFLAGS variable (or the kernel won't compile):

    unset LDFLAGS

## Configure the kernel

Now that the environment is ready, you can configure the kernel for your platform of choice:

    make <platform>_defconfig

Note If you aren't sure which Linux branch to use, run the following command to determine which branch is using your Yocto project:

    user:yocto-workspace$ bitbake -e virtual/kernel | grep "^SRCBRANCH="
    SRCBRANCH="v4.1/dey-2.2/maint"

You can also look at the kernel recipes included in Digi Embedded Yocto: each recipe (.bb file) specifies a Linux branch (SRCBRANCH variable) and a set of machines that can use it (COMPATIBLE_MACHINE variable).

After running this command, you can modify your chosen configuration via an ncurses interface with:

    make menuconfig

Change the kernel configuration as needed, then save and close the configuration tool.

If you wish to save your custom configuration for future builds, save it as a defconfig, copy the generated file to arch/arm/configs, and name it as you like:

    make savedefconfig
    cp defconfig arch/arm/configs/my_custom_defconfig

## Compile the kernel

Once you have configured the kernel, you can compile it. To build a zImage, run:

    make -j8

Note The -j8 flag specifies the number of parallel jobs to run during the build. Set it to twice the number of cores on your development machine to speed up compilation.

zImage is used on the following platforms:

- ConnectCore 6UL
- ConnectCore 6 Plus

You can find the final kernel zImage in arch/arm/boot and the device tree blobs in arch/arm/boot/dts.

To build a uImage (suitable for booting in old U-Boot images):

    make -j8 LOADADDR=<loadaddr> uImage

loadaddr is the RAM address where the uImage is loaded:

Platform | loadaddr
--- | ---
ConnectCore 6 | 0x10800000

You can choose to compile only the device tree blobs with:

    make dtbs

For information on additional make commands, run:

    make help

© 2018 Digi International Inc. All rights reserved.
Build standalone/external images updated on 30 January 2018 09:07:21 AM