From db9ebb0ecaac5e08d190924b40bac7c5df85a579 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Jan 2021 17:15:30 +0100 Subject: [PATCH] - add minisatip, dvb-apps and libdvbcsa --- make/ni.mk | 1 + make/target-libs.mk | 26 ++++++++- make/target-tools.mk | 56 +++++++++++++++++++ .../dvb-apps/0001-Fix-generate-keynames.patch | 35 ++++++++++++ ...ate-Remove-Obsoleted-stime-API-calls.patch | 32 +++++++++++ ...0003-handle-static-shared-only-build.patch | 44 +++++++++++++++ .../dvb-apps/0004-Makefile-remove-test.patch | 27 +++++++++ .../0005-libucsi-optimization-removal.patch | 13 +++++ patches/dvb-apps/0006-CA_SET_PID.patch | 24 ++++++++ .../minisatip/0001-change-bootid-path.patch | 22 ++++++++ skel-root/general/scripts/minisatip.init | 40 +++++++++++++ 11 files changed, 318 insertions(+), 2 deletions(-) create mode 100644 patches/dvb-apps/0001-Fix-generate-keynames.patch create mode 100644 patches/dvb-apps/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch create mode 100644 patches/dvb-apps/0003-handle-static-shared-only-build.patch create mode 100644 patches/dvb-apps/0004-Makefile-remove-test.patch create mode 100644 patches/dvb-apps/0005-libucsi-optimization-removal.patch create mode 100644 patches/dvb-apps/0006-CA_SET_PID.patch create mode 100644 patches/minisatip/0001-change-bootid-path.patch create mode 100644 skel-root/general/scripts/minisatip.init diff --git a/make/ni.mk b/make/ni.mk index a14f9f8b..2f17292f 100644 --- a/make/ni.mk +++ b/make/ni.mk @@ -71,6 +71,7 @@ ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2 hd5x hd6x vusolo4k vuduo4k vuduo4ks $(MAKE) iperf $(MAKE) minicom $(MAKE) minidlna + $(MAKE) minisatip $(MAKE) mc endif ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd5x hd6x vusolo4k vuduo4k vuduo4kse vuultimo4k vuzero4k vuuno4k vuuno4kse vuduo)) diff --git a/make/target-libs.mk b/make/target-libs.mk index 4446e378..ddb76e51 100644 --- a/make/target-libs.mk +++ b/make/target-libs.mk @@ -84,7 +84,7 @@ libupnp: $(DL_DIR)/$(LIBUPNP_SOURCE) | $(TARGET_DIR) --disable-static \ ; \ $(MAKE); \ - $(MAKE) install DESTDIR=$(TARGET_DIR); \ + $(MAKE) install DESTDIR=$(TARGET_DIR) $(REWRITE_LIBTOOL_LA) $(REMOVE)/$(LIBUPNP_DIR) $(TOUCH) @@ -111,13 +111,35 @@ libdvbsi: | $(TARGET_DIR) --disable-static \ ; \ $(MAKE); \ - $(MAKE) install DESTDIR=$(TARGET_DIR); \ + $(MAKE) install DESTDIR=$(TARGET_DIR) $(REWRITE_LIBTOOL_LA) $(REMOVE)/$(LIBDVBSI_DIR) $(TOUCH) # ----------------------------------------------------------------------------- +LIBDVBCSA_VER = git +LIBDVBCSA_DIR = libdvbcsa.$(LIBDVBCSA_VER) +LIBDVBCSA_SOURCE = libdvbcsa.$(LIBDVBCSA_VER) +LIBDVBCSA_SITE = https://code.videolan.org/videolan + +libdvbcsa: | $(TARGET_DIR) + $(REMOVE)/$(LIBDVBCSA_DIR) + $(GET-GIT-SOURCE) $(LIBDVBCSA_SITE)/$(LIBDVBCSA_SOURCE) $(DL_DIR)/$(LIBDVBCSA_SOURCE) + $(CPDIR)/$(LIBDVBCSA_SOURCE) + $(CHDIR)/$(LIBDVBCSA_DIR); \ + ./bootstrap; \ + $(CONFIGURE) \ + --prefix=$(prefix) \ + ; \ + $(MAKE); \ + $(MAKE) install DESTDIR=$(TARGET_DIR) + $(REWRITE_LIBTOOL_LA) + $(REMOVE)/$(LIBDVBCSA_DIR) + $(TOUCH) + +# ----------------------------------------------------------------------------- + GIFLIB_VER = 5.2.1 GIFLIB_DIR = giflib-$(GIFLIB_VER) GIFLIB_SOURCE = giflib-$(GIFLIB_VER).tar.gz diff --git a/make/target-tools.mk b/make/target-tools.mk index 3cc6547e..b7ec15e5 100644 --- a/make/target-tools.mk +++ b/make/target-tools.mk @@ -1890,6 +1890,62 @@ dvbsnoop: | $(TARGET_DIR) # ----------------------------------------------------------------------------- +DVB-APPS_VER = git +DVB-APPS_DIR = dvb-apps.$(DVB-APPS_VER) +DVB-APPS_SOURCE = dvb-apps.$(DVB-APPS_VER) +DVB-APPS_SITE = https://github.com/openpli-arm + +DVB-APPS_DEPS = kernel libiconv + +DVB-APPS_MAKE_OPTS = \ + enable_shared=no \ + PERL5LIB=$(PKG_BUILD_DIR)/util/scan \ + +dvb-apps: $(DVB-APPS_DEPS) | $(TARGET_DIR) + $(REMOVE)/$(DVB-APPS_DIR) + $(GET-GIT-SOURCE) $(DVB-APPS_SITE)/$(DVB-APPS_SOURCE) $(DL_DIR)/$(DVB-APPS_SOURCE) + $(CPDIR)/$(DVB-APPS_SOURCE) + $(CHDIR)/$(DVB-APPS_DIR); \ + $(APPLY_PATCHES); \ + $(MAKE_ENV) LDLIBS="-liconv" \ + $(MAKE) $(DVB-APPS_MAKE_OPTS) TARGET_DIR=$(TARGET_DIR); \ + $(MAKE) $(DVB-APPS_MAKE_OPTS) install DESTDIR=$(TARGET_DIR) + $(REMOVE)/$(DVB-APPS_DIR) + $(TOUCH) + +# ----------------------------------------------------------------------------- + +MINISATIP_VER = git +MINISATIP_DIR = minisatip.$(MINISATIP_VER) +MINISATIP_SOURCE = minisatip.$(MINISATIP_VER) +MINISATIP_SITE = https://github.com/catalinii + +MINISATIP_DEPS = libdvbcsa openssl dvb-apps + +minisatip: $(MINISATIP_DEPS) | $(TARGET_DIR) + $(REMOVE)/$(MINISATIP_DIR) + $(GET-GIT-SOURCE) $(MINISATIP_SITE)/$(MINISATIP_SOURCE) $(DL_DIR)/$(MINISATIP_SOURCE) + $(CPDIR)/$(MINISATIP_SOURCE) + $(CHDIR)/$(MINISATIP_DIR); \ + $(CONFIGURE) \ + --prefix=$(prefix) \ + --enable-static \ + --enable-enigma \ + ; \ + $(MAKE_ENV) \ + $(MAKE) + $(INSTALL_EXEC) -D $(PKG_BUILD_DIR)/minisatip $(TARGET_bindir)/minisatip + $(INSTALL) -d $(TARGET_datadir)/minisatip + $(INSTALL_COPY) $(PKG_BUILD_DIR)/html $(TARGET_datadir)/minisatip + $(INSTALL) -d $(TARGET_sysconfdir)/default + echo 'MINISATIP_OPTS="-x 9090 -t -o /tmp/camd.socket"' > $(TARGET_sysconfdir)/default/minisatip + $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/minisatip.init $(TARGET_sysconfdir)/init.d/minisatip + $(UPDATE-RC.D) minisatip defaults 75 25 + $(REMOVE)/$(MINISATIP_DIR) + $(TOUCH) + +# ----------------------------------------------------------------------------- + ETHTOOL_VER = 5.10 ETHTOOL_DIR = ethtool-$(ETHTOOL_VER) ETHTOOL_SOURCE = ethtool-$(ETHTOOL_VER).tar.xz diff --git a/patches/dvb-apps/0001-Fix-generate-keynames.patch b/patches/dvb-apps/0001-Fix-generate-keynames.patch new file mode 100644 index 00000000..59958f88 --- /dev/null +++ b/patches/dvb-apps/0001-Fix-generate-keynames.patch @@ -0,0 +1,35 @@ +diff --git a/Makefile b/Makefile +index 65a2273..34ae964 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + # Makefile for linuxtv.org dvb-apps + + # get DVB API version +-VERSION_FILE := "/usr/include/linux/dvb/version.h" ++VERSION_FILE := "$(TARGET_DIR)/usr/include/linux/dvb/version.h" + + DVB_API_MAJOR := $(word 3, $(shell grep -m1 "DVB_API_VERSION" $(VERSION_FILE)) ) + DVB_API_MINOR := $(word 3, $(shell grep -m1 "DVB_API_VERSION_MINOR" $(VERSION_FILE)) ) +diff --git a/util/av7110_loadkeys/generate-keynames.sh b/util/av7110_loadkeys/generate-keynames.sh +index 49d2b71..3633bc7 100644 +--- a/util/av7110_loadkeys/generate-keynames.sh ++++ b/util/av7110_loadkeys/generate-keynames.sh +@@ -18,7 +18,7 @@ echo "};" >> $1 + echo >> $1 + echo >> $1 + echo "static struct input_key_name key_name [] = {" >> $1 +-for x in $(cat /usr/include/linux/input.h input_fake.h | \ ++for x in $(cat ${TARGET_DIR}/usr/include/linux/input.h input_fake.h | \ + egrep "#define[ \t]+KEY_" | grep -v KEY_MAX | \ + cut -f 1 | cut -f 2 -d " " | sort -u) ; do + echo " { \"$(echo $x | cut -b 5-)\", $x }," >> $1 +@@ -26,7 +26,7 @@ done + echo "};" >> $1 + echo >> $1 + echo "static struct input_key_name btn_name [] = {" >> $1 +-for x in $(cat /usr/include/linux/input.h input_fake.h | \ ++for x in $(cat ${TARGET_DIR}/usr/include/linux/input.h input_fake.h | \ + egrep "#define[ \t]+BTN_" | \ + cut -f 1 | cut -f 2 -d " " | sort -u) ; do + echo " { \"$(echo $x | cut -b 5-)\", $x }," >> $1 diff --git a/patches/dvb-apps/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch b/patches/dvb-apps/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch new file mode 100644 index 00000000..9035b56f --- /dev/null +++ b/patches/dvb-apps/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch @@ -0,0 +1,32 @@ +From d6817dbaf407f65dd4af12c51736153fae8b217f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 Dec 2019 08:36:11 -0800 +Subject: [PATCH] dvbdate: Remove Obsoleted stime API calls + +stime() has been deprecated in glibc 2.31+ its recommended to +replaced with clock_settime() + +Signed-off-by: Khem Raj +--- + util/dvbdate/dvbdate.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/util/dvbdate/dvbdate.c b/util/dvbdate/dvbdate.c +index f0df437..492ed79 100644 +--- a/util/dvbdate/dvbdate.c ++++ b/util/dvbdate/dvbdate.c +@@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsigned int to) + */ + int set_time(time_t * new_time) + { +- if (stime(new_time)) { ++ struct timespec ts; ++ ts.tv_sec = &new_time; ++ ts.tv_nsec = 0; ++ if (clock_settime(CLOCK_REALTIME, &ts)) { + perror("Unable to set time"); + return -1; + } +-- +2.24.1 + diff --git a/patches/dvb-apps/0003-handle-static-shared-only-build.patch b/patches/dvb-apps/0003-handle-static-shared-only-build.patch new file mode 100644 index 00000000..1ab22aed --- /dev/null +++ b/patches/dvb-apps/0003-handle-static-shared-only-build.patch @@ -0,0 +1,44 @@ +From a826c7c722db40bfedf00e51ce38411550ae8216 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Thu, 25 Dec 2014 19:22:16 +0100 +Subject: [PATCH] Make.rules: Handle static/shared only build + +Do not build .a library when enable_static is set to "no" +Do not build .so library when enable_shared is set to "no" + +Signed-off-by: Romain Naour +--- + Make.rules | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/Make.rules b/Make.rules +index 3410d7b..d274e16 100644 +--- a/Make.rules ++++ b/Make.rules +@@ -10,7 +10,13 @@ + CFLAGS += $(CFLAGS_LIB) + + #libraries = $(lib_name).so $(lib_name).a +-libraries = $(lib_name).a ++ifneq ($(enable_static),no) ++libraries += $(lib_name).a ++endif ++ ++ifneq ($(enable_shared),no) ++libraries += $(lib_name).so ++endif + + .PHONY: library + +@@ -24,7 +30,7 @@ + + .PHONY: clean install + +-ifeq ($(static),1) ++ifneq ($(enable_static),no) + LDFLAGS += -static + endif + +-- +1.9.3 + diff --git a/patches/dvb-apps/0004-Makefile-remove-test.patch b/patches/dvb-apps/0004-Makefile-remove-test.patch new file mode 100644 index 00000000..45bfad91 --- /dev/null +++ b/patches/dvb-apps/0004-Makefile-remove-test.patch @@ -0,0 +1,27 @@ +From c578772d6abc5fdf3ec83f632c371373e5baf9f1 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Fri, 26 Dec 2014 01:04:58 +0100 +Subject: [PATCH] Makefile: remove test + +Tests needs static libraries, remove them for shared only build. + +Signed-off-by: Romain Naour +--- + Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 65a2273..105c460 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,7 +10,6 @@ DVB_API_MINOR := $(word 3, $(shell grep -m1 "DVB_API_VERSION_MINOR" $(VERSION_FI + + all clean install: + $(MAKE) -C lib $@ +- $(MAKE) -C test $@ + $(MAKE) -C util $@ + + update: +-- +1.9.3 + diff --git a/patches/dvb-apps/0005-libucsi-optimization-removal.patch b/patches/dvb-apps/0005-libucsi-optimization-removal.patch new file mode 100644 index 00000000..f12d35bc --- /dev/null +++ b/patches/dvb-apps/0005-libucsi-optimization-removal.patch @@ -0,0 +1,13 @@ +diff -r 3d43b280298c lib/libucsi/endianops.h +--- a/lib/libucsi/endianops.h Fri Mar 21 20:26:36 2014 +0100 ++++ b/lib/libucsi/endianops.h Fri Jan 19 06:56:15 2018 +0000 +@@ -33,6 +33,9 @@ + #define __ucsi_packed __attribute__((packed)) + + ++#if __GNUC__ >= 6 + (0 >= __GNUC_MINOR__) ++#pragma GCC optimize ("O1") ++#endif + + + #if __BYTE_ORDER == __BIG_ENDIAN diff --git a/patches/dvb-apps/0006-CA_SET_PID.patch b/patches/dvb-apps/0006-CA_SET_PID.patch new file mode 100644 index 00000000..e100c659 --- /dev/null +++ b/patches/dvb-apps/0006-CA_SET_PID.patch @@ -0,0 +1,24 @@ +Index: dvb-apps/util/dst-utils/dst_test.c +=================================================================== +--- dvb-apps.orig/util/dst-utils/dst_test.c ++++ dvb-apps/util/dst-utils/dst_test.c +@@ -35,7 +35,18 @@ + #include + + #define CA_NODE "/dev/dvb/adapter0/ca0" +- ++/* ++ Quick hack around the removal of ca_pid_t and CA_GET_PID in recent kernels ++ https://github.com/torvalds/linux/commit/833ff5e7feda1a042b83e82208cef3d212ca0ef1 ++*/ ++#ifndef CA_SET_PID ++typedef struct ca_pid { ++ unsigned int pid; ++ int index; /* -1 == disable*/ ++} ca_pid_t; ++/* We should not be able to get it so a number that is unlikely to happen */ ++#define CA_SET_PID 42424242 ++#endif + static int dst_comms(int cafd, uint32_t tag, uint32_t function, struct ca_msg *msg) + { + if (tag) { diff --git a/patches/minisatip/0001-change-bootid-path.patch b/patches/minisatip/0001-change-bootid-path.patch new file mode 100644 index 00000000..4e1ff67d --- /dev/null +++ b/patches/minisatip/0001-change-bootid-path.patch @@ -0,0 +1,22 @@ +diff --git a/src/minisatip.c b/src/minisatip.c +index 626cd27..1eee479 100644 +--- a/src/minisatip.c ++++ b/src/minisatip.c +@@ -1863,7 +1863,7 @@ int main(int argc, char *argv[]) { + int readBootID() { + int did = 0; + opts.bootid = 0; +- FILE *f = fopen("bootid", "rt"); ++ FILE *f = fopen("/tmp/bootid", "rt"); + __attribute__((unused)) int rv; + if (f) { + rv = fscanf(f, "%d %d", &opts.bootid, &did); +@@ -1874,7 +1874,7 @@ int readBootID() { + opts.bootid++; + if (opts.device_id < 1) + opts.device_id = 1; +- f = fopen("bootid", "wt"); ++ f = fopen("/tmp/bootid", "wt"); + if (f) { + fprintf(f, "%d %d", opts.bootid, opts.device_id); + fclose(f); diff --git a/skel-root/general/scripts/minisatip.init b/skel-root/general/scripts/minisatip.init new file mode 100644 index 00000000..fd7176ce --- /dev/null +++ b/skel-root/general/scripts/minisatip.init @@ -0,0 +1,40 @@ +#!/bin/sh + +. /etc/init.d/globals + +if [ -e /etc/default/minisatip ]; then + . /etc/default/minisatip +fi + +start() { + if [ -e /var/etc/.minisatip ]; then + minisatip -R /usr/share/minisatip/html $MINISATIP_OPTS + fi +} + +stop() { + if [ -e /var/etc/.minisatip ]; then + kill -TERM $(pidof minisatip) + fi +} + +restart() { + stop + sleep 1 + start "$@" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload|force-reload) + restart + ;; + *) + echo "[$BASENAME] Usage: $0 {start|restart|reload|force-reload|stop}" + ;; +esac