Installing Arch Linux with Kodi on a Wandboard Quad

2016-09-10

I have been looking into several options to run Kodi on a Wandboard Quad for some time now. I now have Arch Linux with Kodi running on it quite reliably now. I am writing down the steps here hoping that it helps others to achieve the same thing. This is also a memo for myself ;-)

Disclaimer: I have finished the installing procedure a while ago so there might be newer package versions that could potentially cause problems now.

I started by following the instructions on the Arch Linux ARM site to install the image onto the micro SD card. This will install an upstream Linux kernel.

Since the hardware support in the upstream kernel for the i.MX6 SoC is not as good as in the specialized kernel we are going to replace the stock kernel: pacman -Syu linux-imx6. This will update the repositories and upgrade all installed packages too. After updating the kernel we need to reboot the system: reboot.

The Linux operating system will not boot up as the U-Boot bootloader assumes a (newer) kernel that comes with device trees for both Wanboard revisions B1 and C1. I have a revision C1 board so in the U-Boot console I entered: setenv board_name C1 and boot to boot up the Linux system.

In order to not being required to manually modify the U-Boot environment every time the system boots up, we need to do the following: cd /boot/dtbs && ln -s imx6q-wandboard.dtb imx6q-wandboard-revb1.dtb. Rebooting without manual intervention should work fine now.

In Linux we are going to install the Kodi mediacenter now: pacman -S kodi-imx imx-gpu-viv-fb. You’ll notice a quite annoying blinking cursor when starting up Kodi. To avoid this, run echo "optargs=consoleblank=0" > /boot/uEnv.txt. If you want Kodi to start automatically every time the Linux system boots up, run systemctl enable kodi and reboot.

I have done a hardware modification to my Wandboard so the CEC signal line of the HDMI connection is being routed to the SoC. This allows me to control Kodi with the remote control of my TV. We need to create a udev rule so that Kodi can access the CEC device:

cat << EOF > /etc/udev/rules.d/99-hdmi-cec.rules
KERNEL=="mxc_hdmi", SUBSYSTEM=="mxc_hdmi", GROUP="video", MODE="0666"
KERNEL=="mxc_hdmi_cec", SUBSYSTEM=="mxc_hdmi_cec", GROUP="video", MODE="0666" 
EOF

If you are planning to attach a (USB) keyboard to the Wandboard you probably want to be able to type in Kodi’s input fields (search boxes, etc.) using that keyboard. This can either be achieved by following the advice on the Arch wiki or by executing the following commands:

usermod -a -G tty kodi
cat << EOF > /etc/udev/rules.d/51-udev-custom.rules
SUBSYSTEM=="tty", KERNEL=="tty0", MODE="0660"
EOF

Now you should be all set with a Kodi-activated mediacenter on your Wandboard. You might need to adjust the timezone setting using timedatectl set-timezone <your_timezone>.