Comparing Embedded Linux Build Systems And Distros

Transcription

Comparing embedded Linux build systems and distrosDrew MoseleySolutions ArchitectMender.io

Session overview Review of embedded Linuxdevelopment challenges. Define build system and criteria. Discuss a few popular options. Give me an opportunity to learn aboutsome of the other tools.Goal: Help new embeddedLinux developers get started

About meDrew Moseley 10 years in Embedded Linux/Yocto development. Longer than that in general Embedded Software. Project Lead and Solutions Architect.Mender.io Over-the-air updater for Embedded Linux Open source (Apache License, v2) Dual A/B rootfs layout /https://twitter.com/mender io Remote deployment management (server) Under active development

Challenges for Embedded Linux DevelopersHardware varietyStorage MediaSoftware may be maintained in forksCross developmentInitial device provisioning

Simple Makefiles don't cut it (anymore)Facts: These systems are huge Dependency Hell is a thing Builds take a long time Builds take a lot of resources Embedded applications requiresignificant customization Developers need to modifyfrom defaults

Build System DefinedIs NotIs Mechanism to specify and build Define hardware/BSPcomponents Integrate user-spaceapplications; including customcodeNeed reproducibilityMust support multiple developersAllow for parallel processing(Cross) ToolchainsLicense Management An IDEA DistributionA deployment and provisioningtoolAn out-of-the-box solution

Yocto Project - Overview“It’s not an embedded Linux distribution -- it creates a custom one for you”1 Recipes, metadata, dependencies and configurationPrimary output: package feedSecondary output: boot imagesBuilds all components from sourceMechanism, not policyProducts: Root filesystem imageKernel, Bootloader, ToolchainPackage Feed1See more at https://www.yoctoproject.org

Yocto Project - DetailsOrganized into independent layers: Separation of functionalityAllows different release schedulesExpandability Recipes developed in python and bashSDK mechanism Separation of system and application devsEasily allows multiple developers to contributeOptimizations: Faster build time reusing prebuilt binariesParallel buildsPrevious ELC talk estimated 8400 softwarepackages available

Yocto Project - Getting Started git clone -b rocko \git://git.yoctoproject.org/poky.git source poky/oe-init-build-env MACHINE qemux86 bitbake \core-image-minimal runqemu qemux86

Yocto Project - SummaryPros: Widely supported by board andsemiconductor vendorsActive developer communityWide functionality and boardsupport enabled by layermechanismCustomizable and expandableMinimal native tooling requiredCons: Steep learning curveUnfamiliar environment tonon-embedded developersResource-intensive Long initial build times Disk space

Buildroot - Overview“Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linuxsystems through cross-compilation.”1 Primary output: boot imagesDoes not support rpm-style package mgmt“Firmware Generator”Builds all components from sourceFocus on simplicityProducts: Root filesystem imageKernel, Bootloader, Toolchain1See more at https://buildroot.org/

Buildroot - DetailsUses Makefiles and Kconfig Widely support and well-knownRelatively small images and quick buildsBR2 EXTERNAL mechanism Local additions stored outside the Buildrootsource treePackage recipes, defconfigs, etc.Recipes developed in kconfig and makeSDK mechanism Separation of system and application devsEasily allows multiple developers to contributePrevious ELC talk estimated 1800 softwarepackages available

Buildroot - Getting Started git clone -b 2018.02 https://git.buildroot.net/buildroot cd buildroot make qemu arm vexpress defconfig make eval (grep qemu-system-arm board/qemu/arm-vexpress/readme.txt)

Buildroot - SummaryPros: Little corporate involvementQuick to get startedEasy to understandActive developer communityBroad architecture and boardsupportCons: Little corporate involvementConfiguration changes requirefull rebuildNo reusable shared state bydefault

OpenWRT - Overview“OpenWrt provides a fully writable filesystem with package management.”1Primary focus is networking Replacement firmware for consumer devicesPrimarily a binary distributionOn-device package managementProducts: Firmware image in device-specific formatNetwork available package repositories1See more at https://openwrt.org/

OpenWRT - Build System Consists of Makefiles and patchesGenerates a cross-toolchain and root filesystem imageUses kconfigMore details here: tem

OpenWRT - SummaryPros: Great choice as replacementfirmwareGood choice for: Router/networking device If your application needspackage-based updatesCons: Less flexible for generalEmbedded applicationsPolicy imposed by OpenWRTdesignPackage based updates can makefleet management difficult

Desktop Distros - Overview(or why can’t I just use favorite-distro ?)You can.Sometimes.

Desktop Distros - DetailsUse installer from favorite distroIncreased usage (Raspberry Pi)Slim down to meet your needsGenerally uses prebuilt binariesImposes (significant?) policyDependent on distro vendor decisionsLikely not targeted at embedded applicationsMay not be cross-development friendly

Desktop Distros - SummaryPros: Lots of choices to start withDeveloper familiarityLarge selection of prebuiltpackagesQuick getting startedSimplicityOn-target builds are possibleCons: Policy imposed by vendorDifficulty in removing packagesdue to dependenciesReproducibility is complicatedOn-target builds may be slowOff-target builds may be difficultor impossible

Other Criteria Hardware vendorprovided material Training anddocumentation Vendor for support Developer experience

Related ToolsuClinux (http://www.uclinux.org/) Port of Linux to systems without a MemoryManagement Unit Kernel 2.6, user applications, libraries andtool chains.crosstool-NG (https://crosstool-ng.github.io/) Cross-toolchain generator Uses kConfig

Other Build OptionsELBE (https://github.com/linutronix/elbe)ISAR (https://github.com/ilbers/isar/)Android ((https://source.android.com/).To BeContinued.

Summary - Use Cases Beginner/hobbyist/maker: Commercial dev board/easy getting started Desktop distro or OpenWRT Commercial use, single configuration Fast build time/easy getting started Buildroot Commercial use, multiple configurations Modular/HW vendor support Yocto Project

SummaryYocto ProjectExpandabilityConfigurabilityEase of GettingStartedPackageAvailabilityIndustry SupportBuildrootOpenWRTDesktop Distro

Thank You!Q&A@drewmoseleydrew.moseley@mender.io

Remote deployment management (server) Under active development. Challenges for Embedded Linux Developers Hardware variety Storage Media Software may be maintained in forks Cross development Initial device provisioning. Simple Makef