Training Embedded Linux with Yocto: Building embedded Linux platforms using Yocto - Operating Systems: Linux D1Y - Embedded Linux with Yocto Building embedded Linux platforms using Yocto Objectives Understanding the architecture of the Linux system Learn how to install Linux on your hardware and create a BSP Explore the Linux system architecture Booting Linux Initializing the system Install existing packages on the target Learn how to install Linux on flash chips Using and customizing Yocto Labs are conducted on quad Cortex/A9-based "Sabre" boards from NXP. We use a recent Yocto version Printed course material (in English) One Linux PC for two trainees. One target platform (i.mx6 Sabre) for two trainees Course environment Prerequisite Good C programming skills Knowledge of Linux user programming (see our D0 - Programmation Linux course) Preferably knowledge of Linux kernel and driver programming (see our D3 - Linux Drivers course) Plan First Day Linux history and Version management Linux system architecture Processes and MMU System calls Shared libraries Linux components Introduction to Linux
Toolchain Bootloader Kernel Root file system Linux distributions Linux packages The various licenses used by Linux (GPL, LGPL, etc) Boot loaders (UBoot, Redboot, barebox) Optimized libraries (eglibc, uclibc) Toolchains Embedded GUIs Busybox Embedded distributions Commercial Standard Tools for building custom distributions Overview of Yocto History Yocto, Open Embedded and Poky Purpose of the Yocto project The main projects Yocto build system architecture Overview Recipes and classes Tasks Layers and layer priorities Directory layout Configuration files (local, machine and distribution) The bitbake tool Common options Using Yocto Building a package Building an image (root file system + u-boot + kernel) Miscellaneous tools around Yocto Yocto Application Development Toolkit (ADT) Hob Exercice: Building a root file system using Yocto D1Y - Embedded Linux with Yocto 06/04/18 Linux tools for embedded systems Introduction to Yocto Second Day Introduction to U-Boot Booting the board through U-Boot Booting from NOR Booting from NAND Booting from emmc U-Boot environment variables User-defined variables Predefined variables Using U-Boot
D1Y - Embedded Linux with Yocto 06/04/18 Variables substitution The U-Boot minimal shell Writing scripts in variables Executing scripts Using variables in scripts: the set-script pattern U-Boot main commands Booting an OS Accessing flash chips Accessing file systems (NFS, FAT, EXTx, JFFS2 ) The full U-Boot shell Script structure Control flow instructions (if, for ) Booting Linux Linux kernel parameters The Linux startup sequence Exercice: Writing a script to configure the network and pass this configuration to the Linux kernel Exercice: Booting the board on NFS, using pre-existing images Exercice: Writing scripts to choose between boot from flash or from the network Building U-Boot Building and installing U-Boot with its native build system Building U-boot with Yocto Exercice: Configuring and building u-boot with its native build system Exercice: Building u-boot from Yocto Building the kernel The Linux build system Downloading stable source code Getting a tarball Using GIT Configuring the kernel Compiling the kernel and its modules Modules delivered in-tree Out-of-tree modules Installing the kernel and the modules Configuring and building the kernel with Yocto Exercice: Configuring and compiling a target kernel for the target board with the kernel build system Exercice: Configuring and compiling a target kernel for the target board with Yocto Third Day Packages Tools to build packages (gcc, Makefile, pkg-config) Autotools Cross-compiling a package with autotools The all-in-one applications Busybox, the basic utilities Dropbear: encrypted communications (ssh) Automatically starting a program at boot Initialization systems (busybox init, system V init) Exercice: Cross-compiling an autotools-based package Building packages
D1Y - Embedded Linux with Yocto 06/04/18 Writing package recipes for Yocto Recipe architecture The bitbake language Standard variables and functions Writing recipes in python Introduction to python Using python for writing recipes Various kind of recipes bare program Makefile-based package autotools-based package u-boot kernel out-of-tree module Exercice: Writing a package recipe for an autotools-based package Writing new tasks Recipes dependencies Adding patches Adding a new layer Customizing an existing package (.bbappend) Automatically starting a program (class update-rc.d) Exercice: Writing a package recipe for an autotools-based package Storage interfaces Block devices MTD Flash memories and Linux MTDs NOR flashes NAND flashes ONENAND flashes The various flash file system formats JFFS2, YAFFS2, UBIFS Read-only file system CRAMFS, SQUASHFS Standard Linux file systems Ext2/3/4, FAT, NFS Ramdisks and initrd Creating an initramfs Booting through an initramfs Choosing the right file system formats Flashing the file system Embedded file systems Creating a root file system Manually building your root file system Device nodes, programs and libraries Configuration files (network, udev, ) Installing modules Looking for and installing the needed libraries Testing file system consistency and completeness Exercice: Manually creating a minimal root file system using busybox and dropbear Building a root file system with Yocto Creating a custom root file system Writing an image recipe
Selecting the packages to build Selecting the file system types Customizing system configuration files (network, mount points, ) Package management ipkg Exercice: Writing and building an image recipe Exercice: Creating a JFFS2 or UBIFS image with Yocto and flashing it D1Y - Embedded Linux with Yocto 06/04/18 Fourth Day Porting Yocto to a new board BSP architecture Selecting and configuring u-boot recipe Selecting and configuring kernel recipe Adding a new BSP layer (yocto-bsp create) Exercice: Creating a new BSP layer Porting Yocto Porting U-boot Porting source code U-Boot source structure Adding a new board to U-Boot sources U-Boot drivers (RS232, network, flash, SD/MMC) U-Boot startup and board initialization Adding a custom u-boot to Yocto Exercice: Creating a board support package in U-Boot and setup of initialization code Linux BSP architecture Overall structure The ARM BSP The Linux build system Defining and initializing the board Programmatically (platform, i2c, spi, ) Using the Flattened Device Tree Customizing the Yocto kernel recipe Setting the default configuration Providing a fragment Adding patches Specifying the kernel sources Exercice: Create a minimal BSP for the target board Porting the kernel Renseignements pratiques Duration : 4 jours Cost : 2200 HT SARL au capital de 138600 - SIRET 449 597 103 00026 - RCS Nanterre - NAF 722C - Centre de Formation : 19, rue Pierre Curie - 92400 Courbevoie Siège social et administration : 21, rue Pierre Curie - 92400 Courbevoie - Tél. 01 41 16 80 10 - Fax. 01 41 16 07 78 Last site update: Mon Jun 4 11:08:05 2018 http://www.ac6-formation.com/