Tvheadend on OpenWrt

Because I made an error (should be toolchain/install)

jeff@deb-devel:~/devel/openwrt$ make -j12 clean download toolchain/install world
 make[1] clean
time: target/linux/prereq#0.54#0.08#0.62
 make[1] tools/flock/compile
[...]

It did pop an error but it's still going. I've ran it with the V=s switch and something came up as '404 Not found' during the downloading stage.
Also, that -j4 switch is really hitting the CPU this time. It's maxing all 4 cores out at 100%.

make[2] -C package/network/services/odhcpd download
make[2] -C package/network/services/ppp download
make[2] -C package/network/utils/iptables download
make package/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make[1] target/download
make[2] -C target/linux download

Try -j3 instead to keep a little control over your machine, if you want. Yes, when I build it maxes out all cores at many points in the build!

I ran through the "vanilla image" here without error, so it might be something transient there.

[...]
 make[2] -C package/network/services/hostapd download
 make[2] -C package/network/services/odhcpd download
 make[2] -C package/network/services/ppp download
 make[2] -C package/network/utils/iptables download
 make[2] -C package/network/utils/iw download
 make[2] -C package/network/utils/iwinfo download
[...]
 make[3] -C package/boot/uboot-envtools compile
 make[2] package/install
 make[2] target/install
 make[3] -C target/linux install
 make[2] package/index
 make[2] checksum

and it failed once again. :frowning:

make[3] -C package/system/uci compile
make[3] -C package/utils/jsonfilter compile
make[3] -C package/system/usign compile
make[3] -C feeds/packages/multimedia/tvheadend compile
make[3] -C package/network/services/hostapd compile
make[3] -C package/libs/ustream-ssl compile
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/rob/dev/openwrt/include/toplevel.mk:227: world] Error 1
rob@rob-Aspire-5742:~/dev/openwrt$

make V=s

(Iā€™m guessing tvheadend)

Mips_24kc?

