SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
Linux Conf Australia 2014
Buildroot: building
embedded Linux
systems made easy!
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/29
Thomas Petazzoni
CTO and embedded Linux engineer at
Free Electrons
Embedded Linux expertise
Development, consulting and training
Strong open-source focus
Embedded Linux
Developers
Free Electrons
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
Thomas Petazzoni
CTO and embedded Linux engineer at
Free Electrons
Open-source contributor
Contributing the kernel support for
Marvell ARM processors
Major contributor to Buildroot, 1600+
patches contributed
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
Thomas Petazzoni
CTO and embedded Linux engineer at
Free Electrons
Open-source contributor
Living in Toulouse, south west of France
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
Embedded ?
These days, when you say embedded, most people think:
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
Embedded ?
These days, when you say embedded, most people think:
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
Embedded ?
These days, when you say embedded, most people think:
Powerful dual/quad ARM/x86 processor
Several GBs of RAM
Dozens of GBs of storage
Full-featured, general-purpose operating system (Android)
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
Embedded ?
But there are much more embedded systems than just phones and
tablets:
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
Embedded ?
But there are much more embedded systems than just phones and
tablets:
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
Embedded ?
But there are much more embedded systems than just phones and
tablets:
Very application-specific →
need a custom Linux system
Less powerful CPUs,
sometimes specialized CPU
architectures
Less RAM (a few dozen to a
few hundred MBs)
Less storage
Long life-time and
maintenance period
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
Building an embedded Linux system
+ Readily available
- Large, usually 100+ MB
- Not available for all architectures
- Not easy to customize
- Generally require native compilation
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
Building an embedded Linux system
+ Smaller and flexible
- Very hard to handle cross-compilation and dependencies
- Not reproducible
- No benefit from other people’s work
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
Building an embedded Linux system
+ Small and flexible
+ Reproducible, handles cross-compilation and dependencies
+ Available for virtually all architectures
- One tool to learn
- Build time
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
Embedded Linux build system: principle
Building from source → lot of flexibility
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
Embedded Linux build system: principle
Building from source → lot of flexibility
Cross-compilation → leveraging fast build machines
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
Embedded Linux build system: principle
Building from source → lot of flexibility
Cross-compilation → leveraging fast build machines
Recipes for building components → easy
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
Embedded Linux build system: tools
A wide range of solutions: Yocto/OpenEmbedded, PTXdist,
Buildroot, LTIB, OpenBricks, OpenWRT, and more.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
Embedded Linux build system: tools
A wide range of solutions: Yocto/OpenEmbedded, PTXdist,
Buildroot, LTIB, OpenBricks, OpenWRT, and more.
Today, two solutions are emerging as the most popular ones
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
Embedded Linux build system: tools
A wide range of solutions: Yocto/OpenEmbedded, PTXdist,
Buildroot, LTIB, OpenBricks, OpenWRT, and more.
Today, two solutions are emerging as the most popular ones
Yocto/OpenEmbedded
Builds a complete Linux distribution with binary packages.
Powerful, but somewhat complex, and quite steep learning
curve.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
Embedded Linux build system: tools
A wide range of solutions: Yocto/OpenEmbedded, PTXdist,
Buildroot, LTIB, OpenBricks, OpenWRT, and more.
Today, two solutions are emerging as the most popular ones
Yocto/OpenEmbedded
Builds a complete Linux distribution with binary packages.
Powerful, but somewhat complex, and quite steep learning
curve.
Buildroot
Builds a root filesystem image, no binary packages. Much
simpler to use, understand and modify.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
Buildroot at a glance
Can build a toolchain, a rootfs, a kernel, a bootloader
Easy to configure: menuconfig, xconfig, etc.
Fast: builds a simple root filesystem in a few minutes
Easy to understand: written in make, extensive documentation
Small root filesystem, starting at 2 MB
More than 1000 packages for userspace libraries/apps
available
Many architectures supported
Well-known technologies : make and kconfig
Vendor neutral
Active community, regular releases
http://buildroot.org
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 8/29
Who’s using Buildroot?
System makers
Google
Barco
Rockwell Collins
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
Who’s using Buildroot?
System makers
Google
Barco
Rockwell Collins
Processor vendors
Analog Devices
Imagination Technologies
Marvell
Atmel
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
Who’s using Buildroot?
System makers
Google
Barco
Rockwell Collins
Processor vendors
Analog Devices
Imagination Technologies
Marvell
Atmel
Many, many hobbyists on
development boards: Rasberry Pi,
BeagleBone Black, etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
Getting started
git clone git://git.busybox.net/buildroot
cd buildroot
make menuconfig
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 10/29
Buildroot configuration
1. Target architecture
Architecture
ARC, ARM, AArch64, AVR32,
Blackfin, Microblaze, MIPS, NIOS II,
PowerPC, SuperH, SPARC, x86,
x86 64, Xtensa
Specific processor
ABI
Floating point strategy
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
Download directory
Number of parallel jobs
Use of ccache
Shared or static libraries
etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
Buildroot toolchain
Buildroot builds the toolchain
uClibc, glibc, eglibc
External toolchain
Uses a pre-built toolchain
Profiles for existing popular
toolchains
Linaro, Sourcery CodeBench,
Analog Devices, etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
Init system to use: Busybox,
Sysvinit, Systemd
/dev management solution: static,
devtmpfs, mdev, udev
Hostname, password, getty
terminal, etc.
Custom post build and post image
scripts
etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
Kernel source (stable version, Git
tree, patches)
Kernel configuration
Support for RTAI and Xenomai
real-time extensions
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
More than 1000 packages
Qt4, Qt5, X.org, Gtk, EFL
GStreamer, ffmpeg
Python, Perl, Ruby, Lua
Samba, OpenSSL, OpenSSH,
dropbear, lighttpd
OpenGL support for various
platforms
And many, many more libraries and
utilities
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
Major filesystem formats supported
cloop
cpio, for kernel initramfs
cramfs
ext2/3/4
jffs2
romfs
squashfs
tar
ubifs
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
8. Bootloaders
Grub
Syslinux
U-Boot
Barebox
and more platform-specific
bootloaders: imx-bootlets,
at91bootstrap, etc.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Buildroot configuration
1. Target architecture
2. Build options
3. Toolchain
4. System configuration
5. Kernel
6. Target packages
7. Filesystem images
8. Bootloaders
9. Host utilities
Allows to build some native tools,
useful for development.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
Example configuration
BR2_arm=y
BR2_arm1176jzf_s=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_GENERIC_GETTY_PORT="tty1"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/raspberrypi/linux.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="75d03120bc36b1cc3166973b8edc11f033ab7c0d"
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi_quick"
BR2_LINUX_KERNEL_ZIMAGE=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_I2C_TOOLS=y
BR2_PACKAGE_RPI_USERLAND=y
BR2_PACKAGE_LIBCOFI=y
BR2_PACKAGE_DROPBEAR=y
BR2_PACKAGE_LIGHTTPD=y
BR2_PACKAGE_TVHEADEND=y
ARM1176 platform, external
toolchain
Rasberry-Pi kernel
Rasberry-Pi firmware
lighttpd web server
tvheadend streaming server
dropbear SSH server
I2C tools
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 12/29
Building and using
To start the build: make
Results in output/images:
rootfs.tar, root filesystem in tar format
rootfs.ubi, root filesystem in UBI format
uImage, Linux kernel image
u-boot.bin, U-Boot bootloader image
Ready to be flashed on your embedded system.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 13/29
Exploring the build output
All the output produced by Buildroot is stored in output/
Can be customized using O= for out-of-tree build
output/ contains
output/build, with one sub-directory for the source code of
each component
output/host, which contains all native utilities needed for the
build, including the cross-compiler
output/host/usr/<tuple>/sysroot, which contains all the
headers and libraries built for the target
output/target, which contains almost the target root
filesystem
output/images, the final images
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 14/29
Summarized build process
1. Copies the rootfs skeleton to target/
2. Takes care of the cross-compilation toolchain
internal toolchain: Downloads, patches, configures, builds
and installs binutils, gcc, C library and the necessary
dependencies
external toolchain: Copy the necessary bits of the toolchain
into Buildroot output directory.
3. For each selected package, after taking care of its
dependencies: download, extract, patch, configure, build,
install
To target/ for target apps and libs
To host/usr/<tuple>/sysroot for target libs
To host/ for native apps and libs
4. Generate the root filesystem image
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 15/29
Real-world example 1
The device is an ARM AT91-based platform with GPS, RFID
readers, GSM modem, Ethernet and USB.
The Buildroot configuration:
CodeSourcery ARM glibc toolchain
Linux kernel
BusyBox for the basic system
Dropbear for SSH access (debugging)
Qt with only QtCore, QtNetwork and QtXml, no GUI
QExtSerialPort
zlib, libxml2, logrotate, pppd, strace, a special RFID library,
popt library
The Qt application
JFFS2 root filesystem
Filesystem size: 11 MB. Could be reduced by using uClibc.
Build time: 10 minutes on a fast build server (quad-core i7,
12 GB of RAM)
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 16/29
Real-world example 2
An x86-based system, with an OpenGL application for vehicle
navigation system.
External glibc toolchain generated with crosstool-NG
The Grub bootloader
Linux kernel, of course
BusyBox
A large part of the X.org stack (the server, a few drivers, and
some client libraries), including libdrm, Mesa
The fglrx ATI proprietary OpenGL driver
ALSA utils, ALSA library, V4L library, Flashrom, LM Sensors,
Lua, Dropbear, Ethtool
The OpenGL application and its data
Filesystem size: 95 MB, with 10 MB of application (binary +
data) and 45 MB (!) of fglrx driver.
Build time: 27 minutes on a fast build server (quad-core i7,
12 GB of RAM)
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 17/29
Customizing the build
Besides the existing packages, there are multiple ways to customize
the generated root filesystem:
Create custom post-build and/or post-image scripts
Use a root filesystem overlay, recommended to add all your
config files
Add your own packages
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 18/29
Adding a new package: Config.in (1/2)
package/libmicrohttpd/Config.in
config BR2_PACKAGE_LIBMICROHTTPD
bool "libmicrohttpd"
depends on BR2_TOOLCHAIN_HAS_THREADS
help
GNU libmicrohttpd is a small C library that makes it easy to
run an HTTP server as part of another application.
http://www.gnu.org/software/libmicrohttpd/
comment "libmicrohttpd needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 19/29
Adding a new package: Config.in (2/2)
package/Config.in
[...]
source "package/libmicrohttpd/Config.in"
[...]
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 20/29
Adding a new package: <pkg>.mk
package/libmicrohttpd/libmicrohttpd.mk
LIBMICROHTTPD_VERSION = 0.9.33
LIBMICROHTTPD_SITE = $(BR2_GNU_MIRROR)/libmicrohttpd
LIBMICROHTTPD_LICENSE = LGPLv2.1+
LIBMICROHTTPD_LICENSE_FILES = COPYING
LIBMICROHTTPD_INSTALL_STAGING = YES
LIBMICROHTTPD_CONF_OPT = --disable-spdy
$(eval $(autotools-package))
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 21/29
Adding a new package: infrastructures
In order to factorize similar behavior between packages using
the same build mechanism, Buildroot has package
infrastructures
autotools-package for autoconf/automake based packages
cmake-package for CMake based packages
python-package for Python Distutils and Setuptools based
packages
generic-package for non-standard build systems
Coming: infrastructures for Perl and Lua packages
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 22/29
Legal infrastructure
License compliance is an important topic for embedded Linux
systems
Needs to keep track of the license and source code of each
component
In Buildroot, licensing informations are attached to each
package
The make legal-info target generates:
A licensing manifest, CSV format
License text for all components
Source code for all components
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 23/29
Dependency graphing
make graph-depends
ALL
rpi-firmware busybox linux tvheadendlibcofi toolchain-external rootfs-tardropbear
lighttpd
rpi-userland i2c-tools
host-python
host-expat
host-autoconf
host-automake
host-libtool
host-zlib
host-pkgconf
host-kmod
host-lzop openssldvb-apps
host-m4
zlibhost-lzo
host-fakeroot host-makedevs host-cmake
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 24/29
Defconfigs
Pre-defined configurations for popular platforms
They build a minimal system for the platform
make <foobar>_defconfig to load one of them
Some of the configs
RasberryPi
BeagleBone
CubieBoard
PandaBoard
Many Atmel development boards
Several Freescale i.MX6 boards
Many Qemu configurations
and more...
make help for the full list
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 25/29
Buildroot, an active project
Releases published
every 3 months
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
Buildroot, an active project
Releases published
every 3 months
Growing number of
contributors: 35-40
different contributors
each month
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
Buildroot, an active project
Releases published
every 3 months
Growing number of
contributors: 35-40
different contributors
each month
Growing activity:
1500-2000
e-mails/month
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
Buildroot, an active project
Releases published
every 3 months
Growing number of
contributors: 35-40
different contributors
each month
Growing activity:
1500-2000
e-mails/month
Growing number of
packages
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
Buildroot, an active project
Releases published
every 3 months
Growing number of
contributors: 35-40
different contributors
each month
Growing activity:
1500-2000
e-mails/month
Growing number of
packages
Bi-yearly physical
meeting
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
Getting support
Documentation:
http://buildroot.org/downloads/manual/manual.html
Mailing list: buildroot@uclibc.org
IRC channel: #buildroot on Freenode
Bug tracker: https://bugs.uclibc.org
Friendly and welcoming community
Companies offering commercial support
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 27/29
Conclusion
Nice : uses well-known technologies and languages, kconfig
and make. Active and friendly community.
Simple : only a few hundreds lines of code to understand the
core infrastructure. Easy to get started, and easy to fully
understand the internal mechanisms.
Efficient : very reasonable build times, only what’s necessary
gets built.
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 28/29
Questions?
http://buildroot.org
Thomas Petazzoni
thomas.petazzoni@free-electrons.com
Slides under CC-BY-SA 3.0
http://free-electrons.com/pub/conferences/2014/lca/buildroot/
Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 29/29

Weitere ähnliche Inhalte

Kürzlich hochgeladen

+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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
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
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 

Kürzlich hochgeladen (20)

+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...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
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...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
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 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 

Empfohlen

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Buildroot: building embedded Linux systems made easy! (Linux Conf Australia 2014)

  • 1. Linux Conf Australia 2014 Buildroot: building embedded Linux systems made easy! 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/29
  • 2. Thomas Petazzoni CTO and embedded Linux engineer at Free Electrons Embedded Linux expertise Development, consulting and training Strong open-source focus Embedded Linux Developers Free Electrons Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
  • 3. Thomas Petazzoni CTO and embedded Linux engineer at Free Electrons Open-source contributor Contributing the kernel support for Marvell ARM processors Major contributor to Buildroot, 1600+ patches contributed Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
  • 4. Thomas Petazzoni CTO and embedded Linux engineer at Free Electrons Open-source contributor Living in Toulouse, south west of France Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/29
  • 5. Embedded ? These days, when you say embedded, most people think: Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
  • 6. Embedded ? These days, when you say embedded, most people think: Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
  • 7. Embedded ? These days, when you say embedded, most people think: Powerful dual/quad ARM/x86 processor Several GBs of RAM Dozens of GBs of storage Full-featured, general-purpose operating system (Android) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/29
  • 8. Embedded ? But there are much more embedded systems than just phones and tablets: Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
  • 9. Embedded ? But there are much more embedded systems than just phones and tablets: Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
  • 10. Embedded ? But there are much more embedded systems than just phones and tablets: Very application-specific → need a custom Linux system Less powerful CPUs, sometimes specialized CPU architectures Less RAM (a few dozen to a few hundred MBs) Less storage Long life-time and maintenance period Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 4/29
  • 11. Building an embedded Linux system + Readily available - Large, usually 100+ MB - Not available for all architectures - Not easy to customize - Generally require native compilation Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
  • 12. Building an embedded Linux system + Smaller and flexible - Very hard to handle cross-compilation and dependencies - Not reproducible - No benefit from other people’s work Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
  • 13. Building an embedded Linux system + Small and flexible + Reproducible, handles cross-compilation and dependencies + Available for virtually all architectures - One tool to learn - Build time Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 5/29
  • 14. Embedded Linux build system: principle Building from source → lot of flexibility Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
  • 15. Embedded Linux build system: principle Building from source → lot of flexibility Cross-compilation → leveraging fast build machines Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
  • 16. Embedded Linux build system: principle Building from source → lot of flexibility Cross-compilation → leveraging fast build machines Recipes for building components → easy Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 6/29
  • 17. Embedded Linux build system: tools A wide range of solutions: Yocto/OpenEmbedded, PTXdist, Buildroot, LTIB, OpenBricks, OpenWRT, and more. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
  • 18. Embedded Linux build system: tools A wide range of solutions: Yocto/OpenEmbedded, PTXdist, Buildroot, LTIB, OpenBricks, OpenWRT, and more. Today, two solutions are emerging as the most popular ones Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
  • 19. Embedded Linux build system: tools A wide range of solutions: Yocto/OpenEmbedded, PTXdist, Buildroot, LTIB, OpenBricks, OpenWRT, and more. Today, two solutions are emerging as the most popular ones Yocto/OpenEmbedded Builds a complete Linux distribution with binary packages. Powerful, but somewhat complex, and quite steep learning curve. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
  • 20. Embedded Linux build system: tools A wide range of solutions: Yocto/OpenEmbedded, PTXdist, Buildroot, LTIB, OpenBricks, OpenWRT, and more. Today, two solutions are emerging as the most popular ones Yocto/OpenEmbedded Builds a complete Linux distribution with binary packages. Powerful, but somewhat complex, and quite steep learning curve. Buildroot Builds a root filesystem image, no binary packages. Much simpler to use, understand and modify. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 7/29
  • 21. Buildroot at a glance Can build a toolchain, a rootfs, a kernel, a bootloader Easy to configure: menuconfig, xconfig, etc. Fast: builds a simple root filesystem in a few minutes Easy to understand: written in make, extensive documentation Small root filesystem, starting at 2 MB More than 1000 packages for userspace libraries/apps available Many architectures supported Well-known technologies : make and kconfig Vendor neutral Active community, regular releases http://buildroot.org Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 8/29
  • 22. Who’s using Buildroot? System makers Google Barco Rockwell Collins Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
  • 23. Who’s using Buildroot? System makers Google Barco Rockwell Collins Processor vendors Analog Devices Imagination Technologies Marvell Atmel Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
  • 24. Who’s using Buildroot? System makers Google Barco Rockwell Collins Processor vendors Analog Devices Imagination Technologies Marvell Atmel Many, many hobbyists on development boards: Rasberry Pi, BeagleBone Black, etc. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 9/29
  • 25. Getting started git clone git://git.busybox.net/buildroot cd buildroot make menuconfig Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 10/29
  • 26. Buildroot configuration 1. Target architecture Architecture ARC, ARM, AArch64, AVR32, Blackfin, Microblaze, MIPS, NIOS II, PowerPC, SuperH, SPARC, x86, x86 64, Xtensa Specific processor ABI Floating point strategy Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 27. Buildroot configuration 1. Target architecture 2. Build options Download directory Number of parallel jobs Use of ccache Shared or static libraries etc. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 28. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain Buildroot toolchain Buildroot builds the toolchain uClibc, glibc, eglibc External toolchain Uses a pre-built toolchain Profiles for existing popular toolchains Linaro, Sourcery CodeBench, Analog Devices, etc. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 29. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration Init system to use: Busybox, Sysvinit, Systemd /dev management solution: static, devtmpfs, mdev, udev Hostname, password, getty terminal, etc. Custom post build and post image scripts etc. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 30. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel Kernel source (stable version, Git tree, patches) Kernel configuration Support for RTAI and Xenomai real-time extensions Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 31. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages More than 1000 packages Qt4, Qt5, X.org, Gtk, EFL GStreamer, ffmpeg Python, Perl, Ruby, Lua Samba, OpenSSL, OpenSSH, dropbear, lighttpd OpenGL support for various platforms And many, many more libraries and utilities Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 32. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images Major filesystem formats supported cloop cpio, for kernel initramfs cramfs ext2/3/4 jffs2 romfs squashfs tar ubifs Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 33. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images 8. Bootloaders Grub Syslinux U-Boot Barebox and more platform-specific bootloaders: imx-bootlets, at91bootstrap, etc. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 34. Buildroot configuration 1. Target architecture 2. Build options 3. Toolchain 4. System configuration 5. Kernel 6. Target packages 7. Filesystem images 8. Bootloaders 9. Host utilities Allows to build some native tools, useful for development. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 11/29
  • 35. Example configuration BR2_arm=y BR2_arm1176jzf_s=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TARGET_GENERIC_GETTY_PORT="tty1" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/raspberrypi/linux.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="75d03120bc36b1cc3166973b8edc11f033ab7c0d" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi_quick" BR2_LINUX_KERNEL_ZIMAGE=y BR2_PACKAGE_RPI_FIRMWARE=y BR2_PACKAGE_I2C_TOOLS=y BR2_PACKAGE_RPI_USERLAND=y BR2_PACKAGE_LIBCOFI=y BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_LIGHTTPD=y BR2_PACKAGE_TVHEADEND=y ARM1176 platform, external toolchain Rasberry-Pi kernel Rasberry-Pi firmware lighttpd web server tvheadend streaming server dropbear SSH server I2C tools Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 12/29
  • 36. Building and using To start the build: make Results in output/images: rootfs.tar, root filesystem in tar format rootfs.ubi, root filesystem in UBI format uImage, Linux kernel image u-boot.bin, U-Boot bootloader image Ready to be flashed on your embedded system. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 13/29
  • 37. Exploring the build output All the output produced by Buildroot is stored in output/ Can be customized using O= for out-of-tree build output/ contains output/build, with one sub-directory for the source code of each component output/host, which contains all native utilities needed for the build, including the cross-compiler output/host/usr/<tuple>/sysroot, which contains all the headers and libraries built for the target output/target, which contains almost the target root filesystem output/images, the final images Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 14/29
  • 38. Summarized build process 1. Copies the rootfs skeleton to target/ 2. Takes care of the cross-compilation toolchain internal toolchain: Downloads, patches, configures, builds and installs binutils, gcc, C library and the necessary dependencies external toolchain: Copy the necessary bits of the toolchain into Buildroot output directory. 3. For each selected package, after taking care of its dependencies: download, extract, patch, configure, build, install To target/ for target apps and libs To host/usr/<tuple>/sysroot for target libs To host/ for native apps and libs 4. Generate the root filesystem image Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 15/29
  • 39. Real-world example 1 The device is an ARM AT91-based platform with GPS, RFID readers, GSM modem, Ethernet and USB. The Buildroot configuration: CodeSourcery ARM glibc toolchain Linux kernel BusyBox for the basic system Dropbear for SSH access (debugging) Qt with only QtCore, QtNetwork and QtXml, no GUI QExtSerialPort zlib, libxml2, logrotate, pppd, strace, a special RFID library, popt library The Qt application JFFS2 root filesystem Filesystem size: 11 MB. Could be reduced by using uClibc. Build time: 10 minutes on a fast build server (quad-core i7, 12 GB of RAM) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 16/29
  • 40. Real-world example 2 An x86-based system, with an OpenGL application for vehicle navigation system. External glibc toolchain generated with crosstool-NG The Grub bootloader Linux kernel, of course BusyBox A large part of the X.org stack (the server, a few drivers, and some client libraries), including libdrm, Mesa The fglrx ATI proprietary OpenGL driver ALSA utils, ALSA library, V4L library, Flashrom, LM Sensors, Lua, Dropbear, Ethtool The OpenGL application and its data Filesystem size: 95 MB, with 10 MB of application (binary + data) and 45 MB (!) of fglrx driver. Build time: 27 minutes on a fast build server (quad-core i7, 12 GB of RAM) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 17/29
  • 41. Customizing the build Besides the existing packages, there are multiple ways to customize the generated root filesystem: Create custom post-build and/or post-image scripts Use a root filesystem overlay, recommended to add all your config files Add your own packages Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 18/29
  • 42. Adding a new package: Config.in (1/2) package/libmicrohttpd/Config.in config BR2_PACKAGE_LIBMICROHTTPD bool "libmicrohttpd" depends on BR2_TOOLCHAIN_HAS_THREADS help GNU libmicrohttpd is a small C library that makes it easy to run an HTTP server as part of another application. http://www.gnu.org/software/libmicrohttpd/ comment "libmicrohttpd needs a toolchain w/ threads" depends on !BR2_TOOLCHAIN_HAS_THREADS Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 19/29
  • 43. Adding a new package: Config.in (2/2) package/Config.in [...] source "package/libmicrohttpd/Config.in" [...] Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 20/29
  • 44. Adding a new package: <pkg>.mk package/libmicrohttpd/libmicrohttpd.mk LIBMICROHTTPD_VERSION = 0.9.33 LIBMICROHTTPD_SITE = $(BR2_GNU_MIRROR)/libmicrohttpd LIBMICROHTTPD_LICENSE = LGPLv2.1+ LIBMICROHTTPD_LICENSE_FILES = COPYING LIBMICROHTTPD_INSTALL_STAGING = YES LIBMICROHTTPD_CONF_OPT = --disable-spdy $(eval $(autotools-package)) Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 21/29
  • 45. Adding a new package: infrastructures In order to factorize similar behavior between packages using the same build mechanism, Buildroot has package infrastructures autotools-package for autoconf/automake based packages cmake-package for CMake based packages python-package for Python Distutils and Setuptools based packages generic-package for non-standard build systems Coming: infrastructures for Perl and Lua packages Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 22/29
  • 46. Legal infrastructure License compliance is an important topic for embedded Linux systems Needs to keep track of the license and source code of each component In Buildroot, licensing informations are attached to each package The make legal-info target generates: A licensing manifest, CSV format License text for all components Source code for all components Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 23/29
  • 47. Dependency graphing make graph-depends ALL rpi-firmware busybox linux tvheadendlibcofi toolchain-external rootfs-tardropbear lighttpd rpi-userland i2c-tools host-python host-expat host-autoconf host-automake host-libtool host-zlib host-pkgconf host-kmod host-lzop openssldvb-apps host-m4 zlibhost-lzo host-fakeroot host-makedevs host-cmake Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 24/29
  • 48. Defconfigs Pre-defined configurations for popular platforms They build a minimal system for the platform make <foobar>_defconfig to load one of them Some of the configs RasberryPi BeagleBone CubieBoard PandaBoard Many Atmel development boards Several Freescale i.MX6 boards Many Qemu configurations and more... make help for the full list Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 25/29
  • 49. Buildroot, an active project Releases published every 3 months Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
  • 50. Buildroot, an active project Releases published every 3 months Growing number of contributors: 35-40 different contributors each month Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
  • 51. Buildroot, an active project Releases published every 3 months Growing number of contributors: 35-40 different contributors each month Growing activity: 1500-2000 e-mails/month Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
  • 52. Buildroot, an active project Releases published every 3 months Growing number of contributors: 35-40 different contributors each month Growing activity: 1500-2000 e-mails/month Growing number of packages Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
  • 53. Buildroot, an active project Releases published every 3 months Growing number of contributors: 35-40 different contributors each month Growing activity: 1500-2000 e-mails/month Growing number of packages Bi-yearly physical meeting Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 26/29
  • 54. Getting support Documentation: http://buildroot.org/downloads/manual/manual.html Mailing list: buildroot@uclibc.org IRC channel: #buildroot on Freenode Bug tracker: https://bugs.uclibc.org Friendly and welcoming community Companies offering commercial support Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 27/29
  • 55. Conclusion Nice : uses well-known technologies and languages, kconfig and make. Active and friendly community. Simple : only a few hundreds lines of code to understand the core infrastructure. Easy to get started, and easy to fully understand the internal mechanisms. Efficient : very reasonable build times, only what’s necessary gets built. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 28/29
  • 56. Questions? http://buildroot.org Thomas Petazzoni thomas.petazzoni@free-electrons.com Slides under CC-BY-SA 3.0 http://free-electrons.com/pub/conferences/2014/lca/buildroot/ Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 29/29