Buildroot Workshop. Libre Software Meeting 2012. Thomas Petazzoni Free Electrons thomas.petazzoni@free-electrons.com



Similar documents
The embedded Linux quick start guide lab notes

Using Buildroot for real projects

Buildroot for Vortex86EX (2016/04/20)

Building an audio player using the Texas Instruments OMAP-L137

Pwn Plug Community Edition 1.1 Installation Guide

VoIP Laboratory B How to re flash an IP04

Procedure to Create and Duplicate Master LiveUSB Stick

Embedded Linux development with Buildroot training 3-day session

Getting started with ARM-Linux

Track One Building a connected home automation device with the Digi ConnectCore Wi-i.MX51 using LinuxLink

Embedded Linux Training. Lab Book. free electrons

Application Development Kit for Android Installation Guide

Version 1.0. File System. Network Settings

AVR32737: AVR32 AP7 Linux Getting Started. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Yocto Project Eclipse plug-in and Developer Tools Hands-on Lab

Embedded Linux Systems

PBX DIGITAL TELEPHONE EXCHANGE MAINTENANCE GUIDE

Setting up a Raspberry Pi as a WiFi access point

Backup of ESXi Virtual Machines using Affa

Embedded Linux Platform Developer

System administration basics

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

An Embedded Wireless Mini-Server with Database Support

APPLICATION NOTE. How to build pylon applications for ARM

Embedded Linux Systems

Chapter 1 Hardware and Software Introductions of pcduino

SheevaPlug Development Kit README Rev. 1.2

Modifying and Rebuilding Android Kernel and Root Filesystem

Introduction. Created by Richard Bell 10/29/2014

The Build Process. of (GNU Tools for ARM Embedded Processors)

Software Tools Bootcamp

RMLL Hello. thank you for coming

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Create a virtual machine at your assigned virtual server. Use the following specs

Survey of Filesystems for Embedded Linux. Presented by Gene Sally CELF

Developing Embedded Linux Devices Using the Yocto Project

Sistemi ad agenti Principi di programmazione di sistema

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Enabling OpenFlow v1.0 on Mikrotik RouterBoard 750GL: A Tutorial

Newton2 Developers Guide

Quick Start Guide. Quick Start Guide. taskit GmbH. for Portux920T EU / SW Portux Mini-PC Portux Panel-PC Panel-Card MoLUX Stamp

Embedded Linux development training 4 days session

Five standard procedures for building the android system. Figure1. Procedures for building android embedded systems

Buildroot. Buildroot. Free Electrons. Free Electrons. Embedded Linux Developers

[HOW TO RECOVER AN INFINITI/EVOLUTION MODEM IDX ] 1

Lab 1: Introduction to the network lab

Network/IP Camera Set up and Re-programming. Leopard Imaging Inc. Jan, 2013.

How to Create, Setup, and Configure an Ubuntu Router with a Transparent Proxy.

Step By Step Guide for Starting "Hello, World!" on OpenWRT

Overview. Open source toolchains. Buildroot features. Development process

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

i.mx USB loader A white paper by Tristan Lelong

SEAGATE BUSINESS NAS ACCESSING THE SHELL. February 1, 2014 by Jeroen Diel IT Nerdbox

Developing Embedded Linux Devices Using the Yocto Project

Raspberry Pi Kernel-o-Matic

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

ARMSDK-VM Virtual Appliance A preconfigured Linux system

Building a diskless Linux Cluster for high performance computations from a standard Linux distribution

Software Prerequisites Linux Ubuntu LTS. Estimated completion time: 15min. The goal of this hands-on is to:

Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet

pbuilder Debian Conference 2004

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Getting started with Android on the i.mx based COM boards

LINUX BOOT TIME OPTIMIZATION FTP SERVER

PetaLinux SDK User Guide. Application Development Guide

Setting up PostgreSQL

Cosmic Board for phycore AM335x System on Module and Carrier Board. Application Development User Manual

Linux Kernel and Driver Development Training

Installation Guide for AmiRNA and WMD3 Release 3.1

Connections and wiring Diagram

opensuse for ARM On Your Device Sonntag, 21. Oktober 12

Firebird on Linux. Author: Philippe Makowski IBPhoenix Licence: Public Documentation License Date:

Creating a Custom Linux Kernel and Root File System for the TI OMAP3530 Processor

