SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsCumulus Networks
 
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 modulesHao-Ran Liu
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linuxTRCK
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationPASCAL Jean Marie
 
Develop and deploy haskell with docker
Develop and deploy haskell with dockerDevelop and deploy haskell with docker
Develop and deploy haskell with dockerChris Biscardi
 
Elephant bird build Error
Elephant bird build ErrorElephant bird build Error
Elephant bird build ErrorKapil Dewade
 
Linux day 2016 Yocto Project
Linux day 2016 Yocto ProjectLinux day 2016 Yocto Project
Linux day 2016 Yocto ProjectMarco Cavallini
 
Building RT image with Yocto
Building RT image with YoctoBuilding RT image with Yocto
Building RT image with YoctoAlexandre LAHAYE
 
Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Overlay & Libraries | Pebble Meetup Oct. 2014
Overlay & Libraries | Pebble Meetup Oct. 2014Pebble 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 installationAnkit 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 VirtualizationC4Media
 
Using cgroups in docker container
Using cgroups in docker containerUsing cgroups in docker container
Using cgroups in docker containerVinay Jindal
 

Mais procurados (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
 

Semelhante a 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 BuilrootSourabh 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/SourceSourabh 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 ComponentsGlobalLogic 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 devicesMender.io
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopSathish 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 projectYen-Chin Lee
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012Philip Polstra
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio 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 SystemJian-Hong Pan
 
Getting Started with Docker
Getting Started with Docker Getting Started with Docker
Getting Started with Docker Anup Segu
 
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 eSDKMarco Cavallini
 

Semelhante a 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
 

Mais de Trevor Woerner

Sensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiSensing Temperature with a RaspberryPi
Sensing Temperature with a RaspberryPiTrevor Woerner
 
Yocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onYocto Project Kernel Lab hands-on
Yocto Project Kernel Lab hands-onTrevor Woerner
 
Yocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnYocto Project Kernel Lab, Hands-On
Yocto Project Kernel Lab, Hands-OnTrevor Woerner
 
Getting Started with Buildroot
Getting Started with BuildrootGetting Started with Buildroot
Getting Started with BuildrootTrevor Woerner
 

Mais de 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
 

Último

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Último (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

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