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.
Dependencies
You can download the whole project here or manually:
- Kodi and other recipe customisations:
meta-hubshuffle@master
. - The poky distro:
poky@warrior
. - The raspberrypi bsp:
meta-raspberrypi@warrior
. - OpenEmbedded components:
meta-openembedded@warrior
. - Kodi integration:
meta-kodi@84cd030ec8bee8203f5266d02284ef8f236a11e1
. - Add your NetworkManager connection profiles under
meta-hubshuffle/recipes-networking/networkmanager/files/your-profile.nmconnection
and add those files to the SRC_URI variable innetworkmanager_%.bbappend
. - The root password is defined in
meta-hubshuffle/recipes-core/images/hubshuffle-image-kodi.bb
- The hubshuffle user password is configured in
meta-hubshuffle/recipes-core/hubshuffle-user/hubshuffle-user.bb
Note: You need to add "warrior" to the compatible layers inmeta-kodi/conf/layer.conf
.
Build Instructions
Setup your build environment:
Setup conf/local.conf
, for example:
Setup conf/bblayers.conf
, for example:
Build the image:
Finally, write the image to an sd-card. Alternatively check here how to network boot:
Details
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 thehubshuffle-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.
ToDo
- 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: