OpenELEC runs Kodi, an award-winning free and open source (GPL) software media player and entertainment hub for digital media. For more info see http://kodi.tv . The base system has been designed and built from the ground up to be as efficient as possible – consuming only tiny disk and memory footprints and providing cutting edge hardware support to deliver a set-top box experience.
In order to run software above the base OpenELEC distribution with minimal impact to the OpenELEC base, one alternative is to use a container.
I have chosen to use systemd-nspawn instead of chroot. There are really no downsides as long as you can configure the required kernel config options and have a basic working knowledge of systemd.
MyContainer.service
as.config/system.d/MyContainer.service
-
Create
MyContainer.service
and adapt to your needs. At least check the following settings:--link-journal=host
--directory=/var/lib/container/MyContainer
-
Create a link to the container by executing the following command:
ln -s /storage/data/MyContainer /var/lib/container/
-
I am going to use the Debian Jessie 8.1 minimal release as a base container platform. Create the container on an alternate host running Linux with debootstrap installed:
sudo debootstrap --arch=amd64 stable ./MyContainer/ sudo tar -czf MyContainer.tar.gz ./MyContainer
-
Copy and deploy the container to the OpenELEC host:
cd /storage/data/ tar -xzf MyContainer.tar.gz rm MyContainer.tar.gz
-
Add and enable the container at boot
systemctl enable MyContainer.service
- Check, start, check and stop the container
/usr/bin/systemd-nspawn --keep-unit --boot --link-journal=host --directory=/var/lib/container/MyContainer
Ctrl-] (Press ^] three times within 1s to kill container.)
systemctl start MyContainer
systemctl show MyContainer
systemctl stop MyContainer
- You should now have a working container. Time to login and setup the Debian minimal distribution. First I will perform a system update, followed by installing some key applications and also changing the root password.
Note: if you wish to change mirror please edit the /etc/apt/sources.list
from within the container.
/usr/bin/systemd-nspawn --keep-unit --boot --link-journal=host --directory=/var/lib/container/MyContainer
apt-get update
apt-get dist-upgrade
apt-get install ssh openssh-server sudo
passwd root
sed -i 's/Port 22/Port 2222/g' /etc/ssh/sshd_config
dpkg-reconfigure tzdata