Loading...
 

Build from source - Yocto


This tutorial provides instructions for building Yocto binaries for MACCHIATObin. In-detail requirements for building Yocto on a Linux build machine can be read in this document section 18.3.1 Support Linux Distributions. In this tutorial we will be building Yocto on Ubuntu 14.04.

Setting up build directories

First we will create a directory where we will download Yocto sources (e.g. /home/mcbin/yocto) and head into that directory:

mcbin@buildserver:~$ mkdir yocto
mcbin@buildserver:~$ cd yocto/
mcbin@buildserver:~/yocto$


Now we will download Marvell Yocto source code for MACCHIATObin:

# install repo and other necessary bitbake packages if needed, e.g. on Ubuntu:
mcbin@buildserver:~/yocto$ sudo apt-get install repo diffstat texi2html texinfo subversion chrpath gettext
# download Marvell sources
mcbin@buildserver:~/yocto$ repo init -u https://github.com/MarvellEmbeddedProcessors/marvell-embedded-linux-platform.git -b krogoth
# synchronize all files
mcbin@buildserver:~/yocto$ repo sync

 

 Note

The -b krogoth branch in the repo init string pulls down the development release branch from the repo server. If you want to pull the stable releases please use -b refs/tags/release_name in the end of the repo init string. For a complete list of the stable releases, please find them here.

Build binaries for MACCHIATObin

After updates have been installed, select the correct MACHINE for MACCHIATObin. We will also create a directory (here mcbin) which will contain build configuration and output:

mcbin@buildserver:~/yocto$ MACHINE=cb-88f8040-mcbin . setup-environment mcbin


After this command is executed, it will automatically change our location to the mcbin subdirectory. From there we will run bitbake command to build the root filesystem and kernel binaries for MACCHIATObin:

 Note

Depending on the speed of your internet connection and build machine, the build process could take a while to finish. Since it includes downloading sources from the Internet, make sure to have a stable Internet connection throughout the build process.

 

mcbin@buildserver:~/yocto/mcbin$ bitbake marvell-image-machine-test


After the build is finished, you can find the newly built rootfs tarball and kernel image containing the dtb file in the mcbin/tmp/deploy/images/cb-88f8040-mcbin/ subdirectory. So, head into it and check the contents of the directory:

mcbin@buildserver:~/yocto/mcbin$ cd tmp/deploy/images/cb-88f8040-mcbin/
mcbin@buildserver:~/yocto/mcbin/tmp/deploy/images/cb-88f8040-mcbin$ ls
Image
Image--4.4.52-r0.2-armada-8040-mcbin-20170727003000.dtb
Image--4.4.52-r0.2-cb-88f8040-mcbin-20170727003000.bin
Image-armada-8040-mcbin.dtb
Image-cb-88f8040-mcbin.bin
marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.license_manifest
marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.license_manifest.csv
marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.rootfs.manifest
marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.rootfs.tar.bz2
marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.rootfs.wic.gz
marvell-image-machine-test-cb-88f8040-mcbin.license_manifest
marvell-image-machine-test-cb-88f8040-mcbin.license_manifest.csv
marvell-image-machine-test-cb-88f8040-mcbin.manifest
marvell-image-machine-test-cb-88f8040-mcbin.tar.bz2
marvell-image-machine-test-cb-88f8040-mcbin.wic.gz
modules--4.4.52-r0.2-cb-88f8040-mcbin-20170727003000.tgz
modules-cb-88f8040-mcbin.tgz
README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt


The files which will be important for us here are the rootfs package (marvell-image-machine-test-cb-88f8040-mcbin-20170727003000.rootfs.tar.bz2), kernel image (Image-cb-88f8040-mcbin.bin) and the dtb file for MACCHIATObin (Image-armada-8040-mcbin.dtb).

Now we can copy kernel and dtb file and extract the root filesystem to a USB stick or MicroSD card. And use the USB stick/MicroSD card to boot the MACCHIATObin.