A technical whitepaper describing steps to setup a Private Cloud using the Eucalyptus Private Cloud Software and Xen hypervisor.

Embedded Asterisk. A Crazy Man s Approach to VoIP. Terry Dunlap. 5/12/2007 terrydunlap.com

SI455 Advanced Computer Networking. Lab2: Adding DNS and Servers (v1.0) Due 6 Feb by start of class

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

HOWTO configure Xinu under Virtual Box

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

Building a Penetration Testing Virtual Computer Laboratory

Utilizing MBARI s Software Infrastructure and Application for MOOS (SIAM) for NOAA s Real-time Environmental Coastal Observing Network (RECON)

BRU Server. Installation and QuickStart Guide Version Manual Revision: PDF

LAMP Quickstart for Red Hat Enterprise Linux 4

SETTING UP RASPBERRY PI FOR TOPPY FTP ACCESS. (Draft 5)

Linux Terminal Server Project

RASPBERRY PI BAT PROJEKT News and Add ons WLAN connection and UMTS (SMS transmission)

LAB THREE STATIC ROUTING

How to Run the MQX RTOS on Various RAM Memories for i.mx 6SoloX

Computer Science and Engineering Linux Cisco VPN Client Installation and Setup Guide

How Do I Recover infiniti Remotes and Line Cards?

Installing Ubuntu on Darwin OP

SendMIME Pro Installation & Users Guide

Support ovirt on Ubuntu

UPSMON PRO Linux --- User Manual

A Look through the Android Stack

The Embedded Linux Quick Start Guide In the Beginning... Embedded Linux Conference Europe 2010

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

How to Backup XenServer VM with VirtualIQ

Embedded Based Web Server for CMS and Automation System

Transcription:

Libre Software Meeting 2012 Buildroot Workshop Thomas Petazzoni Free Electrons thomas.petazzoni@free-electrons.com Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 1/43

Thomas Petazzoni Embedded Linux engineer and trainer at Free Electrons since 2008 Embedded Linux development: kernel and driver development, system integration, boot time and power consumption optimization, consulting, etc. Embedded Linux training, Linux driver development training and Android system development training, with materials freely available under a Creative Commons license. http://www.free-electrons.com Major contributor to Buildroot, an open-source, simple and fast embedded Linux build system Speaker at Embedded Linux Conference, Embedded Linux Conference Europe, FOSDEM, Libre Software Meeting, etc. Living in Toulouse, south west of France Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/43

Agenda Install necessary tools and packages Get Buildroot Build a minimal system, and boot it on the target Customize the system Create new packages, one library, one application Generate an UBIFS image, and flash the system in NAND flash Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/43

Workshop elements You will find the slides and other files needed for this workshop at: http://free-electrons.com/~thomas/lsm-tutorial/ Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/43

Our target platform IGEPv2 from ISEE DM3730 (ARM OMAP3) at 1 GHz 512 MB of RAM, 512 MB of flash microsd, HDMI, audio, Ethernet, Bluetooth, Wifi http://igep.es/products/processor-boards/igepv2-board Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/43

Tools to interact with the target We ll need: A terminal emulator program to interact with the target over the serial port apt-get install picocom A TFTP server to transfer the kernel image to the target apt-get install tftpd-hpa A NFS server to mount the root filesystem over the network apt-get install nfs-kernel-server Of course, adapt those instructions if you re not using a Debian-derived distribution. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/43

Buildroot dependencies Even though Buildroot builds most of the tools it needs, it still requires a few dependencies on the build system: apt-get install \ build-essential gawk bison flex gettext \ texinfo patch gzip bzip2 perl tar wget \ cpio python unzip rsync Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/43

Getting Buildroot Tarballs are available for major versions, but since one generally needs to make changes to Buildroot, using Git is recommended Clone the repository git clone git://git.busybox.net/buildroot Create a branch starting from a stable release git branch workshop 2012.05 Switch to this branch git checkout workshop Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 8/43

Initial configuration Run make menuconfig Target architecture: ARM Little Endian Target architecture variant: Cortex-A8 Toolchain Toolchain type: External toolchain Toolchain: CodeSourcery 2011.09 System configuration /dev management: Dynamic using devtmpfs only Port to run a getty on: ttyo2 Package selection for the target Only Busybox is selected. This is fine for now. Kernel Kernel version: Custom version Kernel version: 3.2 Custom kernel patches: board/lsm/demo/linux-3.2-patches/ Defconfig name: omap2plus Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/43

Kernel patches For this board to work with kernel 3.2, we need two patches to enable NAND support. mkdir -p board/lsm/demo/linux-3.2-patches/ cd board/lsm/demo/linux-3.2-patches/ wget http://free-electrons.com/~thomas/lsm-tutorial/ linux-3.2-arm-omap3-igep0020-add-support-for-micron-nand-flash.patch wget http://free-electrons.com/~thomas/lsm-tutorial/ linux-3.2-omap2-make-board-onenand-init-visible-to-board-code.patch Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 10/43

Running the build Let s run the build, and keep a log from it: make 2>&1 tee logfile Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/43

Build results In the output directory, we have: build, with one subdirectory per package that has been built. The source code of the packages is extracted here, and they are compiled here. host, where host tools are installed. The external toolchain has been extracted in host/opt, in host/usr/bin, you have a few host tools, and in host/usr/arm-unknown-linux-gnueabi/sysroot you have the sysroot staging, symbolic link to the sysroot target, where the target libraries and applications are installed. toolchain, empty because we re using an external toolchain images, which contains the root filesystem as a tarball, and the kernel image. Look at the root filesystem size (it is uncompressed!) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 12/43

A look at the dependencies ALL rootfs-tar linux busybox host-makedevs host-fakeroot host-module-init-tools host-uboot-tools host-automake host-autoconf host-libtool host-m4 Generated with:./support/scripts/graph-depends > deps.dot dot -Tpdf -o deps.pdf deps.dot Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 13/43

Preparing to boot 1. Extract the root filesystem: mkdir /tmp/rootfs/ sudo tar -C /tmp/rootfs/ -xf output/images/rootfs.tar 2. Export it over NFS, add the following line to /etc/exports: /tmp/rootfs/ 192.168.42.2(rw,no_root_squash,no_subtree_check) 3. And restart the NFS server: sudo /etc/init.d/nfs-kernel-server restart 4. Copy the kernel image to the TFTP exported directory: sudo cp output/images/uimage /var/lib/tftpboot/ 5. Configure your system to assign the 192.168.42.1 static IP address to the USB-Ethernet interface (using Network Manager or ifconfig) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 14/43

Connecting the serial cable to the board Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 15/43

Preparing to boot, on the board 1. Start a serial emulator program: picocom -b 115200 /dev/ttyusb0 2. When the board boots, interrupt in U-Boot during Hit any key to stop autoboot: by pressing a key, and enter the following commands: setenv ipaddr 192.168.42.2 setenv serverip 192.168.42.1 setenv bootcmd tftp 80000000 uimage; bootm setenv bootargs console=ttyo2,115200 root=/dev/nfs ip=192.168.42.2 \ nfsroot=192.168.42.1:/tmp/rootfs saveenv reset 3. The system should boot automatically. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 16/43

The system Login as root, no password will be prompted. Explore the system. You ll see that it is fairly minimal. We have: Busybox installed (in /bin, /sbin, /usr/bin, /usr/sbin) The C library in /lib A bunch of configuration files and init scripts in /etc/ /proc and /sys mounted In the running processes, we only have the usual kernel threads, the init process, a shell, and the syslogd/klogd daemons for login For Buildroot, it is important that the default is small Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 17/43

Customize the kernel configuration Let s learn now how to customize the kernel configuration from Buildroot. 1. Run make linux-menuconfig 2. In Device Drivers LED Support, enable as static options (with a *, not a M): LED Class support LED Support for GPIO connected LEDs LED Trigger support LED Timer trigger LED heartbeat trigger 3. Rebuild by running make 4. Copy your kernel image to the TFTP directory: sudo cp output/images/uimage /var/lib/tftpboot/ Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 18/43

Test the LEDs Reboot your system, and try the following commands: cd /sys/class/leds/gpio-led:green:d0 echo 255 > brightness echo 0 > brightness echo timer > trigger echo heartbeat > trigger echo none > trigger Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 19/43

Saving the kernel configuration Our kernel configuration change has only been made to output/build/linux-3.2/.config, which will be removed if we do a make clean, so let s save our kernel configuration changes. 1. Generate a minimal defconfig for our kernel configuration: make linux-savedefconfig 2. Store in our project-specific directory mv output/build/linux-3.2/defconfig board/lsm/demo/linux-3.2.config 3. Adjust the Buildroot configuration: make menuconfig Linux Kernel Kernel configuration Using a custom configuration file Configuration file path: board/lsm/demo/linux-3.2.config Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 20/43

