5
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 can be conducted either on qemu or on target boards, that can be: Quad Cortex/A9-based "SabreLite" boards from NXP. Quad Cortex/A53-based "imx8q-evk" boards from NXP. We use the latest Yocto version supported by the chip provider Course environment Printed course material (in English) One Linux PC for two trainees. One target platform (quad Cortex-A9 i.MX6 Sabrelite or quad Cortex-A53 i.MX8-EVK from Freescale) for two trainees (if not using qemu) 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 Introduction to Linux Linux history and Version management Linux system architecture Processes and MMU

D1Y - Embedded Linux with Yocto - AC6-Formation€¦ · D1Y - Embedded Linux with Yocto 07/18/18 Initialization systems (busybox init, system V init) Exercice:€ Cross-compiling

Embed Size (px)

Citation preview

Training Embedded Linux with Yocto: Building embedded Linuxplatforms using Yocto - Operating Systems: Linux

D1Y - Embedded Linux with Yocto

Building embedded Linux platforms using Yocto

Objectives

Understanding the architecture of the Linux systemLearn how to install Linux on your hardware and create a BSPExplore the Linux system architectureBooting LinuxInitializing the systemInstall existing packages on the targetLearn how to install Linux on flash chipsUsing and customizing Yocto

Labs can be conducted either on qemu or on target boards, that can be:    Quad Cortex/A9-based "SabreLite" boards from NXP.    Quad Cortex/A53-based "imx8q-evk" boards from NXP.We use the latest Yocto version supported by the chip provider

Course environment

Printed course material (in English)One Linux PC for two trainees.One target platform (quad Cortex-A9 i.MX6 Sabrelite or quad Cortex-A53 i.MX8-EVK from Freescale) for two trainees (if notusing qemu)

Prerequisite

Good C programming skillsKnowledge 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

Introduction to Linux

Linux history and Version managementLinux system architecture

Processes and MMU

D1Y - Embedded Linux with Yocto 09/13/18

System callsShared libraries

Linux componentsToolchainBootloaderKernelRoot file system

Linux distributionsLinux packagesThe various licenses used by Linux (GPL, LGPL, etc)

Linux tools for embedded systems

Boot loaders (UBoot, Redboot, barebox)Optimized libraries (eglibc, uClibc)ToolchainsEmbedded GUIsBusyboxEmbedded distributions

CommercialStandardTools for building custom distributions

Introduction to Yocto

Overview of YoctoHistoryYocto, Open Embedded and PokyPurpose of the Yocto projectThe main projects

Yocto build system architectureOverviewRecipes and classesTasksLayers and layer prioritiesDirectory layoutConfiguration files (local, machine and distribution)The bitbake tool

Common optionsUsing Yocto

Building a packageBuilding an image (root file system + u-boot + kernel)

Miscellaneous tools around YoctoYocto Application Development Toolkit (ADT)Hob

Exercice:  Building a root file system using Yocto

Second Day

Using U-Boot

Introduction to U-BootBooting the board through U-Boot

Booting from NORBooting from NANDBooting from eMMC

D1Y - Embedded Linux with Yocto 09/13/18

U-Boot environment variablesUser-defined variablesPredefined variablesVariables substitution

The U-Boot minimal shellWriting scripts in variablesExecuting scriptsUsing variables in scripts: the set-script pattern

U-Boot main commandsBooting an OSAccessing flash chipsAccessing file systems (NFS, FAT, EXTx, JFFS2…)

The full U-Boot shellScript structureControl flow instructions (if, for…)

Booting LinuxLinux kernel parametersThe Linux startup sequence

Exercice:  Writing a script to configure the network and pass this configuration to the Linux kernelExercice:  Booting the board on NFS, using pre-existing imagesExercice:  Writing scripts to choose between boot from flash or from the network

Building U-Boot

Building and installing U-Boot with its native build systemBuilding U-boot with Yocto

Exercice:  Configuring and building u-boot with its native build systemExercice:  Building u-boot from Yocto

Building the kernel

The Linux build systemDownloading stable source code

Getting a tarballUsing GIT

Configuring the kernelCompiling the kernel and its modules

Modules delivered in-treeOut-of-tree modules

Installing the kernel and the modulesConfiguring and building the kernel with Yocto

Exercice:  Configuring and compiling a target kernel for the target board with the kernel build systemExercice:  Configuring and compiling a target kernel for the target board with Yocto

Third Day

Building packages

PackagesTools to build packages (gcc, Makefile, pkg-config)AutotoolsCross-compiling a package with autotools

The all-in-one applicationsBusybox, the basic utilitiesDropbear: encrypted communications (ssh)

Automatically starting a program at boot

D1Y - Embedded Linux with Yocto 09/13/18

Initialization systems (busybox init, system V init)Exercice:  Cross-compiling an autotools-based package

Writing package recipes for Yocto

Recipe architectureThe bitbake language

Standard variables and functionsWriting recipes in python

Introduction to pythonUsing python for writing recipes

Various kind of recipesbare programMakefile-based packageautotools-based packageu-bootkernelout-of-tree module

Exercice:  Writing a package recipe for an autotools-based packageWriting new tasksRecipes dependenciesAdding patchesAdding a new layerCustomizing an existing package (.bbappend)Automatically starting a program (class update-rc.d)

Exercice:  Writing a package recipe for an autotools-based package

Embedded file systems

Storage interfacesBlock devicesMTD

Flash memories and Linux MTDsNOR flashesNAND flashesONENAND flashes

The various flash file system formatsJFFS2, YAFFS2, UBIFS

Read-only file systemCRAMFS, SQUASHFS

Standard Linux file systemsExt2/3/4, FAT, NFS

Ramdisks and initrdCreating an initramfsBooting through an initramfs

Choosing the right file system formatsFlashing the file system

Creating a root file system

Manually building your root file systemDevice nodes, programs and librariesConfiguration files (network, udev, …)Installing modulesLooking for and installing the needed librariesTesting file system consistency and completeness

Exercice:  Manually creating a minimal root file system using busybox and dropbearBuilding a root file system with Yocto

D1Y - Embedded Linux with Yocto 09/13/18

Creating a custom root file systemWriting an image recipeSelecting the packages to buildSelecting the file system typesCustomizing system configuration files (network, mount points, …)

Package managementipkg

Exercice:  Writing and building an image recipeExercice:  Creating a JFFS2 or UBIFS image with Yocto and flashing it

Fourth Day

Porting Yocto

Porting Yocto to a new boardBSP architecture

Selecting and configuring u-boot recipeSelecting and configuring kernel recipe

Adding a new BSP layer (yocto-bsp create)Exercice:  Creating a new BSP layer

Porting U-boot

Porting source codeU-Boot source structureAdding a new board to U-Boot sourcesU-Boot drivers (RS232, network, flash, SD/MMC)U-Boot startup and board initialization

Adding a custom u-boot to YoctoExercice:  Creating a board support package in U-Boot and setup of initialization code

Porting the kernel

Linux BSP architectureOverall structureThe ARM BSPThe Linux build system

Defining and initializing the boardProgrammatically (platform, i2c, spi, …)Using the Flattened Device Tree

Customizing the Yocto kernel recipeSetting the default configurationProviding a fragmentAdding patchesSpecifying the kernel sources

Exercice:  Create a minimal BSP for the target board

Renseignements pratiques

Duration : 4 joursCost : 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: Thu Sep 13 23:55:43 2018http://www.ac6-formation.com/