if [ -d /home/rob/dev/openwrt/tmp/stage-util-linux ]; then (cd /home/rob/dev/openwrt/tmp/stage-util-linux; find ./ > /home/rob/dev/openwrt/tmp/stage-util-linux.files); SHELL= flock /home/rob/dev/openwrt/tmp/.staging-dir.flock -c ' mv /home/rob/dev/openwrt/tmp/stage-util-linux.files /home/rob/dev/openwrt/staging_dir/target-mips_24kc_musl/packages/util-linux.list && cp -fpR /home/rob/dev/openwrt/tmp/stage-util-linux/* /home/rob/dev/openwrt/staging_dir/target-mips_24kc_musl/; '; fi
rm -rf /home/rob/dev/openwrt/tmp/stage-util-linux
touch /home/rob/dev/openwrt/staging_dir/target-mips_24kc_musl/stamp/.util-linux_installed
make[3]: Leaving directory '/home/rob/dev/openwrt/package/utils/util-linux'
time: package/utils/util-linux/compile#281.00#42.41#152.23
make[2]: Leaving directory '/home/rob/dev/openwrt'
make[1]: *** [package/Makefile:107: /home/rob/dev/openwrt/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/rob/dev/openwrt'
make: *** [/home/rob/dev/openwrt/include/toplevel.mk:227: world] Error 2

</> is the preformatted-text button -- that's the best way to paste "code" or output.

mips_24kc is the architecture, so that isn't a surprise.

I don't see the cause of the error there.

Let me take my current config "seed"

jeff@deb-devel:~/devel/openwrt$ ./scripts/diffconfig.sh 
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_netgear_wndr3700=y
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_CCACHE=y
CONFIG_DOWNLOAD_FOLDER="/home/jeff/devel/openwrt_dl"

and add the LuCi collection (I personally use the luci-ssl-nginx if I install LuCI, but I'm guessing you selected just "luci") and tvheadend to it with make menuconfig

The options for tvheadend I'm leaving alone.

Now I have

jeff@deb-devel:~/devel/openwrt$ ./scripts/diffconfig.sh 
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_netgear_wndr3700=y
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_CCACHE=y
CONFIG_DOWNLOAD_FOLDER="/home/jeff/devel/openwrt_dl"
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_tvheadend=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_zlib=y
CONFIG_TVHEADEND_CWC_SUPPORT=y
CONFIG_TVHEADEND_DVBSCAN_SUPPORT=y
CONFIG_TVHEADEND_LINUXDVB_SUPPORT=y

The reason it builds so much more quickly the second time around, even with "clean", is ccache "remembers" what it compiled before.

Since I know the toolchain is current, I'm running

make -j12 clean download world

clean -- get rid of old results
download -- make sure all the source is available
world -- then build the "default" target -- which is the set of images

That builds here -- with a warning -- remember that warnings are not errors!

 make[3] -C package/boot/uboot-envtools compile
 make[2] package/install
 make[2] target/install
 make[3] -C target/linux install
 make[2] package/index
WARNING: Applying padding in /home/jeff/devel/openwrt/bin/packages/mips_24kc/packages/Packages to workaround usign SHA-512 bug!
 make[2] checksum

In this case, I know the history of that specific warning, and know it isn't anything of concern.

If you copy my second diffconfig.sh output to your .config, you should be able to get a clean build.

Note that I haven't modified tvheadend at all


Next steps, while you're confirming you don't have any other problems.

I know that the feeds are git repos put in place under feeds/ so let me work on the one with tvheadend

jeff@deb-devel:~/devel/openwrt$ cd feeds/packages
jeff@deb-devel:~/devel/openwrt/feeds/packages$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

OK, that's what I expected for the feed (it's a git repo "inside" of the source tree)

Get onto a new branch to change tvheadend (warning -- it may be that running ./scripts/feeds update -a will wipe out my/your work)

jeff@deb-devel:~/devel/openwrt/feeds/packages$ git checkout -b tvheadend-update
Switched to a new branch 'tvheadend-update'

It's what is known as a "shallow" clone -- no history, and I want to look at the history of the patches

jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git fetch --unshallow
jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git log -- patches

shows me when any why the patches were added. Two around old OpenSSL APIs, one around compiler warning/errors. I'll risk it and remove them.

jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git rm patches/0*
rm 'multimedia/tvheadend/patches/010-openssl-deprecated.patch'
rm 'multimedia/tvheadend/patches/020-strncpy-issue.patch'
jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git commit
[tvheadend-update d6c792c2b] Remove patches for now
 2 files changed, 55 deletions(-)
 delete mode 100644 multimedia/tvheadend/patches/010-openssl-deprecated.patch
 delete mode 100644 multimedia/tvheadend/patches/020-strncpy-issue.patch
 curl https://github.com/tvheadend/tvheadend/archive/v4.2.8.tar.gz | sha256sum 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   127    0   127    0     0    526      0 --:--:-- --:--:-- --:--:--   524
f596174d36a8b7c44de0a63f47adc5c155997607dcd1a466d7ddc142301a2bd5  -

There's the hash we need. (Edit: This was later determined to be the wrong URL)

Make the changes, check them before commit

$ git diff
diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile
index 9108b9296..c6e078470 100644
--- a/multimedia/tvheadend/Makefile
+++ b/multimedia/tvheadend/Makefile
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tvheadend
-PKG_VERSION:=4.0.10
-PKG_RELEASE:=4
+PKG_VERSION:=4.2.8
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/tvheadend/tvheadend/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=f610e7d9f3bf6cff05cd73830a66ee0c74bc5291c4c9d08369364c4c681ebf23
+PKG_HASH:=f596174d36a8b7c44de0a63f47adc5c155997607dcd1a466d7ddc142301a2bd5
+
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=LICENSE.md

and commit

jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git add -u
jeff@deb-devel:~/devel/openwrt/feeds/packages/multimedia/tvheadend$ git commit

(These are all local commits -- nothing is going back to the project)

Go back to the root directory and cross my fingers

jeff@deb-devel:~/devel/openwrt-mtk$ make -j12 clean download world
 make[3] -C feeds/packages/multimedia/tvheadend compile
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/jeff/devel/openwrt/include/toplevel.mk:227: world] Error 1

