diff options
author | M0Rf30 | 2016-01-19 02:38:38 +0100 |
---|---|---|
committer | M0Rf30 | 2016-01-19 02:38:38 +0100 |
commit | 5cb2e9a7aa86609066fd6614662b12f143e8a204 (patch) | |
tree | 8203525132018f93bb2229ada776af9711d2fc14 | |
parent | 6d1fad3091bdd0c5eb7553d54b19fb389653b588 (diff) | |
download | aur-5cb2e9a7aa86609066fd6614662b12f143e8a204.tar.gz |
updated to 2.3.1
-rw-r--r-- | 00-vdr.conf | 106 | ||||
-rw-r--r-- | 50-dvbsddevice.conf | 3 | ||||
-rw-r--r-- | 50-hello.conf | 6 | ||||
-rw-r--r-- | 50-pictures.conf | 3 | ||||
-rw-r--r-- | 50-rcu.conf | 3 | ||||
-rw-r--r-- | 60-create-dvb-device-units.rules | 1 | ||||
-rw-r--r-- | MainMenuHooks-v1_0_2.diff | 181 | ||||
-rw-r--r--[-rwxr-xr-x] | PKGBUILD | 209 | ||||
-rw-r--r-- | gen-sddropin | 19 | ||||
-rw-r--r-- | shutdown-wrapper.c | 27 | ||||
-rwxr-xr-x | shutdown.sh | 25 | ||||
-rw-r--r-- | vdr.install | 42 | ||||
-rw-r--r--[-rwxr-xr-x] | vdr.service | 16 | ||||
-rw-r--r-- | vdr.sysuser | 8 |
14 files changed, 529 insertions, 120 deletions
diff --git a/00-vdr.conf b/00-vdr.conf new file mode 100644 index 000000000000..80a25245f0a8 --- /dev/null +++ b/00-vdr.conf @@ -0,0 +1,106 @@ +[vdr] +#--audio=cmd +# Send Dolby Digital audio to stdin of command cmd. + +#--cachedir=dir +# Save cache files in dir (default is /var/cache/vdr). + +--chartab=ISO-8859-15 +# set the character table to use for strings in the +# DVB data stream that don't begin with a character +# table indicator, but don't use the standard default +# character table (for instance ISO-8859-9) + +#--config=dir +# Read config files from directory dir (default is /var/lib/vdr). + +#--daemon +# Run in daemon mode (implies --no-kbd). + +#--device=num +# Use only the given DVB device (num = 0, 1, 2...). There may be several -D options (by default all +# DVB devices will be used). + +#--dirnames=path[,name[,enc]] +# Set the maximum directory path length to path (default is the maximum value allowed on the sys‐ +# tem). If name is also given, it defines the maximum directory name length (default is the maximum +# value allowed on the system). The optional enc can be 0 or 1, and controls whether special char‐ +# acters in directory names are encoded as hex values (default: 0). If path or name are left empty +# (as in ",,1" to only set enc), the defaults apply. The length of the video directory name and +# that of the actual recording directory is subtracted from path, to make sure the directory path +# will never become too long. + +#--epgfile=file +# Write the EPG data into the given file (default is epg.data in the cache directory). Use -E- to +# disable this. If file is a directory, the file epg.data will be created in that directory. + +#--filesize=size +# Limit video files to size bytes (default is 2000M). This option is only useful in conjunction +# with --edit, and must precede that option to have an effect. size is an integer number and may be +# followed by one of the letters K, M, G or T to abbreviate Kilo-, Mega-, Giga- or Terabyte, respec‐ +# tively. The given value is silently limited to the program's internal minimum and maximum values. + +--grab=/tmp +# Write images from the SVDRP command GRAB into the given directory dir. dir must be the full path +# name of an existing directory, without any "..", double '/' or symlinks. By default, or if -g- is +# given, grabbing images to disk is disabled. + +#--instance=instance +# Use instance as the id of this VDR instance (default is 0). In an environment where several +# instances of VDR use the same video directory, this parameter can be set to a positive integer +# value that's unique for each instance, so that they won't interfere with each other in case they +# record exactly the same broadcast. The number given here will be part of the directory name in +# which the recordings will be stored. + +--log=2 +# Set logging to level. 0 = no logging, 1 = errors only, 2 = errors and info, 3 = errors, info and +# debug. The default logging level is 3. If logging should be done to LOG_LOCALn instead of +# LOG_USER, add '.n' to LEVEL, as in 3.7 (n=0..7). + +#--lib=dir +# Search for plugins in directory dir (default is /usr/lib/vdr/plugins). There can be several -L options +# with different dir values. Each of them will apply to the -P options following it. + +#--lirc[=path] +# Use a LIRC remote control device. If path is omitted, vdr uses /var/run/lirc/lircd. + +#--localedir=dir +# Search for locale files in dir (default is /usr/share/locale). + +#--mute +# Mute audio of the primary DVB device at startup. + +#--no-kbd +# Don't use the keyboard as an input device. + +#--port=port +# Use port for SVDRP. A value of 0 turns off SVDRP. The default SVDRP port is 6419. You need to +# edit the file svdrphosts.conf in order to enable access to the SVDRP port. +# + +#--record=cmd +# Call cmd before and after a recording. See the file INSTALL for more information. + +#--resdir=dir +# Read resource files from dir (default is /usr/share/vdr). + +--shutdown=/usr/lib/vdr/bin/shutdown-wrapper +# Call cmd to shutdown the computer. See the file INSTALL for more information. + +#--terminal=tty +# Set the controlling terminal. + +#--user=user +# Run as user user in case vdr was started as user 'root'. Starting vdr as 'root' is necessary if +# the system time shall be set from the transponder data, but for security reasons vdr can switch to +# a lesser privileged user id during normal operation. The default is 'vdr' + +#--userdump +# Allow coredumps if -u is given (only for debugging). + +#--video=dir +# Use dir as video directory. The default is /srv/vdr/video. + +--watchdog=90 +# Activate the watchdog timer with a timeout of sec seconds. A value of 0 (default) disables the +# watchdog. diff --git a/50-dvbsddevice.conf b/50-dvbsddevice.conf new file mode 100644 index 000000000000..77d8122eec3c --- /dev/null +++ b/50-dvbsddevice.conf @@ -0,0 +1,3 @@ +[dvbsddevice] +#--outputonly +# do not receive, just use as output device diff --git a/50-hello.conf b/50-hello.conf new file mode 100644 index 000000000000..e9bd493c751d --- /dev/null +++ b/50-hello.conf @@ -0,0 +1,6 @@ +[hello] +#--aaa=ABC +# do something nice with ABC + +#--bbb +# activate 'plan B'
\ No newline at end of file diff --git a/50-pictures.conf b/50-pictures.conf new file mode 100644 index 000000000000..33b4e14f76b8 --- /dev/null +++ b/50-pictures.conf @@ -0,0 +1,3 @@ +[pictures] +#--dir=DIR +# set the picture directory to DIR diff --git a/50-rcu.conf b/50-rcu.conf new file mode 100644 index 000000000000..ec3f2395e3d1 --- /dev/null +++ b/50-rcu.conf @@ -0,0 +1,3 @@ +[rcu] +#--device=DEV +# set the device to use (default is /dev/ttyS1)
\ No newline at end of file diff --git a/60-create-dvb-device-units.rules b/60-create-dvb-device-units.rules new file mode 100644 index 000000000000..29101f634ff0 --- /dev/null +++ b/60-create-dvb-device-units.rules @@ -0,0 +1 @@ +SUBSYSTEM=="dvb", TAG+="systemd" diff --git a/MainMenuHooks-v1_0_2.diff b/MainMenuHooks-v1_0_2.diff new file mode 100644 index 000000000000..21a7cb8b2b52 --- /dev/null +++ b/MainMenuHooks-v1_0_2.diff @@ -0,0 +1,181 @@ +This is a "patch" for the Video Disk Recorder (VDR). + +* History +2012-04-06: Version 1.0.2 +- Update fr aktuelle VDR-Entwickler-Versionen (Manuel Reimer) + +2010-10-15: Version 1.0.1 +- return a cOsdObject instead of its subclass cOsdMenu (thanks to + Joe_D@vdrportal) +- version number defines in config.h now follow the ususal conventions: + MAINMENUHOOKSVERSNUM is now a number, the newly added define + MAINMENUHOOKSVERSION is a string (suggested by gnapheus@vdrportal) +- patch is now based on VDR 1.6.0 +- updated documentation + +2007-02-26: Version 1.0 +- Initial revision. + +* Authors: +Tobias Grimm <vdr at e-tobi dot net> +Martin Prochnow <nordlicht at martins-kabuff dot de> +Frank Schmirler <vdrdev at schmirler dot de> +Christian Wieninger <cwieninger at gmx dot de> + +* Description: +This patch allows plugins to replace the VDR mainmenus "Schedule", +"Channels", "Timers" and "Recordings" by a different implementation. + +The patch is based on a suggestion of Christian Wieninger back in 2006 +(http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is +meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5 +introduces an official API for this purpose. + +* Installation +Change into the VDR source directory, then issue + patch -p1 < path/to/MainMenuHooks-v1_0_1.patch +and recompile. + +* Notes for plugin authors +The following code sample shows the required plugin code for replacing +the original Schedule menu: + +bool cMyPlugin::Service(const char *Id, void *Data) +{ + cOsdMenu **menu = (cOsdMenu**) Data; + if (MySetup.replaceSchedule && + strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) { + if (menu) + *menu = (cOsdMenu*) MainMenuAction(); + return true; + } + return false; +} + +Since patch version 1.0.1 the service call may return a cOsdObject +instead of a cOsdMenu. Use "#ifdef MAINMENUHOOKSVERSION" to detect +version 1.0.1. + +A plugin can replace more than one menu at a time. Simply replace the +call to MainMenuAction() in the sample above by appropriate code. + +Note that a plugin *should* offer a setup option which allows the user +to enable or disable the replacement. "Disabled" would be a reasonable +default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin +can leave the setup option out at compiletime. + +In case there is an internal problem when trying to open the replacement +menu, it is safe to return true even though Data is NULL. However an +OSD message should indicate the problem to the user. + +Feel free to ship this patch along with your plugin. However if you +think you need to modify the patch, we'd encourage you to contact the +authors first or at least use a service id which differs in more than +just the version number. + +diff -ru vdr-1.6.0.orig/menu.c vdr-1.6.0/menu.c +--- vdr-1.6.0.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 ++++ vdr-1.6.0/menu.c 2010-10-11 20:32:25.000000000 +0200 +@@ -2973,15 +2973,31 @@ + + // Initial submenus: + ++ cOsdObject *menu = NULL; + switch (State) { +- case osSchedule: AddSubMenu(new cMenuSchedule); break; +- case osChannels: AddSubMenu(new cMenuChannels); break; +- case osTimers: AddSubMenu(new cMenuTimers); break; +- case osRecordings: AddSubMenu(new cMenuRecordings(NULL, 0, true)); break; +- case osSetup: AddSubMenu(new cMenuSetup); break; +- case osCommands: AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); break; ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings(NULL, 0, true); ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + default: break; + } ++ if (menu) ++ if (menu->IsMenu()) ++ AddSubMenu((cOsdMenu *) menu); + } + + cOsdObject *cMenuMain::PluginOsdObject(void) +@@ -3096,13 +3112,34 @@ + eOSState state = cOsdMenu::ProcessKey(Key); + HadSubMenu |= HasSubMenu(); + ++ cOsdObject *menu = NULL; + switch (state) { +- case osSchedule: return AddSubMenu(new cMenuSchedule); +- case osChannels: return AddSubMenu(new cMenuChannels); +- case osTimers: return AddSubMenu(new cMenuTimers); +- case osRecordings: return AddSubMenu(new cMenuRecordings); +- case osSetup: return AddSubMenu(new cMenuSetup); +- case osCommands: return AddSubMenu(new cMenuCommands(tr("Commands"), &Commands)); ++ case osSchedule: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osSchedule", &menu)) ++ menu = new cMenuSchedule; ++ else ++ state = osContinue; ++ break; ++ case osChannels: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osChannels", &menu)) ++ menu = new cMenuChannels; ++ else ++ state = osContinue; ++ break; ++ case osTimers: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osTimers", &menu)) ++ menu = new cMenuTimers; ++ else ++ state = osContinue; ++ break; ++ case osRecordings: ++ if (!cPluginManager::CallFirstService("MainMenuHooksPatch-v1.0::osRecordings", &menu)) ++ menu = new cMenuRecordings; ++ else ++ state = osContinue; ++ break; ++ case osSetup: menu = new cMenuSetup; break; ++ case osCommands: menu = new cMenuCommands(tr("Commands"), &Commands); break; + case osStopRecord: if (Interface->Confirm(tr("Stop recording?"))) { + cOsdItem *item = Get(Current()); + if (item) { +@@ -3154,6 +3191,12 @@ + default: break; + } + } ++ if (menu) { ++ if (menu->IsMenu()) ++ return AddSubMenu((cOsdMenu *) menu); ++ pluginOsdObject = menu; ++ return osPlugin; ++ } + if (!HasSubMenu() && Update(HadSubMenu)) + Display(); + if (Key != kNone) { +diff -ru vdr-1.6.0.orig/config.h vdr-1.6.0/config.h +--- vdr-1.6.0.orig/config.h 2008-03-23 11:26:10.000000000 +0100 ++++ vdr-1.6.0/config.h 2010-10-11 20:32:25.000000000 +0200 +@@ -36,3 +36,7 @@ + // plugins to work with newer versions of the core VDR as long as no + // VDR header files have changed. ++ ++// The MainMenuHook Patch's version number: ++#define MAINMENUHOOKSVERSION "1.0.1" ++#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor + diff --git a/PKGBUILD b/PKGBUILD index 40c8839df8dd..2697f628f6a5 100755..100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,125 +1,110 @@ # Maintainer: M0Rf30 pkgname=vdr-devel -pkgver=2.1.6 +pkgver=2.3.1 pkgrel=1 -arch=('i686' 'x86_64') -pkgdesc="The video disk recorder (VDR)" +pkgdesc="'open' digital satellite receiver and timer controlled video disk recorder" url="ftp://ftp.tvdr.de/vdr/Developer/" +arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h') license=('GPL2') -depends=('fontconfig' 'gettext' 'libjpeg' 'perl') -conflicts=('vdr') -makedepends=('linux-api-headers') -optdepends=('lirc: To use a remote control' - 'runvdr-extreme: An alternative runvdr script' - 'vdrsymbols-ttf: Symbols that some VDR plugins and patches use') -backup=('etc/vdr/channels.conf' - 'etc/vdr/diseqc.conf' - 'etc/vdr/keymacros.conf' - 'etc/vdr/sources.conf' - 'etc/vdr/svdrphosts.conf') -options=(!emptydirs) -install="${pkgname}.install" -source=(ftp://ftp.tvdr.de/vdr/Developer/vdr-${pkgver}.tar.bz2 - Make.config - vdr.conf - vdr.service - vdr-shutdown.sh - vdr-check-setup.sh - vdr-config.sh - vdr-moveto.sh - vdr.tmpfiles - vdr.sudoers - vdr-runvdr.sh - 51-vdr.rules) +depends=('libcap' 'libjpeg-turbo' 'libsystemd' 'perl' 'ttf-font') +makedepends=('systemd') #libsystemd should be enough but the pkg-config file is missing in the libsystemd package +optdepends=('lirc-utils: remote control support' + 'ncurses: skincurses plugin' + 'xlogin: To start X11') +replaces=('runvdr-extreme') +conflicts=('runvdr-extreme' 'vdr') +provides=("vdr-api=2.2.0") +install='vdr.install' +source=("ftp://ftp.tvdr.de/vdr/Developer/vdr-$pkgver.tar.bz2" + 'MainMenuHooks-v1_0_2.diff::http://www.vdr-portal.de/index.php?page=Attachment&attachmentID=30330' + '00-vdr.conf' '50-dvbsddevice.conf' '50-hello.conf' '50-pictures.conf' '50-rcu.conf' + '60-create-dvb-device-units.rules' + 'gen-sddropin' + 'shutdown.sh' + 'shutdown-wrapper.c' + 'vdr.service' + 'vdr.sysuser') +backup=("etc/vdr/conf.avail/"50-dvb{s,h}ddevice.conf + "etc/vdr/conf.avail/"50-{epgtableid0,hello,osddemo,pictures,rcu,skincurses,status,svdrpdemo}.conf + "etc/vdr/conf.avail/"50-svc{cli,svr}.conf + 'etc/vdr/conf.d/00-vdr.conf' + 'var/lib/vdr/channels.conf' + 'var/lib/vdr/diseqc.conf' + 'var/lib/vdr/keymacros.conf' + 'var/lib/vdr/scr.conf' + 'var/lib/vdr/sources.conf' + 'var/lib/vdr/svdrphosts.conf') + +prepare() { + cd "${srcdir}/vdr-${pkgver}" + + echo 'CFLAGS += -O3' > Make.config + echo 'CXXFLAGS += -O3' >> Make.config + echo 'PREFIX = /usr' >> Make.config + echo 'LIBDIR = /usr/lib/vdr/plugins' >> Make.config + echo 'VDR_USER = vdr' >> Make.config + echo 'SDNOTIFY = 1' >> Make.config + echo 'LIRC_DEVICE = /run/lirc/lircd' >> Make.config + + sed -i 's/NULL, 0, true/NULL, 0, OpenSubMenus/g' "$srcdir/MainMenuHooks-v1_0_2.diff" + patch -p1 -i "$srcdir/MainMenuHooks-v1_0_2.diff" + + sed -i '/define DEPRECATED_VIDEOSYSTEM/d' device.h + sed -i '/define DEPRECATED_VDR_CHARSET_OVERRIDE/d' vdr.c +} build() { - cd $srcdir/vdr-$pkgver - -# Patches -msg2 "Disable some graphs that end up too big to be useful" - for g in COLLABORATION INCLUDE INCLUDED_BY ; do - sed -i -e 's/^\(\s*'$g'_GRAPH\s*=\s*\).*/\1NO/' Doxyfile - done - -msg2 "Update lirc socket location in man page" - sed -i "s|/dev/lircd|/var/run/lirc/lircd|g" vdr.1 - -msg2 "Don't install runvdr" - sed -i "s|runvdr ||g" Makefile - - # VDR directory environment (Make.config): - # MANDIR = /usr/share/man - # BINDIR = /usr/bin - # LOCDIR = /usr/share/locale - # PLUGINLIBDIR = /usr/lib/vdr - # VIDEODIR = /var/spool/video - # CONFDIR = /etc/vdr - # Also: - # VDR_USER = vdr - - cp ../Make.config Make.config -msg2 "Buildin..." - #unset PREFIX - make PREFIX=/usr + gcc -o shutdown-wrapper shutdown-wrapper.c + + cd "${srcdir}/vdr-${pkgver}" + make } -package(){ - cd $srcdir/vdr-$pkgver - make DESTDIR="$pkgdir" PREFIX=/usr install - - install -d -m755 $pkgdir/usr/bin - install -d -m755 $pkgdir/usr/include/vdr/include - install -d -m755 $pkgdir/usr/include/vdr/libsi - install -d -m755 $pkgdir/usr/share/doc/vdr - install -d -m755 $pkgdir/etc/vdr/vdr-plugins.d - -msg2 "Install utility scripts" - install -m755 ../vdr-check-setup.sh $pkgdir/usr/bin/vdr-check-setup - install -m755 ../vdr-config.sh $pkgdir/usr/bin/vdr-config - install -m755 ../vdr-moveto.sh $pkgdir/usr/bin/vdr-moveto - chmod +x $pkgdir/usr/bin/* - install -m755 epg2html $pkgdir/usr/bin/epg2html - -msg2 "Install Make.config and vdr header files" - install -m644 Make.config $pkgdir/usr/include/vdr - install -m644 *.h $pkgdir/usr/include/vdr - install -m644 libsi/*.h $pkgdir/usr/include/vdr/libsi - ln -sf .. $pkgdir/usr/include/vdr/include/vdr - ln -sf ../libsi $pkgdir/usr/include/vdr/include/libsi - -msg2 "Install udev rules" - mkdir -p $pkgdir/usr/lib/udev/rules.d/ - cp $srcdir/51-vdr.rules $pkgdir/usr/lib/udev/rules.d/51-vdr.rules - chmod a+r $pkgdir/usr/lib/udev/rules.d/51-vdr.rules - -msg2 "Init services file" - install -D -m644 ../vdr.conf $pkgdir/etc/vdr/vdr - install -D -m644 ../vdr.service $pkgdir/usr/lib/systemd/system/vdr.service - install -D -m644 ../vdr.tmpfiles $pkgdir/usr/lib/tmpfiles.d/vdr.conf - install -m644 ../vdr-runvdr.sh $pkgdir/usr/sbin/runvdr - chmod +x $pkgdir/usr/sbin/runvdr - -msg2 "Sudoers file" - install -D -m755 ../vdr.sudoers $pkgdir/etc/sudoers.d/vdr -msg2 "Vdr-shutdown.sh" - install -m755 $srcdir/vdr-shutdown.sh $pkgdir/usr/bin/vdr-shutdown.sh - -msg2 "Install documents" - for _document in channels.conf* *.template CONTRIBUTORS HISTORY INSTALL MANUAL PLUGINS.html README* UPDATE*; do - install -m644 ${_document} $pkgdir/usr/share/doc/vdr +package() { + for i in dvbsddevice hello pictures rcu; do + install -Dm644 50-$i.conf "$pkgdir/etc/vdr/conf.avail/50-$i.conf" done + + install -Dm644 00-vdr.conf "$pkgdir/etc/vdr/conf.d/00-vdr.conf" + install -Dm644 60-create-dvb-device-units.rules "$pkgdir/usr/lib/udev/rules.d/60-create-dvb-device-units.rules" + install -Dm644 vdr.service "$pkgdir/usr/lib/systemd/system/vdr.service" + + install -Dm754 shutdown-wrapper "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper" + chgrp 666 "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper" + chmod u+s "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper" + + install -Dm755 gen-sddropin "$pkgdir/usr/bin/vdr-gensddropin" + install -Dm755 shutdown.sh "$pkgdir/usr/lib/vdr/bin/shutdown.sh" + + #Install sysuser config + install -Dm644 ${srcdir}/vdr.sysuser "$pkgdir/usr/lib/sysusers.d/vdr.conf" + + for i in dvbhddevice epgtableid0 osddemo skincurses status svc{cli,svr} svdrpdemo; do + echo "[$i]" > "$pkgdir/etc/vdr/conf.avail/50-$i.conf" + done + + cd "${srcdir}/vdr-${pkgver}" + mkdir -p "$pkgdir/var/lib/vdr" + make DESTDIR="${pkgdir}" install + + mkdir -p "$pkgdir/usr/share/vdr/shutdown-hooks" + + chown -R 666:666 "$pkgdir/srv/vdr" + chown -R 666:666 "$pkgdir/var/cache/vdr" + chown -R 666:666 "$pkgdir/var/lib/vdr" } -md5sums=('79519dac59166fabc2029b916bd61d00' - 'b2daabab143f879e8fb02f939d942202' - '729bd6dffe7493f30b70f1a76ba8da43' - 'b216bcc3c7f44f9d47284a2df54f62a4' - 'd96642acceb658209d7a4d3867a9dab4' - '7cc69205b789906a59563fe94bd03db7' - '39ea8344b770a9f9fba7b71f1e2640da' - '01b49f61a78690e8894ab662e84d6f2f' - '3b19cfb57d7632246798f115bf60b4cb' - 'a05c9ef5d30e33d5ea5bee43c72eac31' - 'e867e399822ca441e60c8daa7867ba11' - 'cb8ce90f5602fa99e13f72be57ad0954') +md5sums=('391c2ed60e2f7d24563fe3ed5854bc4f' + '301c9b9766ed5182b07f1debc79abc21' + 'de3dcdea1a4282211c6dac370019548b' + '9cb821ebb6a25e603f9c32bafabde362' + 'fc450f75037b8712673db4969a1dd758' + 'f00583e3f5507b0ff935b4d5919e7df2' + '1d637e4f97adc66ef84615897116f29a' + '23d6e1ca0a36cfdbd35d3b1a61f0a105' + '3565ca5ad9be5c75f66478f0796b120d' + 'dd20f932b846b5f50ac455b65e9432ad' + '7cad811b4ac5ee6c0b5496d006f1e0ee' + '64979737d26758a75dda488b323c293c' + '59ce04d1d01bf92bf6cfc0b74223191c') diff --git a/gen-sddropin b/gen-sddropin new file mode 100644 index 000000000000..b3ee8c8de8b1 --- /dev/null +++ b/gen-sddropin @@ -0,0 +1,19 @@ +#!/usr/bin/bash +FILE=/etc/systemd/system/vdr.service.d/wait-for-devices.conf + +if [ -d /dev/dvb/adapter0 ]; then + mkdir -p $(dirname $FILE) + echo "Replace or create the file $FILE" + echo "with the following" + echo + echo '[Unit]' + + cd /dev + for dev in dvb/adapter*/*; do + stringpart=$(tr / - <<< $dev) + echo "Wants=dev-$stringpart.device" + echo "After=dev-$stringpart.device" + done +else + echo "No DVB devices detected. No systemd rule needed" +fi
\ No newline at end of file diff --git a/shutdown-wrapper.c b/shutdown-wrapper.c new file mode 100644 index 000000000000..6708fa2f418c --- /dev/null +++ b/shutdown-wrapper.c @@ -0,0 +1,27 @@ +// +// Simple shutdown-wrapper with focus on security +// +// Version: 1.0 Thu Jul 9 16:28:42 CEST 2009 +// +// Author: Manuel Reimer <manuel.reimer@gmx.de> +// + +#define REAL_PATH "/usr/lib/vdr/bin/shutdown.sh" + +#include <unistd.h> + +int main(int argc, char *argv[]){ + // We pass a secure environment to the called script. + char *const envParms[4] = { + "PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin", + "HOME=/root", + "TERM=linux", + NULL + }; + // Drop whatever working directory the caller set for us and go HOME + chdir("/root"); + // Get root and execute shutdown.sh + setuid(0); + execve(REAL_PATH, argv, envParms); + return 0; +} diff --git a/shutdown.sh b/shutdown.sh new file mode 100755 index 000000000000..08c2aaa6499b --- /dev/null +++ b/shutdown.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#Run through shutdown-hooks +for file in /usr/lib/vdr/shutdown-hooks/*; do + if [ -x $file ]; then + MESSAGE=$($file) + if [ $? != '0' ]; then + MESSAGE=$(echo "$MESSAGE" | sed -rn '0,/ABORT_MESSAGE/s/^ABORT_MESSAGE="?([^"]+).*/\1/p') + svdrpsend MESG "$MESSAGE" + exit 1 + fi + fi +done + +#Sync back system time to hardware time (Maybe VDR has changed it) +hwclock --systohc --utc + +#Unset previous timer +echo '0' > /sys/class/rtc/rtc0/wakealarm + +#Set new timer 5mins before recording starts +echo $(($1 - 300 )) > /sys/class/rtc/rtc0/wakealarm + +#Initiate shutdown +systemctl poweroff diff --git a/vdr.install b/vdr.install new file mode 100644 index 000000000000..553539b766a1 --- /dev/null +++ b/vdr.install @@ -0,0 +1,42 @@ +_common() { + if diff /etc/skel/.xinitrc /home/vdr/.xinitrc > /dev/null 2>&1 || + [ ! -e /home/vdr/.xinitrc ]; then + + cat <<'EOF' > /home/vdr/.xinitrc +#!/bin/sh +# +# ~/.xinitrc +# +# Executed by startx (run your window manager from here) + +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +# exec gnome-session +# exec startkde +# exec startxfce4 +# ...or the Window Manager of your choice +kill -STOP "$$" # Comment this when using a window manager +EOF + fi +} + +post_install() { + #Add vdr user + systemd-sysusers + + # systemd-sysusers doesn't create our homedirectory... + mkdir -m 0711 -p /home/vdr + chown vdr:vdr /home/vdr + + _common +} + +post_upgrade() { + echo "Remember!! VDR has to run after all DVB devices are initialized" + echo "To generate a template rule for systemd run 'vdr-gensddropin" +}
\ No newline at end of file diff --git a/vdr.service b/vdr.service index eb067123745d..06845524ce43 100755..100644 --- a/vdr.service +++ b/vdr.service @@ -1,15 +1,15 @@ [Unit] Description=Video Disk Recorder -Documentation=man:vdr(1) -Documentation=file:///usr/share/doc/vdr/INSTALL -After=syslog.target network.target lirc.service +After=oscam.service +After=sundtek.service +After=xlogin@vdr.service [Service] -Environment=VDR_INIT=1 -ExecStartPre=/usr/bin/vdr-check-setup -ExecStart=/usr/sbin/runvdr -ExecStop=-/usr/sbin/runvdr --set-wakeup -StandardOutput=null +Type=notify +ExecStart=/usr/bin/vdr +Environment=TERM=xterm +Restart=on-failure +RestartPreventExitStatus=2 [Install] WantedBy=multi-user.target diff --git a/vdr.sysuser b/vdr.sysuser new file mode 100644 index 000000000000..3aedb7ef4553 --- /dev/null +++ b/vdr.sysuser @@ -0,0 +1,8 @@ +u vdr 666 vdr /home/vdr +m vdr audio +m vdr lp +m vdr optical +m vdr storage +m vdr video +m vdr power +m vdr uucp |