Building Kodi With Yocto For The Raspberry Pi
This article is a guide on how I got Kodi working along with some basic notes on what ended up being a super simple Kodi Yocto distribution for the Raspberry Pi 3B+.
TL;DR Repo here
Recently I decided to take my Raspberry Pi 3B+ for a spin and try and build Kodi with Yocto for it. I wanted to support the following simple features:
- Boot into Kodi.
- Running Kodi as a normal user i.e. not root.
- Auto-mount usb drives.
You can download the whole project here or manually:
- Kodi and other recipe customisations:
- The poky distro:
- The raspberrypi bsp:
- OpenEmbedded components:
- Kodi integration:
- Add your NetworkManager connection profiles under
meta-hubshuffle/recipes-networking/networkmanager/files/your-profile.nmconnectionand add those files to the SRC_URI variable in
- The root password is defined in
- The hubshuffle user password is configured in
Note: You need to add "warrior" to the compatible layers in
Setup your build environment:
conf/local.conf, for example:
conf/bblayers.conf, for example:
Build the image:
Finally, write the image to an sd-card. Alternatively check here how to network boot:
I was mainly curious about the startup time and performance so I was expecting the actual Kodi integration to be straight forward given the Pi's popularity. The first customisation necessary to obtain 3d acceleration and hardware decoding is to set the
WINDOWSYSTEM variable to "raspberrypi" as kodi has a configuration option dedicated to the RPi. I also had to back-port a patch to fix the ninja build configuration and to disable
THUMB instructions by setting
ARM_INSTRUCTION_SET to "arm". Additionally I got QA errors and had to disable that step for the kodi package. The final recipe ended up looking as:
The remaining recipes in the meta-hubshuffle layer and included in the
hubshuffle-image-kodi recipe are distro configurations and tweaks including user configuration and permissions, udev rules, psplash (which needs a bit of work) and so on.
- Permissions need to be configured to allow reboot/shutdown as these options are missing from the Kodi exit menu.
- Partitioning hasn't been configured.
- I haven't actually tested kodi besides video playback so there might be features missing.
Here is a graph of the final rootfs:
And here is a graph of the boot sequence: