mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
move package vdr:
- no more need, move to pkg-archive branch
This commit is contained in:
parent
7d93780fb4
commit
ca912d71d5
@ -1,42 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. config/options
|
|
||||||
|
|
||||||
$SCRIPTS/build toolchain
|
|
||||||
$SCRIPTS/unpack linux
|
|
||||||
$SCRIPTS/build jpeg
|
|
||||||
$SCRIPTS/build freetype
|
|
||||||
$SCRIPTS/build fontconfig
|
|
||||||
$SCRIPTS/build libiconv
|
|
||||||
$SCRIPTS/build gettext
|
|
||||||
|
|
||||||
ACTIVE_EXTENSIONS="liemikuutio dolbyinrec gotox"
|
|
||||||
for plugin in $VDR_PLUGINS; do
|
|
||||||
VDR_EXTENSIONS=
|
|
||||||
if [ -r $PACKAGES/vdr-$plugin/config/vdr ]; then
|
|
||||||
. $PACKAGES/vdr-$plugin/config/vdr
|
|
||||||
ACTIVE_EXTENSIONS="$ACTIVE_EXTENSIONS $VDR_EXTENSIONS"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
cd $BUILD/$1*
|
|
||||||
cat > Make.config <<EOF
|
|
||||||
PLUGINLIBDIR=/usr/lib/vdr
|
|
||||||
VIDEODIR=/storage/Videos
|
|
||||||
CONFDIR=/etc/vdr
|
|
||||||
LOCDIR=/usr/share/locale
|
|
||||||
INCLUDES += -I`ls -d ../freetype-*/include`
|
|
||||||
LIBS += -liconv -lintl
|
|
||||||
EOF
|
|
||||||
for ext in $ACTIVE_EXTENSIONS; do
|
|
||||||
EXTNAME=`echo $ext | tr a-z A-Z`
|
|
||||||
echo "$EXTNAME=1" >> Make.config
|
|
||||||
VDR_DEFINES="$VDR_DEFINES -DUSE_$EXTNAME"
|
|
||||||
done
|
|
||||||
[ -n "$VDR_DEFINES" ] && echo "DEFINES += $VDR_DEFINES" >> Make.config
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
# to build extra plugins
|
|
||||||
make include-dir
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
# Enable wakeup support (no/nvram/acpi)
|
|
||||||
|
|
||||||
WAKEUP="no"
|
|
||||||
|
|
||||||
# Mainboard type (only for nvram); keep empty for autodetection. See the file
|
|
||||||
# nvram-wakeup-boards.txt in the DOCS directory of the GeeXboX sources
|
|
||||||
# for a list of the allowed values.
|
|
||||||
BOARD_TYPE=
|
|
||||||
|
|
||||||
# Wakeup the system in regular intervals
|
|
||||||
REGULAR_DAYS=0 # 0=disabled, 1=each day, 2=each 2'nd day, 3=...
|
|
||||||
REGULAR_TIME=01:00 # HH:MM
|
|
@ -1,40 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# configure and launch VDR
|
|
||||||
#
|
|
||||||
# runlevels: geexbox, debug
|
|
||||||
|
|
||||||
. /etc/funcs
|
|
||||||
|
|
||||||
if [ ! -f /var/dvbcard -a ! -x /usr/bin/enna ]; then
|
|
||||||
echo "No DVB card found, not starting VDR"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "### Starting VDR ###"
|
|
||||||
|
|
||||||
make_persistent file /etc/wakeup /var/data/config/wakeup
|
|
||||||
make_persistent file /etc/vdr/channels.conf /var/data/vdr/channels.conf create
|
|
||||||
make_persistent file /etc/vdr/timers.conf /var/data/vdr/timers.conf create
|
|
||||||
make_persistent file /etc/vdr/setup.conf /var/data/vdr/setup.conf create
|
|
||||||
make_persistent dir /video /var/data/video create
|
|
||||||
make_persistent dir /etc/vdr/plugins/epgsearch /var/data/vdr/epgsearch create
|
|
||||||
|
|
||||||
PLUGINS=""
|
|
||||||
for file in /etc/vdr/plugins.d/*; do
|
|
||||||
# plugins are enabled by default
|
|
||||||
PLUGIN=""
|
|
||||||
OPTIONS=""
|
|
||||||
INITCMD=""
|
|
||||||
ENABLED=yes
|
|
||||||
. $file
|
|
||||||
[ "$ENABLED" = yes ] && PLUGINS="$PLUGINS -P'$PLUGIN $OPTIONS'"
|
|
||||||
[ -n "$INITCMD" ] && eval $INITCMD
|
|
||||||
done
|
|
||||||
|
|
||||||
VDRCMD="vdr -g /tmp -s /usr/bin/vdrshutdown --vfat --no-kbd $PLUGINS > /tmp/vdr.out 2>&1"
|
|
||||||
|
|
||||||
# start VDR
|
|
||||||
runvdr "$VDRCMD" &
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. config/options
|
|
||||||
|
|
||||||
$SCRIPTS/install jpeg
|
|
||||||
$SCRIPTS/install freetype
|
|
||||||
$SCRIPTS/install libiconv
|
|
||||||
# $SCRIPTS/install nvram-wakeup
|
|
||||||
|
|
||||||
PKG_DIR=`find $PACKAGES -type d -name $1`
|
|
||||||
|
|
||||||
mkdir -p $INSTALL/usr/bin
|
|
||||||
cp $PKG_BUILD/vdr $INSTALL/usr/bin
|
|
||||||
cp $PKG_DIR/scripts/* $INSTALL/usr/bin
|
|
||||||
|
|
||||||
mkdir -p $INSTALL/usr/lib/vdr
|
|
||||||
|
|
||||||
for loc in $INCLUDED_LOCALES; do
|
|
||||||
LOCALE=`echo $loc|cut -f1 -d.`
|
|
||||||
if [ -d $PKG_BUILD/locale/$LOCALE ]; then
|
|
||||||
mkdir -p $INSTALL/usr/share/locale/$LOCALE
|
|
||||||
cp -a $PKG_BUILD/locale/$LOCALE/* $INSTALL/usr/share/locale/$LOCALE/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# mkdir -p $INSTALL/etc
|
|
||||||
# cp $PACKAGES/$1/config/wakeup $INSTALL/etc
|
|
||||||
|
|
||||||
mkdir -p $INSTALL/etc/vdr/plugins
|
|
||||||
mkdir -p $INSTALL/etc/vdr/plugins.d
|
|
||||||
cp -a $PKG_BUILD/*.conf $INSTALL/etc/vdr
|
|
||||||
[ "$SERVICES" = yes ] && echo '0.0.0.0/0' >> $INSTALL/etc/vdr/svdrphosts.conf
|
|
File diff suppressed because it is too large
Load Diff
@ -1,54 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.5a/Makefile vdr-1.7.5b/Makefile
|
|
||||||
--- vdr-1.7.5a/Makefile 2009-04-14 13:46:01.000000000 +0200
|
|
||||||
+++ vdr-1.7.5b/Makefile 2009-04-14 13:51:40.000000000 +0200
|
|
||||||
@@ -20,7 +20,7 @@
|
|
||||||
MANDIR = $(PREFIX)/share/man
|
|
||||||
BINDIR = $(PREFIX)/bin
|
|
||||||
LOCDIR = ./locale
|
|
||||||
-LIBS = -ljpeg -lpthread -ldl -lcap -lrt -lfreetype -lfontconfig
|
|
||||||
+LIBS = -ljpeg -lpthread -ldl -lrt -lfreetype -lfontconfig
|
|
||||||
INCLUDES = -I/usr/include/freetype2
|
|
||||||
|
|
||||||
PLUGINDIR= ./PLUGINS
|
|
||||||
diff -Naur vdr-1.7.5a/vdr.c vdr-1.7.5b/vdr.c
|
|
||||||
--- vdr-1.7.5a/vdr.c 2009-04-14 13:45:27.000000000 +0200
|
|
||||||
+++ vdr-1.7.5b/vdr.c 2009-04-14 13:53:53.000000000 +0200
|
|
||||||
@@ -32,7 +32,6 @@
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
-#include <sys/capability.h>
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
#include <termios.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
@@ -114,28 +113,13 @@
|
|
||||||
|
|
||||||
static bool DropCaps(void)
|
|
||||||
{
|
|
||||||
- // drop all capabilities except selected ones
|
|
||||||
- cap_t caps = cap_from_text("= cap_sys_nice,cap_sys_time=ep");
|
|
||||||
- if (!caps) {
|
|
||||||
- fprintf(stderr, "vdr: cap_from_text failed: %s\n", strerror(errno));
|
|
||||||
- return false;
|
|
||||||
- }
|
|
||||||
- if (cap_set_proc(caps) == -1) {
|
|
||||||
- fprintf(stderr, "vdr: cap_set_proc failed: %s\n", strerror(errno));
|
|
||||||
- cap_free(caps);
|
|
||||||
- return false;
|
|
||||||
- }
|
|
||||||
- cap_free(caps);
|
|
||||||
+ // capabilites support removed
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool SetKeepCaps(bool On)
|
|
||||||
{
|
|
||||||
- // set keeping capabilities during setuid() on/off
|
|
||||||
- if (prctl(PR_SET_KEEPCAPS, On ? 1 : 0, 0, 0, 0) != 0) {
|
|
||||||
- fprintf(stderr, "vdr: prctl failed\n");
|
|
||||||
- return false;
|
|
||||||
- }
|
|
||||||
+ // capabilites support removed
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,449 +0,0 @@
|
|||||||
diff -ruNp vdr-1.7.7-extensions/config.c vdr-1.7.7-ext-gotox/config.c
|
|
||||||
--- vdr-1.7.7-extensions/config.c 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/config.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -286,6 +286,13 @@ cSetup::cSetup(void)
|
|
||||||
LnbFrequLo = 9750;
|
|
||||||
LnbFrequHi = 10600;
|
|
||||||
DiSEqC = 0;
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ UseGotox = 0;
|
|
||||||
+ GotoxSpeed = 100;
|
|
||||||
+ GotoxRepeat = 0;
|
|
||||||
+ GotoxSN = 0; GotoxLat = 613; GotoxEW = 1; GotoxLong = 236; // Somewhere at Tampere, Finland :^)
|
|
||||||
+ GotoxPrevSource = 0;
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
SetSystemTime = 0;
|
|
||||||
TimeSource = 0;
|
|
||||||
TimeTransponder = 0;
|
|
||||||
@@ -642,6 +649,16 @@ bool cSetup::Parse(const char *Name, con
|
|
||||||
else if (!strcasecmp(Name, "LnbFrequLo")) LnbFrequLo = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "DiSEqC")) DiSEqC = atoi(Value);
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ else if (!strcasecmp(Name, "UseGotox")) UseGotox = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxSpeed")) GotoxSpeed = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxRepeat")) GotoxRepeat = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxSN")) GotoxSN = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxLat")) GotoxLat = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxEW")) GotoxEW = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxLong")) GotoxLong = atoi(Value);
|
|
||||||
+ else if (!strcasecmp(Name, "GotoxPrevSource")) GotoxPrevSource = atoi(Value);
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "TimeSource")) TimeSource = cSource::FromString(Value);
|
|
||||||
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
|
|
||||||
@@ -873,6 +890,16 @@ bool cSetup::Save(void)
|
|
||||||
Store("LnbFrequLo", LnbFrequLo);
|
|
||||||
Store("LnbFrequHi", LnbFrequHi);
|
|
||||||
Store("DiSEqC", DiSEqC);
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ Store("UseGotox", UseGotox);
|
|
||||||
+ Store("GotoxSpeed", GotoxSpeed);
|
|
||||||
+ Store("GotoxRepeat", GotoxRepeat);
|
|
||||||
+ Store("GotoxSN", GotoxSN);
|
|
||||||
+ Store("GotoxLat", GotoxLat);
|
|
||||||
+ Store("GotoxEW", GotoxEW);
|
|
||||||
+ Store("GotoxLong", GotoxLong);
|
|
||||||
+ Store("GotoxPrevSource", GotoxPrevSource);
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
Store("SetSystemTime", SetSystemTime);
|
|
||||||
Store("TimeSource", cSource::ToString(TimeSource));
|
|
||||||
Store("TimeTransponder", TimeTransponder);
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/config.h vdr-1.7.7-ext-gotox/config.h
|
|
||||||
--- vdr-1.7.7-extensions/config.h 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/config.h 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -301,6 +301,16 @@ public:
|
|
||||||
int LnbFrequLo;
|
|
||||||
int LnbFrequHi;
|
|
||||||
int DiSEqC;
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ int GotoxRepeat;
|
|
||||||
+ int GotoxSN;
|
|
||||||
+ int GotoxEW;
|
|
||||||
+ int GotoxSpeed;
|
|
||||||
+ int GotoxLat;
|
|
||||||
+ int GotoxLong;
|
|
||||||
+ int UseGotox;
|
|
||||||
+ int GotoxPrevSource;
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
int SetSystemTime;
|
|
||||||
int TimeSource;
|
|
||||||
int TimeTransponder;
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/diseqc.c vdr-1.7.7-ext-gotox/diseqc.c
|
|
||||||
--- vdr-1.7.7-extensions/diseqc.c 2008-02-10 15:09:27.000000000 +0100
|
|
||||||
+++ vdr-1.7.7-ext-gotox/diseqc.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -114,6 +114,9 @@ cDiseqc::eDiseqcActions cDiseqc::Execute
|
|
||||||
case 'V': return daVoltage18;
|
|
||||||
case 'A': return daMiniA;
|
|
||||||
case 'B': return daMiniB;
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ case 'G': return daGotoX;
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
case 'W': *CurrentAction = Wait(*CurrentAction); break;
|
|
||||||
case '[': *CurrentAction = Codes(*CurrentAction); return *CurrentAction ? daCodes : daNone;
|
|
||||||
default: return daNone;
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/diseqc.h vdr-1.7.7-ext-gotox/diseqc.h
|
|
||||||
--- vdr-1.7.7-extensions/diseqc.h 2002-12-07 14:54:02.000000000 +0100
|
|
||||||
+++ vdr-1.7.7-ext-gotox/diseqc.h 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -22,6 +22,9 @@ public:
|
|
||||||
daVoltage18,
|
|
||||||
daMiniA,
|
|
||||||
daMiniB,
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ daGotoX,
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
daCodes,
|
|
||||||
};
|
|
||||||
enum { MaxDiseqcCodes = 6 };
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/dvbdevice.c vdr-1.7.7-ext-gotox/dvbdevice.c
|
|
||||||
--- vdr-1.7.7-extensions/dvbdevice.c 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/dvbdevice.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -17,6 +17,9 @@
|
|
||||||
#include <linux/dvb/video.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+#include <math.h>
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
#include "channels.h"
|
|
||||||
#include "diseqc.h"
|
|
||||||
#include "dvbci.h"
|
|
||||||
@@ -214,6 +217,87 @@ static unsigned int FrequencyToHz(unsign
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+void HandleGotox(int fd_frontend, int new_source)
|
|
||||||
+{
|
|
||||||
+ int gotoXTable[10] = { 0x00, 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0E };
|
|
||||||
+ int satlong;
|
|
||||||
+ int satprev;
|
|
||||||
+ float waitseconds = 0;
|
|
||||||
+
|
|
||||||
+ if (Setup.UseGotox == 0)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ // Check if zapped into new source position?
|
|
||||||
+ if (new_source != Setup.GotoxPrevSource) {
|
|
||||||
+ satlong = (new_source & ~0xC800);
|
|
||||||
+ satprev = (Setup.GotoxPrevSource & ~0xC800);
|
|
||||||
+ if ((new_source & 0xC000) != 0x8000)
|
|
||||||
+ return; // Fail
|
|
||||||
+ if (new_source & 0x0800)
|
|
||||||
+ satlong = satlong * (-1);
|
|
||||||
+ if (Setup.GotoxPrevSource & 0x0800)
|
|
||||||
+ satprev = satprev * (-1);
|
|
||||||
+ if (Setup.GotoxSpeed > 0) {
|
|
||||||
+ waitseconds = fabs(satlong-satprev)/(float)(Setup.GotoxSpeed);
|
|
||||||
+ if (waitseconds < 0.0) waitseconds = 0.0; // Should not happen but ...
|
|
||||||
+ if (waitseconds > 60.0) waitseconds = 60.0; // Limit wait time to 60s
|
|
||||||
+ }
|
|
||||||
+ int Long = Setup.GotoxEW ? -Setup.GotoxLong : Setup.GotoxLong;
|
|
||||||
+ int Lat = Setup.GotoxSN ? -Setup.GotoxLat : Setup.GotoxLat;
|
|
||||||
+ double azimuth = M_PI+atan(tan((satlong-Long)*M_PI/1800)/sin(Lat*M_PI/1800));
|
|
||||||
+ double x = acos(cos((satlong-Long)*M_PI/1800)*cos(Lat*M_PI/1800));
|
|
||||||
+ double elevation = atan((cos(x)-0.1513)/sin(x));
|
|
||||||
+ double SatHourangle = 180+atan((-cos(elevation)*sin(azimuth))/(sin(elevation)*cos(Lat*M_PI/1800)
|
|
||||||
+ -cos(elevation)*sin(Lat*M_PI/1800)*cos(azimuth)))*180/M_PI;
|
|
||||||
+ int tmp = (int)(fabs(180-SatHourangle)*10);
|
|
||||||
+ tmp = (tmp/10)*0x10 + gotoXTable[ tmp % 10 ];
|
|
||||||
+ int p2 = (tmp%0x0100);
|
|
||||||
+ int p1 = (tmp/0x0100);
|
|
||||||
+ if (SatHourangle < 180)
|
|
||||||
+ p1 |= 0xe0;
|
|
||||||
+ else
|
|
||||||
+ p1 |= 0xd0;
|
|
||||||
+
|
|
||||||
+ dsyslog("DiSEqC GotoX %d (%d) -> %d (%d), wait time %4.1fs",
|
|
||||||
+ satprev, Setup.GotoxPrevSource, satlong, new_source, waitseconds);
|
|
||||||
+
|
|
||||||
+#if 1
|
|
||||||
+ // Set high LNB voltage and tone off, then wait > 15ms
|
|
||||||
+ CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18));
|
|
||||||
+ CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF));
|
|
||||||
+ usleep(20000);
|
|
||||||
+
|
|
||||||
+ // Send 1st GotoX command, then wait > 15ms
|
|
||||||
+ uchar gotox_bytes[5] = { 0xe0, 0x31, 0x6e, p1, p2};
|
|
||||||
+ struct dvb_diseqc_master_cmd gotox_cmd;
|
|
||||||
+ memcpy(gotox_cmd.msg, gotox_bytes, 5);
|
|
||||||
+ gotox_cmd.msg_len = 5;
|
|
||||||
+ CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
|
|
||||||
+ usleep(20000);
|
|
||||||
+
|
|
||||||
+ // Send repeated GotoX command, then wait > 15ms
|
|
||||||
+ if (Setup.GotoxRepeat) {
|
|
||||||
+ gotox_bytes[0] = 0xe1;
|
|
||||||
+ memcpy(gotox_cmd.msg, gotox_bytes, 5);
|
|
||||||
+ CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
|
|
||||||
+ usleep(20000);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Wait for dish movement
|
|
||||||
+ while (waitseconds > 0.0) {
|
|
||||||
+ usleep(100000); // 100ms
|
|
||||||
+ waitseconds = waitseconds - 100e-3;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ Setup.GotoxPrevSource = new_source;
|
|
||||||
+ dsyslog("DiSEqC GotoX done.");
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
+
|
|
||||||
bool cDvbTuner::SetFrontend(void)
|
|
||||||
{
|
|
||||||
#define MAXFRONTENDCMDS 16
|
|
||||||
@@ -252,6 +336,9 @@ bool cDvbTuner::SetFrontend(void)
|
|
||||||
case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break;
|
|
||||||
case cDiseqc::daMiniA: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break;
|
|
||||||
case cDiseqc::daMiniB: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break;
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ case cDiseqc::daGotoX: HandleGotox(fd_frontend, channel.Source()); break;
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
case cDiseqc::daCodes: {
|
|
||||||
int n = 0;
|
|
||||||
uchar *codes = diseqc->Codes(n);
|
|
||||||
@@ -278,6 +365,11 @@ bool cDvbTuner::SetFrontend(void)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ // Send GotoX DiSEqC command if activated in vdr setup. Then wait with high LNB voltage
|
|
||||||
+ // estimated time for dish movement
|
|
||||||
+ HandleGotox(fd_frontend, channel.Source());
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
int tone = SEC_TONE_OFF;
|
|
||||||
if (frequency < (unsigned int)Setup.LnbSLOF) {
|
|
||||||
frequency -= Setup.LnbFrequLo;
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/Make.config.template vdr-1.7.7-ext-gotox/Make.config.template
|
|
||||||
--- vdr-1.7.7-extensions/Make.config.template 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/Make.config.template 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -67,6 +67,7 @@ DOLBYINREC = 1
|
|
||||||
#DVLRECSCRIPTADDON = 1
|
|
||||||
#DVLVIDPREFER = 1
|
|
||||||
#EM84XX = 1
|
|
||||||
+#GOTOX = 1
|
|
||||||
#GRAPHTFT = 1
|
|
||||||
#HARDLINKCUTTER = 1
|
|
||||||
#JUMPPLAY = 1
|
|
||||||
@@ -173,6 +174,10 @@ ifdef EM84XX
|
|
||||||
DEFINES += -DUSE_EM84XX
|
|
||||||
endif
|
|
||||||
|
|
||||||
+ifdef GOTOX
|
|
||||||
+DEFINES += -DUSE_GOTOX
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
ifdef GRAPHTFT
|
|
||||||
DEFINES += -DUSE_GRAPHTFT
|
|
||||||
endif
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/menu.c vdr-1.7.7-ext-gotox/menu.c
|
|
||||||
--- vdr-1.7.7-extensions/menu.c 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/menu.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -3447,6 +3447,15 @@ void cMenuSetupLNB::Setup(void)
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.LNB$High LNB frequency (MHz)"), &data.LnbFrequHi));
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ Add(new cMenuEditBoolItem(tr("Setup.LNB$Use GotoX dish positioning"), &data.UseGotox));
|
|
||||||
+ if (data.UseGotox) {
|
|
||||||
+ Add(new cMenuEditBoolItem(tr("Setup.LNB$Repeat GotoX commands"), &data.GotoxRepeat));
|
|
||||||
+ Add(new cMenuEditIntpItem(tr("Setup.LNB$Latitude"), &data.GotoxLat, 0, 900, &data.GotoxSN, tr("North"), tr("South")));
|
|
||||||
+ Add(new cMenuEditIntpItem(tr("Setup.LNB$Longitude"), &data.GotoxLong, 0, 1800, &data.GotoxEW, tr("West"), tr("East")));
|
|
||||||
+ Add(new cMenuEditIntdItem(tr("Setup.LNB$Rotor speed (deg/s)"), &data.GotoxSpeed, 1, 100));
|
|
||||||
+ }
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
SetCurrent(Get(current));
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
@@ -3454,6 +3463,9 @@ void cMenuSetupLNB::Setup(void)
|
|
||||||
eOSState cMenuSetupLNB::ProcessKey(eKeys Key)
|
|
||||||
{
|
|
||||||
int oldDiSEqC = data.DiSEqC;
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ int oldUseGotox = data.UseGotox;
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
eOSState state = cMenuSetupBase::ProcessKey(Key);
|
|
||||||
|
|
||||||
#ifdef USE_LNBSHARE
|
|
||||||
@@ -3462,6 +3474,12 @@ eOSState cMenuSetupLNB::ProcessKey(eKeys
|
|
||||||
|
|
||||||
if (Key != kNone && data.DiSEqC != oldDiSEqC)
|
|
||||||
Setup();
|
|
||||||
+
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ if (Key != kNone && data.UseGotox != oldUseGotox)
|
|
||||||
+ Setup();
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
+
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/menuitems.c vdr-1.7.7-ext-gotox/menuitems.c
|
|
||||||
--- vdr-1.7.7-extensions/menuitems.c 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/menuitems.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -1286,3 +1286,119 @@ void cMenuSetupPage::SetupStore(const ch
|
|
||||||
if (plugin)
|
|
||||||
plugin->SetupStore(Name, Value);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+// cMenuEditIntpItem & cMenuEditIntdItem for GotoX function
|
|
||||||
+
|
|
||||||
+void cMenuEditIntpItem::Set(void)
|
|
||||||
+{
|
|
||||||
+ char buf[16];
|
|
||||||
+ snprintf(buf, sizeof(buf), "%d.%d %s", *value/10, *value % 10, *value2 ? trueString : falseString);
|
|
||||||
+ SetValue(buf);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void cMenuEditIntdItem::Set(void)
|
|
||||||
+{
|
|
||||||
+ char buf[16];
|
|
||||||
+ snprintf(buf, sizeof(buf), "%d.%d", *value/10, *value % 10);
|
|
||||||
+ SetValue(buf);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+cMenuEditIntpItem::cMenuEditIntpItem(const char *Name, int *Value, int Min, int Max,int *Value2, const char *FalseString, const char *TrueString):cMenuEditIntItem(Name, Value, Min, Max)
|
|
||||||
+{
|
|
||||||
+ value = Value;
|
|
||||||
+ value2= Value2;
|
|
||||||
+ trueString = TrueString;
|
|
||||||
+ falseString = FalseString;
|
|
||||||
+ min = Min;
|
|
||||||
+ max = Max;
|
|
||||||
+ Set();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+cMenuEditIntdItem::cMenuEditIntdItem(const char *Name, int *Value, int Min, int Max):cMenuEditIntItem(Name, Value, Min, Max)
|
|
||||||
+{
|
|
||||||
+ value = Value;
|
|
||||||
+ min = Min;
|
|
||||||
+ max = Max;
|
|
||||||
+ Set();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+eOSState cMenuEditIntpItem::ProcessKey(eKeys Key)
|
|
||||||
+{
|
|
||||||
+ eOSState state = cMenuEditItem::ProcessKey(Key);
|
|
||||||
+ if (state == osUnknown) {
|
|
||||||
+ int newValue = *value;
|
|
||||||
+ int newValue2 = *value2;
|
|
||||||
+ Key = NORMALKEY(Key);
|
|
||||||
+ switch (Key) {
|
|
||||||
+ case kNone : break;
|
|
||||||
+ case k0...k9:
|
|
||||||
+ if (fresh) {
|
|
||||||
+ *value = 0;
|
|
||||||
+ fresh = false;
|
|
||||||
+ }
|
|
||||||
+ newValue = *value * 10 + (Key - k0);
|
|
||||||
+ break;
|
|
||||||
+ case kLeft :
|
|
||||||
+ newValue2 = 0;
|
|
||||||
+ fresh = true;
|
|
||||||
+ break;
|
|
||||||
+ case kRight :
|
|
||||||
+ newValue2 = 1;
|
|
||||||
+ fresh = true;
|
|
||||||
+ break;
|
|
||||||
+ default :
|
|
||||||
+ if (*value < min) { *value = min; Set(); }
|
|
||||||
+ if (*value > max) { *value = max; Set(); }
|
|
||||||
+ return state;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((!fresh || min <= newValue) && newValue <= max) {
|
|
||||||
+ *value = newValue;
|
|
||||||
+ *value2 = newValue2;
|
|
||||||
+ Set();
|
|
||||||
+ }
|
|
||||||
+ state = osContinue;
|
|
||||||
+ }
|
|
||||||
+ return state;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+eOSState cMenuEditIntdItem::ProcessKey(eKeys Key)
|
|
||||||
+{
|
|
||||||
+ eOSState state = cMenuEditItem::ProcessKey(Key);
|
|
||||||
+ if (state == osUnknown) {
|
|
||||||
+ int newValue = *value;
|
|
||||||
+ Key = NORMALKEY(Key);
|
|
||||||
+ switch (Key) {
|
|
||||||
+ case kNone : break;
|
|
||||||
+ case k0...k9:
|
|
||||||
+ if (fresh) {
|
|
||||||
+ *value = 0;
|
|
||||||
+ fresh = false;
|
|
||||||
+ }
|
|
||||||
+ newValue = *value * 10 + (Key - k0);
|
|
||||||
+ break;
|
|
||||||
+ case kLeft :
|
|
||||||
+ newValue = *value - 1;
|
|
||||||
+ fresh = true;
|
|
||||||
+ break;
|
|
||||||
+ case kRight :
|
|
||||||
+ newValue = *value + 1;
|
|
||||||
+ fresh = true;
|
|
||||||
+ break;
|
|
||||||
+ default :
|
|
||||||
+ if (*value < min) { *value = min; Set(); }
|
|
||||||
+ if (*value > max) { *value = max; Set(); }
|
|
||||||
+ return state;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((!fresh || min <= newValue) && newValue <= max) {
|
|
||||||
+ *value = newValue;
|
|
||||||
+ Set();
|
|
||||||
+ }
|
|
||||||
+ state = osContinue;
|
|
||||||
+ }
|
|
||||||
+ return state;
|
|
||||||
+}
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/menuitems.h vdr-1.7.7-ext-gotox/menuitems.h
|
|
||||||
--- vdr-1.7.7-extensions/menuitems.h 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/menuitems.h 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -241,4 +241,24 @@ public:
|
|
||||||
#endif /* GRAPHTFT */
|
|
||||||
};
|
|
||||||
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+class cMenuEditIntpItem : public cMenuEditIntItem {
|
|
||||||
+protected:
|
|
||||||
+ virtual void Set(void);
|
|
||||||
+ const char *falseString, *trueString;
|
|
||||||
+ int *value2;
|
|
||||||
+public:
|
|
||||||
+ cMenuEditIntpItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX, int *Value2=0, const char *FalseString = "", const char *TrueSting = NULL);
|
|
||||||
+ virtual eOSState ProcessKey(eKeys Key);
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+class cMenuEditIntdItem : public cMenuEditIntItem {
|
|
||||||
+protected:
|
|
||||||
+ virtual void Set(void);
|
|
||||||
+public:
|
|
||||||
+ cMenuEditIntdItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX);
|
|
||||||
+ virtual eOSState ProcessKey(eKeys Key);
|
|
||||||
+};
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
+
|
|
||||||
#endif //__MENUITEMS_H
|
|
||||||
diff -ruNp vdr-1.7.7-extensions/vdr.c vdr-1.7.7-ext-gotox/vdr.c
|
|
||||||
--- vdr-1.7.7-extensions/vdr.c 2009-05-04 21:24:29.000000000 +0200
|
|
||||||
+++ vdr-1.7.7-ext-gotox/vdr.c 2009-05-04 21:30:15.000000000 +0200
|
|
||||||
@@ -589,6 +589,10 @@ int main(int argc, char *argv[])
|
|
||||||
printf(" EM84XX\n");
|
|
||||||
#endif /* EM84XX */
|
|
||||||
|
|
||||||
+#ifdef USE_GOTOX
|
|
||||||
+ printf(" GOTOX\n");
|
|
||||||
+#endif /* GOTOX */
|
|
||||||
+
|
|
||||||
#ifdef USE_GRAPHTFT
|
|
||||||
printf(" GRAPHTFT\n");
|
|
||||||
#endif /* GRAPHTFT */
|
|
@ -1,39 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.7/config.c vdr-1.7.7a/config.c
|
|
||||||
--- vdr-1.7.7/config.c 2009-05-17 14:38:41.000000000 +0200
|
|
||||||
+++ vdr-1.7.7a/config.c 2009-05-17 14:39:52.000000000 +0200
|
|
||||||
@@ -367,7 +367,7 @@
|
|
||||||
DelTimeshiftRec = 0;
|
|
||||||
#endif /* DELTIMESHIFTREC */
|
|
||||||
MinEventTimeout = 30;
|
|
||||||
- MinUserInactivity = 300;
|
|
||||||
+ MinUserInactivity = 0;
|
|
||||||
NextWakeupTime = 0;
|
|
||||||
MultiSpeedMode = 0;
|
|
||||||
ShowReplayMode = 0;
|
|
||||||
@@ -736,7 +736,6 @@
|
|
||||||
else if (!strcasecmp(Name, "DelTimeshiftRec")) DelTimeshiftRec = atoi(Value);
|
|
||||||
#endif /* DELTIMESHIFTREC */
|
|
||||||
else if (!strcasecmp(Name, "MinEventTimeout")) MinEventTimeout = atoi(Value);
|
|
||||||
- else if (!strcasecmp(Name, "MinUserInactivity")) MinUserInactivity = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "NextWakeupTime")) NextWakeupTime = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "MultiSpeedMode")) MultiSpeedMode = atoi(Value);
|
|
||||||
else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value);
|
|
||||||
@@ -974,7 +973,6 @@
|
|
||||||
Store("DelTimeshiftRec", DelTimeshiftRec);
|
|
||||||
#endif /* DELTIMESHIFTREC */
|
|
||||||
Store("MinEventTimeout", MinEventTimeout);
|
|
||||||
- Store("MinUserInactivity", MinUserInactivity);
|
|
||||||
Store("NextWakeupTime", NextWakeupTime);
|
|
||||||
#ifdef USE_DDEPGENTRY
|
|
||||||
Store("DoubleEpgAction", DoubleEpgAction);
|
|
||||||
diff -Naur vdr-1.7.7/menu.c vdr-1.7.7a/menu.c
|
|
||||||
--- vdr-1.7.7/menu.c 2009-05-17 14:38:41.000000000 +0200
|
|
||||||
+++ vdr-1.7.7a/menu.c 2009-05-17 14:39:06.000000000 +0200
|
|
||||||
@@ -3831,7 +3831,6 @@
|
|
||||||
Clear();
|
|
||||||
#endif /* VOLCTRL */
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. event timeout (min)"), &data.MinEventTimeout));
|
|
||||||
- Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity));
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (s)"), &data.SVDRPTimeout));
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Zap timeout (s)"), &data.ZapTimeout));
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Channel entry timeout (ms)"), &data.ChannelEntryTimeout, 0));
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.9/Makefile vdr-1.7.9a/Makefile
|
|
||||||
--- vdr-1.7.9/Makefile 2009-10-03 08:53:31.000000000 +0200
|
|
||||||
+++ vdr-1.7.9a/Makefile 2009-10-03 08:53:59.000000000 +0200
|
|
||||||
@@ -21,7 +21,7 @@
|
|
||||||
BINDIR = $(PREFIX)/bin
|
|
||||||
LOCDIR = ./locale
|
|
||||||
LIBS = -ljpeg -lpthread -ldl -lrt -lfreetype -lfontconfig
|
|
||||||
-INCLUDES = -I/usr/include/freetype2
|
|
||||||
+INCLUDES =
|
|
||||||
|
|
||||||
PLUGINDIR= ./PLUGINS
|
|
||||||
PLUGINLIBDIR= $(PLUGINDIR)/lib
|
|
@ -1,11 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.9/tools.h vdr-1.7.9.patch/tools.h
|
|
||||||
--- vdr-1.7.9/tools.h 2009-04-14 22:41:39.000000000 +0200
|
|
||||||
+++ vdr-1.7.9.patch/tools.h 2009-10-06 20:41:43.924419570 +0200
|
|
||||||
@@ -19,6 +19,7 @@
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
+#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <syslog.h>
|
|
||||||
#include <sys/stat.h>
|
|
@ -1,14 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.9/dvbdevice.h vdr-1.7.9.patch/dvbdevice.h
|
|
||||||
--- vdr-1.7.9/dvbdevice.h 2009-06-06 13:16:47.000000000 +0200
|
|
||||||
+++ vdr-1.7.9.patch/dvbdevice.h 2009-10-06 20:36:09.827294633 +0200
|
|
||||||
@@ -16,8 +16,8 @@
|
|
||||||
#include "device.h"
|
|
||||||
#include "dvbspu.h"
|
|
||||||
|
|
||||||
-#if DVB_API_VERSION != 5 || DVB_API_VERSION_MINOR != 0
|
|
||||||
-#error VDR requires Linux DVB driver API version 5.0!
|
|
||||||
+#if DVB_API_VERSION != 5
|
|
||||||
+#error VDR requires Linux DVB driver API version 5.0 or higher!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAXDVBDEVICES 8
|
|
@ -1,13 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.9/tools.c vdr-1.7.9.patch/tools.c
|
|
||||||
--- vdr-1.7.9/tools.c 2009-05-31 13:43:24.000000000 +0200
|
|
||||||
+++ vdr-1.7.9.patch/tools.c 2009-10-06 22:12:39.421294729 +0200
|
|
||||||
@@ -484,7 +484,8 @@
|
|
||||||
{
|
|
||||||
if (!FileName)
|
|
||||||
return NULL;
|
|
||||||
- char *TargetName = canonicalize_file_name(FileName);
|
|
||||||
+ char *ResolvedName = (char*) malloc(1024);
|
|
||||||
+ char *TargetName = realpath(FileName, ResolvedName);
|
|
||||||
if (!TargetName) {
|
|
||||||
if (errno == ENOENT) // file doesn't exist
|
|
||||||
TargetName = strdup(FileName);
|
|
@ -1,25 +0,0 @@
|
|||||||
diff -Naur vdr-1.7.9/thread.c vdr-1.7.9.patch/thread.c
|
|
||||||
--- vdr-1.7.9/thread.c 2009-04-13 15:50:39.000000000 +0200
|
|
||||||
+++ vdr-1.7.9.patch/thread.c 2009-10-06 22:10:06.587419872 +0200
|
|
||||||
@@ -160,10 +160,17 @@
|
|
||||||
if (!GetAbsTime(&abstime, TimeoutMs))
|
|
||||||
TimeoutMs = 0;
|
|
||||||
}
|
|
||||||
- if (Write)
|
|
||||||
- Result = TimeoutMs ? pthread_rwlock_timedwrlock(&rwlock, &abstime) : pthread_rwlock_wrlock(&rwlock);
|
|
||||||
- else
|
|
||||||
- Result = TimeoutMs ? pthread_rwlock_timedrdlock(&rwlock, &abstime) : pthread_rwlock_rdlock(&rwlock);
|
|
||||||
+
|
|
||||||
+ while (true) {
|
|
||||||
+ if (Write)
|
|
||||||
+ Result = pthread_rwlock_wrlock(&rwlock);
|
|
||||||
+ else
|
|
||||||
+ Result = pthread_rwlock_rdlock(&rwlock);
|
|
||||||
+ if ( Result == 0 | TimeoutMs == 0 )
|
|
||||||
+ break;
|
|
||||||
+ TimeoutMs--;
|
|
||||||
+ usleep(1000);
|
|
||||||
+ }
|
|
||||||
return Result == 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
VDRCMD=$1
|
|
||||||
|
|
||||||
[ -r /etc/locale ] && export LANG=`cat /etc/locale`
|
|
||||||
export DISPLAY=":0"
|
|
||||||
|
|
||||||
trap 'killall -q -TERM vdr; exit 0' 15
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
eval "$VDRCMD"
|
|
||||||
done
|
|
@ -1,69 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /etc/wakeup
|
|
||||||
|
|
||||||
do_shutdown()
|
|
||||||
{
|
|
||||||
sleep 5
|
|
||||||
}
|
|
||||||
|
|
||||||
do_reboot()
|
|
||||||
{
|
|
||||||
sleep 5
|
|
||||||
# reboot
|
|
||||||
}
|
|
||||||
|
|
||||||
osdmsg()
|
|
||||||
{
|
|
||||||
sleep 2
|
|
||||||
echo "MESG $1" | nc localhost 2001
|
|
||||||
}
|
|
||||||
|
|
||||||
grep -q LOCAL /etc/adjtime && HWCLOCK_LOCAL_TIME="-l"
|
|
||||||
|
|
||||||
TIMER=$1
|
|
||||||
[ -z "$TIMER" ] && TIMER=`/usr/bin/getwakeup $HWCLOCK_LOCAL_TIME`
|
|
||||||
[ -z "$TIMER" ] && TIMER=0
|
|
||||||
|
|
||||||
[ -z "$WAKEUP" -o "$WAKEUP" = no -o -z "$TIMER" ] && do_shutdown
|
|
||||||
|
|
||||||
if [ $REGULAR_DAYS -gt 0 ]; then
|
|
||||||
REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))
|
|
||||||
|
|
||||||
# when no vdr timer is set or vdr timer starts later than regular timer:
|
|
||||||
if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ]; then
|
|
||||||
TIMER=$REGULAR_TIMER
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$WAKEUP" = nvram -a -x /usr/bin/nvram-wakeup ]; then
|
|
||||||
if [ -r /etc/nvram-wakeup.conf ]; then
|
|
||||||
/usr/bin/nvram-wakeup -C /etc/nvram-wakeup.conf -ls $TIMER
|
|
||||||
elif [ -n "$BOARD_TYPE" ]; then
|
|
||||||
/usr/bin/nvram-wakeup -I $BOARD_TYPE -ls $TIMER
|
|
||||||
else
|
|
||||||
/usr/bin/nvram-wakeup -ls $TIMER
|
|
||||||
fi
|
|
||||||
case $? in
|
|
||||||
0) # everything is ok
|
|
||||||
do_shutdown
|
|
||||||
;;
|
|
||||||
#FIXME: for boards that need nvram-wakeup and reboot, this won't work anyway with geexbox at the moment
|
|
||||||
#maybe this should be removed after all
|
|
||||||
1) # we need to reboot
|
|
||||||
do_reboot
|
|
||||||
;;
|
|
||||||
*) # something went wrong
|
|
||||||
osdmsg "nvram-wakeup: cannot set time, shutdown aborted!"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
elif [ "$WAKEUP" = acpi -a -e /sys/class/rtc/rtc0/wakealarm ]; then
|
|
||||||
echo 0 >/sys/class/rtc/rtc0/wakealarm
|
|
||||||
echo $TIMER >/sys/class/rtc/rtc0/wakealarm
|
|
||||||
#some boards need to have this run twice
|
|
||||||
echo $TIMER >/sys/class/rtc/rtc0/wakealarm
|
|
||||||
do_shutdown
|
|
||||||
else
|
|
||||||
do_shutdown
|
|
||||||
fi
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.7.9.tar.bz2
|
|
Loading…
x
Reference in New Issue
Block a user