diff options
author | hschang <chang@dev3> | 2020-07-08 01:46:43 (GMT) |
---|---|---|
committer | hschang <chang@dev3> | 2020-07-08 01:46:43 (GMT) |
commit | 057726dade3f664b1c1081de0a5f3966d242cd1a (patch) | |
tree | aec196f3aebb6f82d1aab814f6c1b6ab0367a972 /meta-openvuplus | |
parent | e4a770ebafd48e6e67563fde1a46d8e65449c0dd (diff) |
[usbtunerhelper] add patch for usbtuners which take longer for loading during init.
Diffstat (limited to 'meta-openvuplus')
3 files changed, 70 insertions, 25 deletions
diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb index 38d0e32..23de067 100644 --- a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb +++ b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb @@ -4,7 +4,7 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" PV = "1.0+git${SRCPV}" -PR = "r8" +PR = "r9" SRC_REV = "" SRC_URI = " \ @@ -15,6 +15,7 @@ SRC_URI = " \ file://get_avail_vtuner.patch \ file://setfrontend_ofdm_fecauto.patch \ file://pump_proc_checksize.patch \ + file://fix_delayed_loading.patch \ file://${PN}.sh \ " diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch new file mode 100755 index 0000000..d03bc6a --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch @@ -0,0 +1,34 @@ +diff -Naur git.orig/usbtunerhelper.c git/usbtunerhelper.c
+--- git.orig/usbtunerhelper.c 2015-11-04 20:03:46.000000000 +0100
++++ git/usbtunerhelper.c 2015-11-04 20:04:16.200476304 +0100
+@@ -665,6 +665,7 @@
+ int debug = 0;
+ int scan_inverval = 1;
+ int scan_count = 60;
++ char filename[] = "/tmp/.vtuner_available";
+
+ int option;
+ while ((option = getopt(argc, argv, "dh")) >= 0)
+@@ -680,6 +681,12 @@
+ }
+ }
+
++ if ( (scan_adapters() > 0) && (!debug) ){
++ FILE *fp;
++ fp=fopen(filename, "w+");
++ fclose(fp);
++ }
++
+ if (!debug) daemon_init();
+
+ signal(SIGTERM, sigint_handler);
+@@ -700,6 +707,9 @@
+
+ available_vtuner = get_avail_vtuner();
+
++ int ret;
++ ret = remove(filename);
++
+ for (i = 0; i < adaptercount; i++)
+ {
+ init_adapter(i);
diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/usbtunerhelper.sh b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/usbtunerhelper.sh index 424cf3d..3d3e620 100644 --- a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/usbtunerhelper.sh +++ b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/usbtunerhelper.sh @@ -1,24 +1,34 @@ -#!/bin/sh - -if ! [ -x /usr/bin/usbtunerhelper ]; then - exit 0 -fi - -case "$1" in - start) - start-stop-daemon -S -x /usr/bin/usbtunerhelper - ;; - stop) - start-stop-daemon -K -x /usr/bin/usbtunerhelper - ;; - restart|reload) - $0 stop - $0 start - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 +#!/bin/sh
+
+if ! [ -x /usr/bin/usbtunerhelper ]; then
+ exit 0
+fi
+
+VTUNER_FILE="/tmp/.vtuner_available"
+
+case "$1" in
+ start)
+ start-stop-daemon -S -x /usr/bin/usbtunerhelper
+ if [ -f $VTUNER_FILE ]
+ then
+ echo "[USBTUNERHELPER] wait for initializing vtuner"
+ while [ ! -f $VTUNER_FILE ]; do
+ usleep 100000
+ done
+ sleep 2
+ fi
+ ;;
+ stop)
+ start-stop-daemon -K -x /usr/bin/usbtunerhelper
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
|