SlideShare a Scribd company logo
Getting started with Buildroot - Lab
Trevor Woerner, Togán Labs
March 13, 2019
These lab instructions are written for the Getting started with Buildroot tutorial of the Embedded Ap-
prentice Linux Engineer track. They are designed to work for the PocketBeagle hardware platform.
This lab is broken out into two separate paths:
• Basic Lab
• In-Depth Lab
Both labs start with the same resources, and both end up creating the same artifacts, but they both
take different routes. If you would like to get an image up-and-running on your board without
worrying too much about the details, take a look at the Basic Lab. If you’d like to know a little
more about what’s going on "under the hood", try the In-Depth Lab.
Both labs start with the same Initial Setup.
All the work for these labs occur on the host computer, not the target. A reasonably recent Linux
machine/VM is required for this work.
Initial Setup
Our first step is to obtain the buildroot meta-data. Normally this would be done by simply cloning
from buildroot’s git repository. But I’ve created a simple fork of upstream that contains little
tweaks to make this lab easier.
Therefore start by grabbing a tarball of this lab’s buildroot and unpacking it. Then, move into the
top-level directory of the unpacked tarball.
$ wget https://cm.e-ale.org/2019/SCaLE17x/buildroot/buildroot-e-ale.tar.xz
$ xz -d < buildroot-e-ale.tar.xz | tar xf -
$ cd buildroot-e-ale
If downloading buildroot-e-ale.tar.xz is taking too long, you can also run these exercises
with the buildroot-e-ale_SM.tar.xz tarball. But then your build will be slower.
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
1
Basic Lab
A great place to start with any project is from a known location. In this case our buildroot already
knows what a pocketbeagle is, so we simply tell buildroot we want to build a basic image for this
board, then go ahead and build it.
$ make pocketbeagle_defconfig
$ make
The build will take a while (15 - 30 minutes, perhaps more depending on the speed of your Inter-
net connection or on the capabilities of your host machine).
Now jump ahead all the way to the Testing The Build section.
In-Depth Lab
What if buildroot didn’t know what a pocketbeagle is? In this lab we’re going to configure our
pocketbeagle build from scratch.
Creating a minimal configuration
We start by configuring our build:
$ make menuconfig
In the configuration, we’ll have to customize a number of options, as detailed below. Of course,
take this opportunity to navigate in all the options, and discover what Buildroot can do.
• In Target options
– Change Target architecture to ARM (little endian)
– Change Target architecture variant to Cortex-A8
• In Build options
– set global patch directories to board/pocketbeagle/patches/. This will allow us to
put patches for Linux, U-Boot other packages in subdirectories of board/pocketbeagle/
patches/.
• In Toolchain
– Change Toolchain type to External toolchain. By default, Buildroot builds its own toolchain,
but it can also use pre-built external toolchain. We’ll use the latter, in order to save build
time.
• In System configuration
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
2
– you can customize the System host name and System banner if you wish. Keep the default
values for the rest.
• In Kernel
– Enable the Linux kernel, obviously!
– Patches will already be applied to the kernel, thanks to us having defined a global patch
directory above.
– Choose omap2plus as the Defconfig name
– We’ll need the Device Tree of the PocketBeagle, so enable Build a Device Tree Blob (DTB)
– And use am335x-pocketbeagle as the Device Tree Source file names
• In Target packages
– we’ll keep just Busybox enabled for now. In the next sections, we’ll enable more pack-
ages.
• In Filesystem images
– enable ext2/3/4 root filesystem
– select the ext4 variant
– you can also disable the tar filesystem image, which we won’t need.
• In Bootloaders
– enable U-Boot, and in U-Boot:
∗ Switch the Build system option to Kconfig: we are going to use a modern U-Boot, so
let’s take advantage of its modern build system!
∗ Keep version 2018.01
∗ set Custom U-Boot patches to board/pocketbeagle/patches/u-boot
∗ Use am335x_pocketbeagle as the Board defconfig
∗ The U-Boot binary format should be changed from u-boot.bin to u-boot.img.
Indeed, this second stage bootloader will be loaded by a first stage bootloader, and
needs to have the proper header to be loaded by the first stage.
∗ Enable Install U-Boot SPL binary image to also install the first stage bootloader. Its
name in U-Boot SPL/TPL binary image name(s) should be changed to MLO since that’s
how U-Boot names it, and how the AM335x expects it to be named.
Running the build
To start the build, you can run just make. But it’s often convenient to keep the build output in a
log file, so you can do:
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
3
$ make 2>&1 | tee build.log
or alternatively use a wrapper script provided by Buildroot:
$ ./utils/brmake
The build will take a while.
The overall build takes quite some time, because the Linux kernel configuration omap2plus_
defconfig, which supports all OMAP2, OMAP3, OMAP4 and AM335x platforms has a lot of
drivers and options enabled. It would definitely be possible to make a smaller kernel configura-
tion for the Pocket Beagle, reducing the kernel size and boot time.
At the end of the build, the output is located in output/images. We have:
• MLO, the first stage bootloader
• u-boot.img, the second stage bootloader
• zImage, the Linux kernel image
• am335x-pocketbeagle.dtb, the Linux kernel Device Tree Blob
• rootfs.ext4, the root filesystem image
However, that doesn’t immediately give us a bootable SD card image. We could create it man-
ually, but that wouldn’t be really nice. So move on to the next section to see how Buildroot can
create the SD card image for you.
Creating a SD card image
To create a SD card image, we’ll use a tool called genimage, which provided a configuration file,
will output the image of a block device, with multiple partitions, each containing a filesystem.
See https://git.pengutronix.de/cgit/genimage/tree/README.rst for some docu-
mentation about genimage and its configuration file format.
genimage needs to be called at the very end of the build. To achieve this, Buildroot provides a
mechanism called post-image scripts, which are arbitrary scripts called at the end of the build. We
will use it to create a SD card image with:
• A FAT partition containing the bootloader images, the kernel image and Device Tree
• An ext4 partition containing the root filesystem
In addition, the U-Boot bootloader for the PocketBeagle is configured by default to load a file called
uEnv.txt to indicate what should be done at boot time. This file should also be stored in the first
partition of the SD card.
So, go back to make menuconfig, and adjust the following options:
• In System configuration
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
4
– Set Custom scripts to run after creating filesystem images to board/pocketbeagle/
post-image.sh
• In Host utilities
– enable
∗ host dosfstools
∗ host genimage
∗ host mtools
mtools and dosfstools are needed because our genimage configuration includes the cre-
ation of a FAT partition.
Restart the build again. Once the build is finished, you should now have a sdcard.img file in
output/images/.
Storing our Buildroot configuration
Our Buildroot configuration is currently stored as .config, which is not under version control
and would be removed by a make distclean. So, let’s store it as a defconfig file:
$ make BR2_DEFCONFIG=configs/eale_pocketbeagle_defconfig savedefconfig
And then look at configs/eale_pocketbeagle_defconfig to see what your configuration
looks like.
Testing The Build
Working through either lab, if successful, you should find your *.img file waiting for you at
output/sdcard.img.
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
5
Using Etcher or dd, flash this image to your SDcard. Insert the SDcard into your PocketBeagle
and apply power. Ideally you’ll have a serial console setup (i.e. minicom or screen) so you can
watch the progress.
Embedded Apprentice Linux Engineer - Getting started with Buildroot -
https://www.toganlabs.com
6