Bah! (Though not surprising)

jeff@deb-devel:~/devel/openwrt$ make package/tvheadend/compile V=s

OK, I messed up the hash, it seems

SHELL= flock /home/jeff/devel/openwrt/tmp/.tvheadend-4.2.8.tar.gz.flock -c '  	/home/jeff/devel/openwrt/scripts/download.pl "/home/jeff/devel/openwrt_dl" "tvheadend-4.2.8.tar.gz" "f596174d36a8b7c44de0a63f47adc5c155997607dcd1a466d7ddc142301a2bd5" "" "https://codeload.github.com/tvheadend/tvheadend/tar.gz/v4.2.8?"    '
+ curl -f --connect-timeout 20 --retry 5 --location --insecure https://codeload.github.com/tvheadend/tvheadend/tar.gz/v4.2.8?/tvheadend-4.2.8.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.8M  100 20.8M    0     0  19.0M      0  0:00:01  0:00:01 --:--:-- 19.0M
Hash of the downloaded file does not match (file: 1aef889373d5fad2a7bd2f139156d4d5e34a64b6d38b87b868a2df415f01f7ad, requested: f596174d36a8b7c44de0a63f47adc5c155997607dcd1a466d7ddc142301a2bd5) - deleting download.

codeload.github.com vs. github.com -- fix and now try again

Next problem:

INSTALLROOT=/home/jeff/devel/openwrt/build_dir/target-mips_24kc_musl/tvheadend-4.2.8/build.linux/ffmpeg/build \
	make -C /home/jeff/devel/openwrt/build_dir/target-mips_24kc_musl/tvheadend-4.2.8/build.linux/ffmpeg/nasm-2.13.03 install

ffmpeg rings warning bells in my head -- I'm not sure it builds properly

and onto the first build error

make[5]: Entering directory '/home/jeff/devel/openwrt/build_dir/target-mips_24kc_musl/tvheadend-4.2.8/build.linux/ffmpeg/nasm-2.13.03'

[..]
nasmlib/realpath.c: In function 'nasm_realpath':
nasmlib/realpath.c:60:16: error: implicit declaration of function 'canonicalize_file_name' [-Werror=implicit-function-declaration]
     char *rp = canonicalize_file_name(rel_path);
                ^~~~~~~~~~~~~~~~~~~~~~
nasmlib/realpath.c:60:16: warning: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors

This looks non-trivial and not related to either of the two patches.


Things aren't looking good. A quick Internet search led to

Fix building under musl-libc with canonicalize_file_name()
https://bugs.freedesktop.org/show_bug.cgi?id=99944

which suggests that tvheadend is calling a function that isn't supported by the C library ("musl") used by OpenWrt and many other space-constrained OSes.

OK, is it somewhere else?

3 Likes

Finding canonicalize_file_name

The package is extracted into build_dir/target-mips_24kc_musl/tvheadend-4.2.8/

so, given there's a functional implementation in that patch, we need to answer either

  • Where does it need to be inserted, or
  • Why is it being called at all (since I "cheated" and already found that autoconf checks for it)