Enabling a new package: Dropbear Let s enable a new package, the lightweight SSH client/server Dropbear. make menuconfig Package selection for the target -> Networking applications -> dropbear Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 21/43

Set root password 1. Create board/lsm/demo/post-build.sh with: #!/bin/sh TARGETDIR=$1 # Set the root password to demo sed -i s%^root::%root:pt41pcobipj3q:% $TARGETDIR/etc/shadow # Disable login with the default user sed -i s/^default::/default:*:/ $TARGETDIR/etc/shadow 2. Add executable permissions to the script 3. In make menuconfig, System configuration Custom script to run before creating filesystem images set board/lsm/demo/post-build.sh. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 22/43

Testing SSH 1. Run make to rebuild your system 2. Re-extract the root filesystem tarball sudo tar -C /tmp/rootfs/ output/images/rootfs.tar 3. Boot your system, you should see Dropbear being started 4. From your machine, log into your board through SSH: ssh root@192.168.42.2 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 23/43

Adding new packages We ll now see how to add new packages, by taking the example of two dummy packages: libfoo, a dummy library that implements just a int foo_add(int a, int b); function. Available at http://free-electrons.com/~thomas/lsmtutorial/libfoo-0.1.tar.gz foo, a dummy application that uses libfoo Available at http://free-electrons.com/~thomas/lsmtutorial/foo-0.1.tar.gz Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 24/43

libfoo: Config.in Create the package/libfoo directory, and edit package/libfoo/config.in: config BR2_PACKAGE_LIBFOO bool "libfoo" help libfoo is a wonderful package. http://free-electrons.com/~thomas/lsm-tutorial/ Then, edit package/config.in, and under Libraries Other, add: source "package/libfoo/config.in" Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 25/43

libfoo: package/libfoo/libfoo.mk Download the package tarball, and quickly study its build system. It uses the traditional./configure; make; make install mechanism, using the autotools. We ll use the AUTOTARGETS infrastructure for our package. LIBFOO_VERSION = 0.1 LIBFOO_SITE = http://free-electrons.com/~thomas/lsm-tutorial/ $(eval $(call AUTOTARGETS)) LIBFOO_SOURCE could be defined to libfoo-$(libfoo_version).tar.gz, but since this is the default, there s no need to mention it. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/43

libfoo: first test 1. Enable your package in make menuconfig 2. Run make 3. Your library is correctly present in output/target/usr/lib/libfoo.so.0.1 4. But the header files, and other developments files, are not present in output/staging/usr/include/libfoo Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 27/43

libfoo: installation to staging For libraries, we need to explicitly tell Buildroot to install them to the staging directory. LIBFOO_VERSION = 0.1 LIBFOO_SITE = http://free-electrons.com/~thomas/lsm-tutorial/ LIBFOO_INSTALL_STAGING = YES $(eval $(call AUTOTARGETS)) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 28/43

libfoo: second testing 1. make libfoo-dirclean 2. make 3. Check in output/staging/usr/include/libfoo that the header file is installed. 4. You should also have the static version of the library in output/staging/usr/lib/ and the pkgconfig file foo.pc in output/staging/usr/lib/pkgconfig Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 29/43

libfoo: adding a configuration option (1/2) Our wonderful libfoo library supports one./configure option: --enable-debug. Let s add a new Buildroot option for it. In package/libfoo/config.in, add: config BR2_PACKAGE_LIBFOO_DEBUG bool "Enable debugging support" depends on BR2_PACKAGE_LIBFOO help Enable debugging support in libfoo. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 30/43

libfoo: adding a configuration option (2/2) In the package/libfoo/libfoo.mk: ifeq ($(BR2_PACKAGE_LIBFOO_DEBUG),y) LIBFOO_CONF_OPT += --enable-debug endif In menuconfig, enable your new option Run make libfoo-dirclean to clean the package and force its rebuild Run make Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 31/43

foo: package/foo/config.in Now, let s create a package for the application. First the package/foo/config.in file: config BR2_PACKAGE_FOO bool "foo" select BR2_PACKAGE_LIBFOO help Wonderful foo application http://free-electrons.com/~thomas/lsm-tutorial/ And source it from the Miscellaneous section of package/config.in: source "package/foo/config.in" Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 32/43