More Related Content

What's hot

Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
Puppet
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
Cumulus Networks
 
Light my-fuse
Light my-fuseLight my-fuse
Light my-fuse
Workhorse Computing
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Pierre-jean Texier
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
Hao-Ran Liu
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linux
TRCK
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
PASCAL Jean Marie
 
Develop and deploy haskell with docker
Develop and deploy haskell with dockerDevelop and deploy haskell with docker
Develop and deploy haskell with docker
Chris Biscardi
 
Elephant bird build Error
Elephant bird build ErrorElephant bird build Error
Elephant bird build Error
Kapil Dewade
 
Lab manual
Lab manualLab manual
Lab manual
BNilavara
 
Linux day 2016 Yocto Project
Linux day 2016 Yocto ProjectLinux day 2016 Yocto Project
Linux day 2016 Yocto Project
Marco Cavallini
 
Building RT image with Yocto
Building RT image with YoctoBuilding RT image with Yocto
Building RT image with Yocto
Alexandre LAHAYE
 
Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014
Pebble Technology
 
Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners
Shilpa Hemaraj
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet
 
CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지
충섭 김
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
Ankit Desai
 
Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
C4Media
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
Vinay Jindal
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
Panoptic Development, Inc.
 

What's hot (20)

Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
 
Light my-fuse
Light my-fuseLight my-fuse
Light my-fuse
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linux
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 
Develop and deploy haskell with docker
Develop and deploy haskell with dockerDevelop and deploy haskell with docker
Develop and deploy haskell with docker
 
