Introduction to OpenBricks: an Embedded Linux Framework
-
Upload
benjamin-zores -
Category
Lifestyle
-
view
3.423 -
download
3
description
Transcript of Introduction to OpenBricks: an Embedded Linux Framework
Benjamin Zores
6th February 2011FOSDEM, Brussels
Introduction to OpenBricks: an Embedded Linux Framework
Enterprise-grade embeddedLinux framework and build system.
For easy and custom Linux distribution bring-up.
Runs on a wide variety of hardware.
For rapid prototyping or full-blown product development.
• “Hum, seems like I’ve already heard about that ... So how is it different from … ?”
What is OpenBricks ?
B. Zores – FOSDEM 2011
2011 Embedded Linux build systems:
• OpenEmbedded (Angström, Poky, Yocto, ...)
• Buildroot
• OpenWRT
• T2 SDE
• Linux Target Image Builder (LTIB)
• “Professional”: Windriver, Montavista, Mentor Graphics …
• And now OpenBricks ??
• More details in a further talk, but in the mean time:
http://tinyurl.com/EmbeddedLinuxBuildSystems
State of the Art
B. Zores – FOSDEM 2011
Because Google’s Android is not the perfect embedded OS.
History:
• OpenBricks “brand” in itself was founded in Oct. 2010.
• But came as an extension to the GeeXboX project - © 2002.
• Inherited toolchain and philosophy,but designed to be more versatile.
• Now used as custom build framework for GeeXboX OS.
Each build system has pros and cons, but projects all have very different philosophies.
• So it’s not exactly new …
So why yet another build system in 2011 ?
B. Zores – FOSDEM 2011
Embedded Linux build frameworkfor individuals and/or enterprises for eithereasy prototyping or full-blown products development.
Replaces traditional BSPs with a fine-grained package tuning ability (through kconfig interface).
Support for x86, ARM, PowerPC and MIPS architectures with reference boards optimizations.
Brings up low-level system and features major applicative frameworks (Qt, EFL, GTK, SDL) for developers to only focus on end-user applications.
Multimedia-oriented but with general purpose:• Currently sustains the GeeXboX STB OS project.• But allow you to build your unique one too …
The 5 minutes Overview
B. Zores – FOSDEM 2011
x86 (32/64 bits):
from generic builds to custom ATOM/ION optimized ones.
PowerPC (32/64 bits)
MIPS (32 bits)
ARM:
• ARM9 (e.g. Marvell Kirkwood …)• ARM11 (e.g. Broadcom BCM11107 Persona family …)• Cortex A8 / A9 (e.g. TI OMAP3, TI OMAP4, nVidia Tegra250 …)
With known reference boards optimizations:Beagleboard, IGEPv2, Touchbook, Pandaboard …
Much more to be expected:Freescale i.MX, Qualcomm SnapDragon,Marvell Armada, Intel CE4xxx …
Supported Architectures
B. Zores – FOSDEM 2011
Supported Languages:
• Shell, C, C++, Python, Perl, Lua, Vala
Supported Frameworks:
• Nokia Qt 4.7.1 with support for:
• Webkit• QtMobility• QtDeclarative / QML
• Enlightenment EFL 1.0
• GTK+ 2.22
• SDL Simple DirectMedia Layer 1.2
Applicative Features
B. Zores – FOSDEM 2011
Native framebuffer interface.
Accelerated DirectFB engine.
Accelerated X11 Infrastructure.
Support for Khronos group standards:
• EGL Native Platform Graphics Interface
• Desktop OpenGL 3.0
• Embedded OpenGL|ES 2.1
• Embedded OpenVG 1.0
• Provided either by Mesa or by manufacturer’s binary blobs.
Multimedia Features - Graphics
B. Zores – FOSDEM 2011
Audio Frameworks:
• ALSA, PulseAudio
Software Video Frameworks:
• SMP-optimized FFmpeg decoders.
Hardware Video Frameworks:
• Khronos OpenMAX (OMAP3, OMAP4, Tegra2).
• nVidia VDPAU (x86 with nVidia GeForce GPU).
• Freedesktop VA-API (x86 with Intel or ATI GPUs).
• Broadcom CrystalHD (BCM 70012/70015 chips).
• Other native SoC acceleration (OMAP3, OMAP4).
Multimedia Features - Audio/Video
B. Zores – FOSDEM 2011
Frameworks and Players:
• MPlayer, Xine, GStreamer, VLC
• libplayer Audio/Video abstraction framework
Media Center frontends:
• XBMC
• Video Disk Recorder (VDR)
• Enna
• HTS Showtime
• Nokia QtMediaHub
• MythTV
Multimedia Features - Applications
B. Zores – FOSDEM 2011
Fully POSIX shell scripts based:
• Easy understanding, hacking and maintenance ...• … at least much more than obfuscated Makefiles or Python stuff ;-)
Does not require any externals tools or environment.• Required host build tools and packages are built along the way.
• Cross-Compilation Safety and Robustness• Triggers GCC internal errors on -I/usr/include and -L/usr/lib
Fully customizable:
• Supports customized distribution flavourspre-generated configurations.
• Complete standalone package/feature selectionthrough Kconfig interface.
• Per-package fine-tuning through use flags (similar to Gentoo).
Features per-package metadata rules for abstracted in/out. With more than 550 supported packages.
Build System Overview
B. Zores – FOSDEM 2011
Support for multiple GCC-based cross-compilers:
• OpenBricks multi-architectures native one.
• Linaro for ARM.
• CodeSourcery for ARM.
• Support for multiple C libraries:
• GNU libc (glibc)
• Embedded GLIBC (eGlibc). This is default one !
• uClibc
• klibc (for early ramdisk bits).
Do your own mix !
Toolchain Overview
B. Zores – FOSDEM 2011
Up to 3-levels of hardware configuration tuning:
• Architecture (e.g. ARM, x86 …)
• Platform (e.g generic, OMAP3, OMAP4 …)
• Machine (e.g. generic, Beagleboard, IGEPv2 …)
• The deeper, the more optimized (footprint, selected packages …), but the less portable …
-> it’s up to you to choose depending on your needs !
Automatic package inter-dependenciesselection and build process.
Support for per arch/platform/machine package overlay.
Configuration Overview (1/2)
B. Zores – FOSDEM 2011
Features fine-tuning through “use flags” (similar to Gentoo):
• Conditionally build specific features.
• Enable flags per-package or system-wide.
• You can also have package-specific flags.
• Infinite number of them …
Pre-determined packages subset, a.k.a. build flavours:
• Minimalist base bootable system.
• GeeXboX MediaCenter-oriented distribution.
• Add your own distro here !
Configuration Overview (2/2)
B. Zores – FOSDEM 2011
Bleeding-edge packages: latest stable package version policy.
Support for arch/platform/machinespecific package overlay (sources, patches …).
Modern user-space: systemd, udev, D-Bus, connman …
Stuff gets packaged into low-resources OPKG packages.
Multiple OPK build residue: runtime, devel, debug.
Multiple target system delivery forms:
• Flashable disk images: JFFS2, UBIFS, EXT 2/3/4.
• x86 LiveCD (ISO) and network (PXE) bootable images.
• Flat root filesystem
• Virtual machines images: QEMU, VMware
Key Build Framework Features
B. Zores – FOSDEM 2011
Files Structure:
• build: cross-build rules
• install: installation rules for target (optional)
• installdev: installation rules for host toolchain (optional)
• meta: metadata, use flags and package description.
• unit (optional)• package.service: systemd service.
• patches (optional)• 01_fix.diff• 02_feature.diff• series (optional)
Package Description Template
B. Zores – FOSDEM 2011
● Metadata description:
PKG_NAME=syslink
PKG_VERSION=0.24.9.2
PKG_URL="$DISTRO_SRCS/tisyslink-${PKG_VERSION}.tar.bz2"
PKG_REV=1
PKG_DEPENDS="$TARGET_LIBC tiler"
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY=optional
PKG_SECTION=libs
PKG_SHORTDESC="TI OMAP4 SysLink DSP interface"
PKG_LONGDESC="SysLink is the next generation IPC driver
developed for OMAP4 and beyond. SysLink is an evolution of
both the previous-generation IPC drivers - DSPBridge and
DSPLink."
“Simple” package example: syslink (1/4)
B. Zores – FOSDEM 2011
Build Rules:
#!/bin/sh
. config/options
cd $BUILD/$1*
do_configure \
--disable-debug \
make
make_install
“Simple” package example: syslink (2/4)
B. Zores – FOSDEM 2011
Toolchain installation files rules (dev opk file):
do_installdev usr/include
do_installdev usr/lib
Runtime target installation files rules (runtime + dbg opk file):
do_install usr/bin/syslink_daemon.out
do_install usr/lib/libipc.so*
do_install usr/lib/libipcutils.so*
do_install usr/lib/libomap4430proc.so*
do_install usr/lib/libprocmgr.so*
do_install usr/lib/librcm.so*
do_install usr/lib/libsyslinknotify.so*
do_install usr/lib/libsysmgr.so*
“Simple” package example: syslink (3/4)
B. Zores – FOSDEM 2011
SystemD Service:
[Unit]Description=Ducati Syslink daemonConditionPathExists=/etc/syslink.confAfter=syslog.target
[Service]EnvironmentFile=/etc/syslink.confType=forkingExecStart=/usr/bin/syslink_daemon.out $SYSM3_IMAGE $APPM3_IMAGERestart=always
[Install]WantedBy=multi-user.target
“Simple” package example: syslink (4/4)
B. Zores – FOSDEM 2011
Metadata description:
PKG_NAME=libplayerPKG_VERSION=2.0.1PKG_URL="http://libplayer.geexbox.org/releases/libplayer- $PKG_VERSION.tar.bz2"PKG_REV=1PKG_BUILD_DEPENDS="toolchain"PKG_RUN_DEPENDS="$TARGET_LIBC"
PKG_USE="gstreamer xorg vdpau"
# gstreamerPKG_USE_DESC_gstreamer="Enable GStreamer backend"PKG_USE_HELP_gstreamer="Enables the GStreamer backend."PKG_DEPENDS_gstreamer="gstreamer gst-plugins-base"
# xorgPKG_DEPENDS_xorg="libX11"PKG_DEPENDS_vdpau="libvdpau"
“Average” package example: libplayer (1/2)
B. Zores – FOSDEM 2011
Build Rules:
#!/bin/sh. config/options
XORG_CONFIG="--disable-x11"pkg_uses $1 xorg && \ XORG_CONFIG="--enable-x11 --enable-xlib-hack"
GST_CONFIG="--disable-gstreamer"pkg_uses $1 gstreamer && GST_CONFIG="--enable-gstreamer"
cd $BUILD/$1*do_configure \
$GST_CONFIG \$XORG_CONFIG \--cross-compile \--disable-doc
make && make_install
“Average” package example: libplayer (2/2)
B. Zores – FOSDEM 2011
Get some help or information:
• Website provides a complete documentation on build system internals.• On our mailing list: [email protected]
Join the development team:
• Add new packages, hence features.• Add support for new/more hardware (yours ?).• Increase flavours support by adding your custom distribution subset.
Sponsor us with a couple of reference boards.
• Only way for the team to really support your architecture …• We’re still interested in Intel / Freescale / Qualcomm / Marvell boards.
Donations
• The usual way: helps us buy new toys to be supported ...
How you can one help (or get helped) ?
B. Zores – FOSDEM 2011