# Show & Tell: Building Embedded OS ###### tags: `Show & Tell` --- ![Buildroot](https://buildroot.org/images/logo.png) --- ## The Problem * Raspberry Pi is cheap and easy to get * Peripheral Hardware interaction is easy But running a full blown OS sucks: * OS management degrades performance a lot * Running `salt` is a stupid idea * Writing to MMC kills the Filesystem --- ## The Solution Automated disk image generation: * Configuration during build-time * Read only filesystem * Fine-graned software selection Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. --- ## Getting started * Use `buildroot-submodule` from github as a template * Copy `buildroot/configs/raspberrypi2_defconfig` to `defconfig` * Run `make menuconfig all` * Flash the image from `output/images/sdcard.img` --- ## Add your configuration * The `overlay` can contain arbritary files * Manipulate shipped files with post-build scripts * Provide patches for shipped files --- ## Bundle your software There are tons of prebuild packages available, but... ``` LIGHTSD_VERSION = efeda1f LIGHTSD_SITE = https://git.darmstadt.ccc.de/fooker/lightsd.git LIGHTSD_SITE_METHOD = git LIGHTSD_GIT_SUBMODULES = YES LIGHTSD_DEPENDENCIES = luajit openssl yaml-cpp websocketpp boost $(eval $(cmake-package)) ``` --- ## Continuous Integration Yep. Full-cycle is about 2h on our hardware. But down to 45m with: * Cache download between builds * Enabling `ccache` ``` dl: found 67990 matching files ccache: found 64130 matching files ``` Example: https://git.maglab.space/fooker/lightsd-pi --- ## Firmware updates `fwup` is a configurable image-based software update utility for embedded Linux-based systems. * Creates bundle used for update and initial flashing. * Supports A/B partitioning * Already available in buildroot Tricky, as Raspberry Pi does not use a common bootloader -> A/B partitioning for `/boot` helps. --- ## Open Issues * Firmware provisioning -> `gluon-autoupdater` * Remote access --- ## Resources * https://buildroot.org/downloads/manual/manual.html * https://github.com/Openwide-Ingenierie/buildroot-submodule * https://git.maglab.space/fooker/lightsd-pi `#buildroot` on freenode is very helpfull
{"slideOptions":{"transition":"fade","theme":"white"}}