jeff@deb-devel:~/devel/openwrt/build_dir/target-mips_24kc_musl/tvheadend-4.2.8$ fgrep -r canonicalize_file_name .
./build.linux/ffmpeg/nasm-2.13.03/config/config.h:/* Define to 1 if you have the `canonicalize_file_name' function. */
./build.linux/ffmpeg/nasm-2.13.03/config/config.h.in:/* Define to 1 if you have the `canonicalize_file_name' function. */
./build.linux/ffmpeg/nasm-2.13.03/configure:for ac_func in canonicalize_file_name
./build.linux/ffmpeg/nasm-2.13.03/configure:  ac_fn_c_check_func "$LINENO" "canonicalize_file_name" "ac_cv_func_canonicalize_file_name"
./build.linux/ffmpeg/nasm-2.13.03/configure:if test "x$ac_cv_func_canonicalize_file_name" = xyes; then :
./build.linux/ffmpeg/nasm-2.13.03/nasmlib/realpath.c:    char *rp = canonicalize_file_name(rel_path);
./build.linux/ffmpeg/nasm-2.13.03/config.log:configure:6154: checking for canonicalize_file_name
./build.linux/ffmpeg/nasm-2.13.03/config.log:ac_cv_func_canonicalize_file_name=yes
./build.linux/ffmpeg/nasm-2.13.03/configure.ac:AC_CHECK_FUNCS(canonicalize_file_name)

The config.log and configure.ac entries I recognize as the GNU "autotools" which are supposed to detect what the system has or not, and make adjustments.

Well, clearly they didn't, from

$ fgrep -r HAVE_CANONICALIZE_FILE_NAME
build.linux/ffmpeg/nasm-2.13.03/config/config.h:#define HAVE_CANONICALIZE_FILE_NAME 1
build.linux/ffmpeg/nasm-2.13.03/config/config.h.in:#undef HAVE_CANONICALIZE_FILE_NAME
build.linux/ffmpeg/nasm-2.13.03/configure:#define HAVE_CANONICALIZE_FILE_NAME 1
build.linux/ffmpeg/nasm-2.13.03/config.status:D["HAVE_CANONICALIZE_FILE_NAME"]=" 1"
build.linux/ffmpeg/nasm-2.13.03/nasmlib/realpath.c:#ifdef HAVE_CANONICALIZE_FILE_NAME
build.linux/ffmpeg/nasm-2.13.03/config.log:| #define HAVE_CANONICALIZE_FILE_NAME 1
[...]

The Makefile already includes PKG_FIXUP:=autoreconf

I have CONFIG_BUILD_LOG=y set in my config

