1

Context

I have a set-top-box Octagon SF4008, which is designed to run OpenEmbedded-based Linux distributions. I currently have openATV installed on it.

Typically, users want to connect the video output of such set-top-boxes to a display and then they want to watch the channels via a front-end GUI like Enigma2.

My use case is different. I would like to stream the channels over the computer network. I could use Enigma2 for that, but I consider Tvheadend to be more user-friendly and more feature-rich.

Question

I would like to run Tvheadend directly on the set-top-box and I am looking for a simple way to install it there.

Options

The package manager used by openATV is opkg. The preconfigured repositories contain many Enigma2-specific packages, but only very few generic ones like perl, python, vim and similar. There is no Tvheadend package in there, nor in any other opkg-compatible repository for the compatible architecture (armv7l/armhf) that I am aware of.

The preconfigured repositories contain no build tools like make, no compilers and no development versions of the basic libraries. So, compiling Tvheadend directly on the set-top-box would require quite a complex setup. It is definitely possible and perhaps easier to cross-compile it elsewhere. However, I would prefer to use precompiled binaries.

I know that Tvheadend provides APT repositories with Debian packages for the compatible armhf architecture. I also found out that opkg can handle installing .deb files. However, because of the runtime dependencies, foreign packages would only work properly when all of their native dependencies are installed as well.

Perhaps I could install Debian on the set-top-box directly. There is a flashing procedure which includes rewriting the kernel image and then extracting an archive of the root file system. I am not familiar with the bootloader and I do not know whether or how it needs to be modified in order to properly boot a standard Linux kernel. Moreover, the custom hardware drivers may at first need to be extracted from the currently running Linux kernel.

Problem

The above mentioned options may all work, but I consider them to be unnecessarily complex. I believe that there should be a simpler way. Perhaps the already mentioned options can be simplified. Or maybe there is a much simpler way of which I am just not aware.

1

There is a simpler way.

Instead of trying to boot into a different Linux distribution, use the existing Linux kernel and a chroot environment. There is no need to modify the bootloader or to port the custom hardware drivers to a new kernel.

One of the simple ways to create a suitable chroot environment is to bootstrap a clean system. Debian community provides a tool exactly for this purpose. It is called debootstrap.

1

If cross-compiling is acceptable, one of the ways to do it is to use oe-alliance's build enviroment:

  1. Use git to clone the build-environment repository and switch to some recent branch, e.g. 4.3.
  2. Check if there is a Bitbake recipe for tvheadend. It should be located at meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb. If it is not there, update the meta-openembedded submodule to the latest master branch from origin, which should contain it.
  3. Install build dependencies, for instance using this guide from openembedded.
  4. Build your preferred image for Octagon SF4008, for instance like this: MACHINE=sf4008 DISTRO=openatv DISTRO_TYPE=release make image. This takes hours to complete, but when finished, it should result in a zip file suitable for USB flashing at path similar to builds/openatv/release/sf4008/tmp/deploy/images/sf4008/openatv-6.3-sf4008-20181219_usb.zip.
  5. Activate the bitbake build environment by using commands similar to:

    $ cd builds/openatv/release/sf4008/
    $ . env.source
    
  6. Build tvheadend without dependencies by running bitbake -b tvheadend. It should create ipk packages at a location similar to: tmp/deploy/ipk/cortexa15hf-neon-vfpv4/tvheadend_4.3+git10608+dd37467-r0_cortexa15hf-neon-vfpv4.ipk

It should then be possible to install the created package on your receiver directly. Some of its dependencies may be missing from the upstream repositories. In such case, compile them using bitbake (i.e. bitbake -b package_name) and then install them manually.

Using a custom image ensures that tvheadend's runtime dependencies are met. However, it may be possible to use a pre-built image as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.