EosBake - A Practical Introduction to Yocto Project

in utopian-io •  6 years ago  (edited)


A Practical Introduction to Yocto Project

This tutorial aims to get you started on Yocto development. The final goal is to build and emulate a minimal x86-64 GNU/Linux environment with qemu.

The Yocto Project is a collaborative umbrella project coordinated by the Linux Foundation. Its main goal is to help developers create custom GNU/Linux-based Distributions for multiple hardware architectures.

Yocto's main components are BitBake, OpenEmbedded, and Poky.

  • BitBake is a python based make-like build tool specialized in cross compilation, although not limited to that. BitBake is inspired by Portage, Gentoo's package management system. BitBake uses recipes, which are metadata files with information about the packages to be built.

  • OpenEmbedded is a cross-compilation and build-automation framework focused on creating Linux distributions for embedded devices, adopted by the Yocto Project in 2011. OpenEmbedded modularizes BitBake recipes in form of layers. Each layer is called meta-layername.

  • Poky is the reference distribution of the Yocto Project. It contains the OpenEmbedded Build System (BitBake and OpenEmbedded Core) as well as a set of metadata to get you started building your own distro.

For more information, refer to the Yocto Project Mega Manual. Yocto is famous for its solid documentation. You can find a neat "getting started" style section here, which is where this tutorial is based off of.

Minimal requirements:

  • x86-64 CPU with at least 4 cores
  • Ubuntu 16.04.4 LTS (Xenial Xerus)
  • at least 50GB of space at $HOME

Install Yocto dependencies:

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm

Clone Poky

$ cd ~
$ git clone git://git.yoctoproject.org/poky

Start build environment

cd poky
source oe-init-build-env build

Edit conf/local.conf

  • MACHINE ??= "qemux86-64"
  • DL_DIR ?= "${TOPDIR}/downloads"
  • PARALLEL_MAKE = "-j4"
  • BB_NUMBER_THREADS = "12"

Obs.: the optimal number of parallel make and BitBake tasks might vary, depending on your host hardware.

Start BitBake

bitbake core-image-minimal

Obs.: this step might take from a few to several hours, depending on your host hardware.

Start QEMU

runqemu qemux86-64 core-image-minimal nographic

Obs.: the nographic option is only required if you're accessing the build host remotely. If you're on a desktop environment, feel free to remove this option and watch QEMU emulate the video output.


This tutorial is brought to you by EosBake.

Please subscribe to our Steemit and DTube channels for new content.

Global Crypto Holdings

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for your contribution.

  • Doesn´t follow the template for tutorials. See the template here.

See in this link an example of a good tutorial.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

@eosbake, I gave you an upvote on your post! Please give me a follow and I will give you a follow in return and possible future votes!

Thank you in advance!

Congratulations @eosbake! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!