jeff@deb-devel:~/devel/openwrt$ fgrep -i canonicalize logs/package/feeds/packages/tvheadend/*
logs/package/feeds/packages/tvheadend/compile.txt:checking for canonicalize_file_name... yes
logs/package/feeds/packages/tvheadend/compile.txt:nasmlib/realpath.c:60:16: error: implicit declaration of function 'canonicalize_file_name' [-Werror=implicit-function-declaration]
logs/package/feeds/packages/tvheadend/compile.txt:     char *rp = canonicalize_file_name(rel_path);

So, for some reason, autoconf believes

checking for canonicalize_file_name... yes

which seems wrong!

jeff@deb-devel:~/devel/openwrt$ fgrep -ri canonicalize_file_name build_dir/toolchain-mips_24kc_gcc-8.3.0_musl/musl*
jeff@deb-devel:~/devel/openwrt$

If you know packages better than I, suggestions are welcome

"Inner" build's autoconf seems to be the problem

It isn't even the source of tvheadend that is failing to be configured properly, but the ffmpeg static libraries are buily within the tvheadend build by Makefile.ffmpeg

The OpenWrt Makefile already includes PKG_FIXUP:=autoreconf

My apologies, I'm stuck here on how to get the inner build to recognize that it's being cross-compiled properly.

$ git diff --name-status master
M       multimedia/tvheadend/Makefile
D       multimedia/tvheadend/patches/010-openssl-deprecated.patch
D       multimedia/tvheadend/patches/020-strncpy-issue.patch
diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile
index 9108b9296..b05c7763a 100644
--- a/multimedia/tvheadend/Makefile
+++ b/multimedia/tvheadend/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tvheadend
-PKG_VERSION:=4.0.10
-PKG_RELEASE:=4
+PKG_VERSION:=4.2.8
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/tvheadend/tvheadend/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=f610e7d9f3bf6cff05cd73830a66ee0c74bc5291c4c9d08369364c4c681ebf23
+PKG_HASH:=1aef889373d5fad2a7bd2f139156d4d5e34a64b6d38b87b868a2df415f01f7ad
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=LICENSE.md

Edit: This mess of source code with integrated build system may well be why the package hasn't been updated!

You lost me at the first post about ./scripts/diffconfig.sh.
Mine looks different than yours.

CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_netgear_wndr3700=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
# CONFIG_PACKAGE_kmod-leds-reset is not set
# CONFIG_PACKAGE_kmod-nls-base is not set
# CONFIG_PACKAGE_kmod-owl-loader is not set
# CONFIG_PACKAGE_kmod-usb-core is not set
# CONFIG_PACKAGE_kmod-usb-ledtrig-usbport is not set
# CONFIG_PACKAGE_kmod-usb-ohci is not set
# CONFIG_PACKAGE_kmod-usb2 is not set
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_tvheadend=y
CONFIG_PACKAGE_zlib=y
CONFIG_TVHEADEND_CWC_SUPPORT=y
CONFIG_TVHEADEND_DVBSCAN_SUPPORT=y
CONFIG_TVHEADEND_LINUXDVB_SUPPORT=y

How do I change it to look the same as yours?

The main difference is probably LuCI included when I ran a test build.

You could copy that "config seed" (the output of ./scripts/diffconfig.sh) to .config and then run either

make defconfig

or

make menuconfig    # and just exit

I wouldn't hold out a lot of hope for running a current version of tvheadend. If you really want to run it, I'd suggest separate hardware running an OS that the tvheadend team directly supports.

1 Like
<example> chroot workaround option for armhf (@15%of512MB~idle)
################################################
#     armhf(native ipq806x) w usboverlay !500MB!
################################################
opkg update
opkg install debootstrap coreutils-chroot


mkdir /stretch
debootstrap --no-check-gpg --arch=armhf --variant=minbase stretch /stretch http://ftp.us.debian.org/debian
cp /tmp/resolv.conf.auto /stretch/etc/resolv.conf

mount /dev /stretch/dev
mount /proc /stretch/proc
mount /dev/pts/ /stretch/dev/pts/

chroot /stretch apt install -y --allow-unauthenticated --no-install-recommends ifupdown iproute2 isc-dhcp-client netbase
chroot /stretch apt install -y --allow-unauthenticated --no-install-recommends vim lsof


cat << EOF >> /stretch/etc/apt/sources.list
deb http://ftp.be.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.be.debian.org/debian/ stretch main contrib non-free
deb http://apt.tvheadend.org/stable raspbian-stretch main
EOF

chroot /stretch apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 89942AAE5CEAA174
chroot /stretch apt-get update
chroot /stretch apt-get install tvheadend


chroot /stretch service tvheadend restart
chroot /stretch lsof -i -nP | grep 'tvheadend'


#tvheadend 7402    hts    6u  IPv4  86394      0t0  TCP *:9981 (LISTEN)
#tvheadend 7402    hts    7u  IPv4  86397      0t0  TCP *:9982 (LISTEN)
#tvheadend 7402    hts   27u  IPv4  86409      0t0  UDP 239.255.255.250:1900 
#tvheadend 7402    hts   28u  IPv4  86412      0t0  UDP *:39119
1 Like

As usual, it failed.

 make[1] clean
 make[1] tools/download
 make[2] -C tools/gmp download
 make[2] -C tools/mpfr download
 make[2] -C tools/mpc download
 make[2] target/prereq
 make[3] -C target/linux prereq
make tools/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
 make[1] toolchain/download
 make[2] -C toolchain/kernel-headers download
 make[2] -C toolchain/binutils download
 make[2] -C toolchain/gcc/initial download
 make[2] target/prereq
 make[3] -C target/linux prereq
make toolchain/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
 make[1] package/download
 make[2] -C feeds/luci/collections/luci download
 make[2] -C feeds/luci/applications/luci-app-firewall download
 make[2] -C feeds/luci/applications/luci-app-opkg download
 make[2] -C feeds/luci/modules/luci-base download
 make[2] -C feeds/luci/libs/luci-lib-ip download
 make[2] -C feeds/luci/libs/luci-lib-jsonc download
 make[2] -C feeds/luci/libs/luci-lib-nixio download
 make[2] -C feeds/luci/modules/luci-mod-admin-full download
 make[2] -C feeds/luci/modules/luci-mod-network download
 make[2] -C feeds/luci/modules/luci-mod-status download
 make[2] -C feeds/luci/modules/luci-mod-system download
 make[2] -C feeds/luci/protocols/luci-proto-ipv6 download
make package/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
 make[1] target/download
 make[2] -C target/linux download
make target/download: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/rob/dev/openwrt/include/toplevel.mk:199: download] Error 1

You seem to have persistent connectivity problems that probably have nothing to do with the build system.

It is an old system. Maybe it couldn't do it?

Within reason (RAM (>=4 GB)/ disk size (>20 GB free space); 64 bit OS strongly preferred) the age of your build host doesn't matter at all, it might 'just' test your patience. The age and type of the OS/ distribution on your buildhost matters more, but even there are wide ranges (Debian oldoldstable would still do).

2 Likes

6GB RAM and an 120GB SSD with Ubuntu 19.10 so it should work. Oh well, what ever. Could be something else that's not happy.

G'day,
Thanks for the hint. Since recording requires a storage device anyway, I added a debian buster chroot to that storage and compiled tvheadend within the chroot@storage@target (TP-Link Archer C2600).

I had to disable h.265 and VP9, due to build issues, though. This does not matter (yet), because no relevant station on Astra 19.2 uses these codecs yet (see: https://www.satbeams.com/channels?position=19)

mount -t proc proc "/mnt/sda1/debian/proc"
mount --bind /mnt/sda1 /mnt/sda1/debian/mnt/sda1

chroot "/mnt/sda1/debian/" /bin/bash

apt install build-essential git python pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev

git clone https://github.com/tvheadend/tvheadend.git
cd tvheadend
./configure --disable-libx265 --disable-libvpx
make
make install

/usr/local/bin/tvheadend --satip_xml http://sat.lan:38400/description.xml --noacl
# after configuring the usernames and passwords
/usr/local/bin/tvheadend --satip_xml http://sat.lan:38400/description.xml
2 Likes

Hi, I'm not familiar with linux, I use openwrt following tutorial, but only as a vpn server with wireguard or openvpn, programs like aria2 transmission and others, but if I understand correctly you have installed debian on an openwrt router? and then did you even install tvheadend from sources on the same router? a tutorial on this topic would be nice

Nearly!
It is the OpenWRT Linux kernel and the userland (~applications + files) is a minimal Debian environment. After "chrooting" into that Debian folder you have all the common Debian programs, even apt to maintain and update your userland. Not too resource hungry programs can be run in this environment, TVHeadend is OK as long as you do not need to convert (transcode) video from the native format as broadcasted to another format. That would be too much for a typical WiFi Router to do it in realtime. If you can wait it works but it is about ten times to slow for realtime even for low resolution broadcasts.

The coarse steps are:

  • PC: Get an USB storage (large USB Stick or harddisk will do, it should have at least a couple of GB)
  • PC: Format and mount it
  • PC: Download the debian userland for a the router processor architecture: sudo debootstrap --foreign --arch=armhf buster buster-armhf
  • Plug the USB storage into the WiFi Routers USB port
  • Router: Mount the USB storage to /mnt/sda1
  • Router: mount -t proc proc "/mnt/sda1/debian/proc"
  • Router: chroot "/mnt/sda1/debian/" /bin/bash
  • Router: apt ... (commands as above)

There certainly are gaps in that description, but coarsly that is an easy way to quickly run Debian-Userland at your router. Not all processor architectures are supported, to check that first if Debian supports your architecture of your Wifi-Router.

The proper way is to cross-compile the programs and make it an OPKG packet, but there are many ways to achieve goals.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.