Elephant bird build Error
Elephant bird build ErrorElephant bird build Error
Elephant bird build Error
 
Lab manual
Lab manualLab manual
Lab manual
 
Linux day 2016 Yocto Project
Linux day 2016 Yocto ProjectLinux day 2016 Yocto Project
Linux day 2016 Yocto Project
 
Building RT image with Yocto
Building RT image with YoctoBuilding RT image with Yocto
Building RT image with Yocto
 
Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014
 
Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker container
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 

Similar to Getting Started with Buildroot - Lab

Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
Sourabh Singh Tomar
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Sourabh Singh Tomar
 
BeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream ComponentsBeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream Components
GlobalLogic Ukraine
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
Mender.io
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
Sathish VJ
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
Yen-Chin Lee
 
Ansible container
Ansible containerAnsible container
Ansible container
Scott van Kalken
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
Scott Garman
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
Philip Polstra
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilation
Ganesh Chavan
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
Otavio Salvador
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
Jian-Hong Pan
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
wonyong hwang
 
Getting Started with Docker
Getting Started with Docker Getting Started with Docker
Getting Started with Docker
Anup Segu
 
Ci for android OS
Ci for android OSCi for android OS
Ci for android OS
Jarek Potiuk
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Marco Cavallini
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
Emertxe Information Technologies Pvt Ltd
 
Linux kernel
Linux kernelLinux kernel
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Stanislav Pogrebnyak
 
Docker on a Diet
Docker on a DietDocker on a Diet
Docker on a Diet
Kuan Yen Heng
 

Similar to Getting Started with Buildroot - Lab (20)

Crafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using BuilrootCrafting GNU/ linux distributions for embedded target using Builroot
Crafting GNU/ linux distributions for embedded target using Builroot
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
 
BeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream ComponentsBeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream Components
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
Ansible container
Ansible containerAnsible container
Ansible container
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilation
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Getting Started with Docker
Getting Started with Docker Getting Started with Docker
Getting Started with Docker
 
Ci for android OS
Ci for android OSCi for android OS
Ci for android OS
 
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKYocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Docker on a Diet
Docker on a DietDocker on a Diet
Docker on a Diet
 

More from Trevor Woerner

Sensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiSensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPi
Trevor Woerner
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-on
Trevor Woerner
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-On
Trevor Woerner
 
GSoC/EVoC Overview
GSoC/EVoC OverviewGSoC/EVoC Overview
GSoC/EVoC Overview
Trevor Woerner
 
Getting Started with Buildroot
Getting Started with BuildrootGetting Started with Buildroot
Getting Started with Buildroot
Trevor Woerner
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
Trevor Woerner
 
OE Hands-On
OE Hands-OnOE Hands-On
OE Hands-On
Trevor Woerner
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
Trevor Woerner
 