foo: package/foo/foo.mk Before writing the foo.mk, let s download http://freeelectrons.com/~thomas/lsm-tutorial/foo-0.1.tar.gz and look at its build system: It is based on a manual Makefile, so we will have to use the GENTARGETS infrastructure and not the AUTOTARGETS one It uses pkg-config to find the library foo. So we will have to depend on libfoo and host-pkg-config For the build, we will have to pass CC, CFLAGS, LDFLAGS, etc. with appropriate values. To do this, we ll use the Buildroot variable TARGET_CONFIGURE_OPTS For the installation, we ll have to pass value for the DESTDIR and prefix variables Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 33/43

foo: package/foo/foo.mk FOO_VERSION = 0.1 FOO_SITE = http://free-electrons.com/~thomas/lsm-tutorial/ FOO_DEPENDENCIES += libfoo host-pkg-config define FOO_BUILD_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) endef define FOO_INSTALL_TARGET_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) \ DESTDIR=$(TARGET_DIR) \ prefix=/usr \ install -C $(@D) endef $(eval $(call GENTARGETS)) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 34/43

Test foo Enable the foo package in menuconfig Build your system with make Re-extract the root filesystem tarball to /tmp/rootfs/ Reboot your system, and test the new foo application Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 35/43

Save our configuration In order to make our configuration usable by others, we ll create a defconfig from it: make savedefconfig mv defconfig configs/lsm_demo_defconfig Now, users of your Buildroot can simply do: make lsm_demo_defconfig make To rebuild an identical environment from scratch. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 36/43

Booting from flash We know want to store the kernel and root filesystem in NAND flash. To do this, we will: 1. Add a custom /etc/network/interfaces file to the filesystem in order to not depend on the ip= kernel parameter 2. Configure Buildroot to generate an UBIFS/UBI image for the root filesystem 3. Adjust the U-Boot configuration and kernel arguments to boot from NAND flash. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 37/43

Custom /etc/network/interfaces 1. Create the board/lsm/demo/rootfs-additions directory, which will be an overlay of our filesystem 2. In our post-build.sh script, add: # Copy the rootfs additions cp -a board/lsm/demo/rootfs-additions/* $TARGETDIR/ 3. Create the board/lsm/demo/rootfsadditions/etc/network/interfaces file, with: auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.42.2 netmask 255.255.255.0 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 38/43

Generate an UBIFS/UBI image In menuconfig 1. Go in the Filesystem images menu 2. Enable ubifs root filesystem 3. Enable Embed into an UBI image Then, rebuild with make, and copy output/images/rootfs.ubi to /var/lib/tftpboot. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 39/43

Adjust U-Boot configuration We will adjust the U-Boot environment variables. Kernel command line setenv bootargs console=ttyo2,115200 mtdparts=omap2-nand.0:512k(xloader),1536k(uboot),512k(env),4m(kernel),16m(rootfs) ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs At boot time, load the kernel from NAND setenv bootcmd nboot 80000000 0 280000; bootm Helper script to flash the kernel in NAND setenv flashkernel tftp 80000000 uimage; nand erase 0x280000 0x400000; nand write 0x80000000 0x280000 0x400000 Helper script to flash the rootfs in NAND setenv flashrootfs tftp 80000000 rootfs.ubi; nand erase 0x680000 0x1000000; nand write 0x80000000 0x680000 ${filesize} Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 40/43

Adjust U-Boot configuration We will adjust the U-Boot environment variables. Helper script to flash the kernel and rootfs setenv flashall run flashkernel; run flashrootfs Reflash run flashall And reboot to test the system reset Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 41/43

A final look at the dependencies ALL rootfs-ubi foo busybox dropbear rootfs-tar rootfs-ubifs libfoo host-makedevs host-fakeroot host-mtd host-lzo host-zlib linux host-e2fsprogs host-module-init-tools host-uboot-tools host-pkg-config host-automake host-autoconf host-m4 host-libtool Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 42/43

Thanks for attending, have fun with Buildroot! Thomas Petazzoni thomas.petazzoni@free-electrons.com Slides under CC-BY-SA 3.0. PDF and sources will be available on http://free-electrons.com/pub/conferences/2012/lsm/ Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 43/43