Buildroot:TechShowcase2015 Demo

Revision as of 23:42, 2 April 2015 by PeterKorsgaard (talk | contribs) (fix rpi typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page documents the Buildroot demo that was presented during the technical show case at the Embedded Linux Conference 2015 in San Jose.

There are two sides to the demo:

  1. A NAS serving media files via various means: DLNA, NFS
  2. A media player running Kodi 14.1 Helix, playing media files served by the NAS

Both systems were built using Buildroot, go get it there:

   git clone git://
   cd buildroot
   git checkout 2015.03-demo-elc


The NAS is an OpenBlocks AX3:

  • Dual-core Marvel Armada XP Cortex A9 @1.33GHz
  • 1GiB DDR3 RAM, 128MiB NOR Flash
  • Giga-bit ethernet

The software stack running on the NAS is mainly composed of:

  • Linux kernel 3.18.7, plus backported patches to improve Armada XP support
  • Avahi 0.6.31
  • MiniDLNA 1.1.4
  • Dropbear 2015.67

Build the NAS firmware:

   mkdir -p output/NAS
   make O=output/NAS demo_elc_openblocks_nas_defconfig
   make O=output/NAS

The result is available in output/NAS/images/, with the following two files being the important ones:

  • uImage, which is the kernel image. It contains an appended Device Tree Blob, because the AX3 bootloader doesn't support Device Tree booting.
  • rootfs.ubi, which is the root filesystem image, in the UBI format.

We will flash both on the NOR flash. We could have stored the system in the SATA hard disk, but we preferred to keep it only for the NAS data, and have the system stored separately.

You can flash the resulting system to the AX3 using the following U-Boot commands, assuming you have a working TFTP server:

   erase 0xf8800000 +0x800000; tftp 0x2000000 uImage; cp.b 0x2000000 0xf8800000 ${filesize}
   erase 0xf9000000 +0x2000000; tftp 0x2000000 rootfs.ubi; cp.b 0x2000000 0xf9000000 ${filesize}

Then, to boot the system, set the following environment variables:

   setenv bootargs console=ttyS0,115200 mtdparts=f0000000.nor:8M@8M(kernel),32M(rootfs) ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
   setenv bootcmd cp.b 0xf8800000 0x2000000 0x800000; bootm 0x2000000

The system will automatically mount the /dev/sda1 partition in /data, assuming it is used for the NAS storage. Note that the system is basic, and does not attempt to create or format this partition: it assumes it already exists.

Media player

The media player is a Raspberry Pi 2:

  • Quad-core Broadcom BCM2836 Cortex A7 @900MHz
  • 1GiB RAM
  • 100Mb ethernet
  • µSD

The software stack running on the media player is mainly composed of:

  • Linux kernel 3.19.0 (plus RPi patches)
  • Kodi 14.1 Helix
  • Kodi PVR and audio-encoder add-ons
  • samba 3.6.25
  • Avahi 0.6.31
  • ConnMan 1.27
  • Dropbear 2015.67
  • eudev 2.1.1
  • tzdata 2015a

Build the Media player firmware:

   mkdir -p output/mediaplayer
   make O=output/mediaplayer demo_elc_raspberrypi_kodi_defconfig
   make O=output/mediaplayer

The result is available in output/mediaplayer/images/, wit the following content:

  • zImage, which is the kernel Image.
  • rpi-firmware/, which contains the bootloader and the GPU firmware, and the RPi-2 DTB.
  • rootfs.tar, which contains the rootfs filesystem.

To use this, you first need to prepare a µSDcard (assuming it is /dev/sdz on your PC):

   sudo parted -s /dev/sdz mklabel msdos unit MiB mkpart primary 1 10 mkpart primary 10 512 print
   sudo partprobe -s /dev/sdz
   sudo mkfs.vfat -F 16 -n BOOT /dev/sdz1
   sudo mkfs.ext4 -m1 /dev/sdz2

Then you need to copy files to the µSDcard:

   mkdir sdz1 sdz2
   sudo mount /dev/sdz1 sdz1
   sudo mount /dev/sdz2 sdz2
   sudo cp -a output/mediaplayer/images/rpi-firmware/* sdz1/
   sudo cp -a output/mediaplayer/images/zImage sdz1/
   sudo tar xf output/mediaplayer/images/rootfs.tar -C sdz2/
   sudo umount sdz1
   sudo umount sdz2

Finally, you can move the µSDcard to the RPi-2 and power it on. The default configuration on this system is meant for Kodi to be controlled via the remote of a CEC-compatible TV, or froom a USB keyboard. See the official Kodi documentation on how to further customise it.


The poster used to present the demo is available as PDF and SVG.