More from Trevor Woerner (8)

Sensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiSensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPi
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-on
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-On
 
GSoC/EVoC Overview
GSoC/EVoC OverviewGSoC/EVoC Overview
GSoC/EVoC Overview
 
Getting Started with Buildroot
Getting Started with BuildrootGetting Started with Buildroot
Getting Started with Buildroot
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
 
OE Hands-On
OE Hands-OnOE Hands-On
OE Hands-On
 
Using OpenEmbedded
Using OpenEmbeddedUsing OpenEmbedded
Using OpenEmbedded
 

Recently uploaded

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 

Recently uploaded (20)

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 

Getting Started with Buildroot - Lab

  • 1. Getting started with Buildroot - Lab Trevor Woerner, Togán Labs March 13, 2019 These lab instructions are written for the Getting started with Buildroot tutorial of the Embedded Ap- prentice Linux Engineer track. They are designed to work for the PocketBeagle hardware platform. This lab is broken out into two separate paths: • Basic Lab • In-Depth Lab Both labs start with the same resources, and both end up creating the same artifacts, but they both take different routes. If you would like to get an image up-and-running on your board without worrying too much about the details, take a look at the Basic Lab. If you’d like to know a little more about what’s going on "under the hood", try the In-Depth Lab. Both labs start with the same Initial Setup. All the work for these labs occur on the host computer, not the target. A reasonably recent Linux machine/VM is required for this work. Initial Setup Our first step is to obtain the buildroot meta-data. Normally this would be done by simply cloning from buildroot’s git repository. But I’ve created a simple fork of upstream that contains little tweaks to make this lab easier. Therefore start by grabbing a tarball of this lab’s buildroot and unpacking it. Then, move into the top-level directory of the unpacked tarball. $ wget https://cm.e-ale.org/2019/SCaLE17x/buildroot/buildroot-e-ale.tar.xz $ xz -d < buildroot-e-ale.tar.xz | tar xf - $ cd buildroot-e-ale If downloading buildroot-e-ale.tar.xz is taking too long, you can also run these exercises with the buildroot-e-ale_SM.tar.xz tarball. But then your build will be slower. Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 1
  • 2. Basic Lab A great place to start with any project is from a known location. In this case our buildroot already knows what a pocketbeagle is, so we simply tell buildroot we want to build a basic image for this board, then go ahead and build it. $ make pocketbeagle_defconfig $ make The build will take a while (15 - 30 minutes, perhaps more depending on the speed of your Inter- net connection or on the capabilities of your host machine). Now jump ahead all the way to the Testing The Build section. In-Depth Lab What if buildroot didn’t know what a pocketbeagle is? In this lab we’re going to configure our pocketbeagle build from scratch. Creating a minimal configuration We start by configuring our build: $ make menuconfig In the configuration, we’ll have to customize a number of options, as detailed below. Of course, take this opportunity to navigate in all the options, and discover what Buildroot can do. • In Target options – Change Target architecture to ARM (little endian) – Change Target architecture variant to Cortex-A8 • In Build options – set global patch directories to board/pocketbeagle/patches/. This will allow us to put patches for Linux, U-Boot other packages in subdirectories of board/pocketbeagle/ patches/. • In Toolchain – Change Toolchain type to External toolchain. By default, Buildroot builds its own toolchain, but it can also use pre-built external toolchain. We’ll use the latter, in order to save build time. • In System configuration Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 2
  • 3. – you can customize the System host name and System banner if you wish. Keep the default values for the rest. • In Kernel – Enable the Linux kernel, obviously! – Patches will already be applied to the kernel, thanks to us having defined a global patch directory above. – Choose omap2plus as the Defconfig name – We’ll need the Device Tree of the PocketBeagle, so enable Build a Device Tree Blob (DTB) – And use am335x-pocketbeagle as the Device Tree Source file names • In Target packages – we’ll keep just Busybox enabled for now. In the next sections, we’ll enable more pack- ages. • In Filesystem images – enable ext2/3/4 root filesystem – select the ext4 variant – you can also disable the tar filesystem image, which we won’t need. • In Bootloaders – enable U-Boot, and in U-Boot: ∗ Switch the Build system option to Kconfig: we are going to use a modern U-Boot, so let’s take advantage of its modern build system! ∗ Keep version 2018.01 ∗ set Custom U-Boot patches to board/pocketbeagle/patches/u-boot ∗ Use am335x_pocketbeagle as the Board defconfig ∗ The U-Boot binary format should be changed from u-boot.bin to u-boot.img. Indeed, this second stage bootloader will be loaded by a first stage bootloader, and needs to have the proper header to be loaded by the first stage. ∗ Enable Install U-Boot SPL binary image to also install the first stage bootloader. Its name in U-Boot SPL/TPL binary image name(s) should be changed to MLO since that’s how U-Boot names it, and how the AM335x expects it to be named. Running the build To start the build, you can run just make. But it’s often convenient to keep the build output in a log file, so you can do: Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 3
  • 4. $ make 2>&1 | tee build.log or alternatively use a wrapper script provided by Buildroot: $ ./utils/brmake The build will take a while. The overall build takes quite some time, because the Linux kernel configuration omap2plus_ defconfig, which supports all OMAP2, OMAP3, OMAP4 and AM335x platforms has a lot of drivers and options enabled. It would definitely be possible to make a smaller kernel configura- tion for the Pocket Beagle, reducing the kernel size and boot time. At the end of the build, the output is located in output/images. We have: • MLO, the first stage bootloader • u-boot.img, the second stage bootloader • zImage, the Linux kernel image • am335x-pocketbeagle.dtb, the Linux kernel Device Tree Blob • rootfs.ext4, the root filesystem image However, that doesn’t immediately give us a bootable SD card image. We could create it man- ually, but that wouldn’t be really nice. So move on to the next section to see how Buildroot can create the SD card image for you. Creating a SD card image To create a SD card image, we’ll use a tool called genimage, which provided a configuration file, will output the image of a block device, with multiple partitions, each containing a filesystem. See https://git.pengutronix.de/cgit/genimage/tree/README.rst for some docu- mentation about genimage and its configuration file format. genimage needs to be called at the very end of the build. To achieve this, Buildroot provides a mechanism called post-image scripts, which are arbitrary scripts called at the end of the build. We will use it to create a SD card image with: • A FAT partition containing the bootloader images, the kernel image and Device Tree • An ext4 partition containing the root filesystem In addition, the U-Boot bootloader for the PocketBeagle is configured by default to load a file called uEnv.txt to indicate what should be done at boot time. This file should also be stored in the first partition of the SD card. So, go back to make menuconfig, and adjust the following options: • In System configuration Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 4
  • 5. – Set Custom scripts to run after creating filesystem images to board/pocketbeagle/ post-image.sh • In Host utilities – enable ∗ host dosfstools ∗ host genimage ∗ host mtools mtools and dosfstools are needed because our genimage configuration includes the cre- ation of a FAT partition. Restart the build again. Once the build is finished, you should now have a sdcard.img file in output/images/. Storing our Buildroot configuration Our Buildroot configuration is currently stored as .config, which is not under version control and would be removed by a make distclean. So, let’s store it as a defconfig file: $ make BR2_DEFCONFIG=configs/eale_pocketbeagle_defconfig savedefconfig And then look at configs/eale_pocketbeagle_defconfig to see what your configuration looks like. Testing The Build Working through either lab, if successful, you should find your *.img file waiting for you at output/sdcard.img. Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 5
  • 6. Using Etcher or dd, flash this image to your SDcard. Insert the SDcard into your PocketBeagle and apply power. Ideally you’ll have a serial console setup (i.e. minicom or screen) so you can watch the progress. Embedded Apprentice Linux Engineer - Getting started with Buildroot - https://www.toganlabs.com 6