diff -Nru vdr-1.0.0/debian/patches/00list vdr-1.2.6/debian/patches/00list --- vdr-1.0.0/debian/patches/00list 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/patches/00list 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,29 @@ +01_vdr_1.2.6-3.1.diff.gz +01_gcc3.4-FTBFS-fix +#01_gcc4.0-FTBFS-fix +02_Makefile-CFGDIR +03_cmdsubmenu +04_newplugin +05_set_system_time_as_user +06_default_svdrp_port_0 +07_not_as_root +08_security_CAN-2005-0071 +09_amd64_epg +13_remote + +# The Elchi AIO 4d patch for a nicer OSD, inlcuding the frames and black +# square fix. +# opt-20_elchiaio4d+1 + +# Patch needed for ttxtsubs (does not work with AC3-patch) +# opt-21_ttxtsubs + +# This patch fixes a problem with 256 color, by changing char to unsigned +# char. +# opt-22_8bitcolor + +# Patch to support variable color for osdpip plugin +# opt-23_osdpip-0.0.3 + +# The Jump patch allows automatic jumping over cutting marks. +# opt-24_jumpplay-0.4 diff -Nru vdr-1.0.0/debian/patches/06_default_svdrp_port_0.dpatch vdr-1.2.6/debian/patches/06_default_svdrp_port_0.dpatch --- vdr-1.0.0/debian/patches/06_default_svdrp_port_0.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/patches/06_default_svdrp_port_0.dpatch 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 06_default_svdrp_port_0.dpatch by Thomas Schmidt +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This sets the default svdrp-port to 0, which means that +## DP: SVDRP is disabled by default unless someone specifies +## DP: another port with the --port option when starting vdr + +@DPATCH@ +diff -urNad vdr-1.2.6/vdr.c /tmp/dpep.38cW8S/vdr-1.2.6/vdr.c +--- vdr-1.2.6/vdr.c 2004-04-22 12:48:59.000000000 +0200 ++++ /tmp/dpep.38cW8S/vdr-1.2.6/vdr.c 2005-01-15 18:51:46.000000000 +0100 +@@ -90,7 +90,7 @@ + + // Command line options: + +-#define DEFAULTSVDRPPORT 2001 ++#define DEFAULTSVDRPPORT 0 + #define DEFAULTWATCHDOG 0 // seconds + #define DEFAULTPLUGINDIR PLUGINDIR + diff -Nru vdr-1.0.0/debian/patches/07_not_as_root.dpatch vdr-1.2.6/debian/patches/07_not_as_root.dpatch --- vdr-1.0.0/debian/patches/07_not_as_root.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/patches/07_not_as_root.dpatch 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,101 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07_not_as_root.dpatch by Thomas Schmidt +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Refuse to run vdr as user root, except when using the +## DP: --allow-root option + +@DPATCH@ +diff -urNad vdr/vdr.c /tmp/dpep.Qz74kG/vdr/vdr.c +--- vdr/vdr.c 2005-04-10 15:51:35.000000000 +0200 ++++ /tmp/dpep.Qz74kG/vdr/vdr.c 2005-04-10 15:53:03.000000000 +0200 +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include "audio.h" + #include "channels.h" + #include "config.h" +@@ -202,8 +203,10 @@ + cPluginManager PluginManager(DEFAULTPLUGINDIR); + const char* username = NULL; + const char* groupname = NULL; ++ bool IsAllowRootAnyway = false; + + static struct option long_options[] = { ++ { "allow-root",no_argument, NULL, '!' }, + { "audio", required_argument, NULL, 'a' }, + { "config", required_argument, NULL, 'c' }, + { "daemon", no_argument, NULL, 'd' }, +@@ -321,16 +324,36 @@ + break; + case 'g': groupname = optarg; + break; ++ case '!': IsAllowRootAnyway = true; ++ break; + default: return 2; + } + } + ++ // Check if the program should run as root ++ bool IsRoot=0; ++ ++ if (username == NULL && groupname == NULL) ++ IsRoot = !getuid () || !getgid () || !geteuid () || !getegid (); ++ else { ++ if (username != NULL) { ++ if (strcmp(username,"root") == 0) ++ IsRoot = 1; ++ } ++ if (groupname != NULL) { ++ if (strcmp(groupname,"root") == 0) ++ IsRoot = 1; ++ } ++ } ++ + // Help and version info: + + if (DisplayHelp || DisplayVersion) { +- if (!PluginManager.HasPlugins()) +- PluginManager.AddPlugin("*"); // adds all available plugins +- PluginManager.LoadPlugins(); ++ if (!IsRoot || IsAllowRootAnyway) { ++ if (!PluginManager.HasPlugins()) ++ PluginManager.AddPlugin("*"); // adds all available plugins ++ PluginManager.LoadPlugins(); ++ } + if (DisplayHelp) { + printf("Usage: vdr [OPTIONS]\n\n" // for easier orientation, this is column 80| + " -a CMD, --audio=CMD send Dolby Digital audio to stdin of command CMD\n" +@@ -374,7 +397,7 @@ + } + if (DisplayVersion) + printf("vdr (%s) - The Video Disk Recorder\n", VDRVERSION); +- if (PluginManager.HasPlugins()) { ++ if ((!IsRoot || IsAllowRootAnyway) && PluginManager.HasPlugins()) { + if (DisplayHelp) + printf("Plugins: vdr -P\"name [OPTIONS]\"\n\n"); + for (int i = 0; ; i++) { +@@ -394,9 +417,20 @@ + return 0; + } + ++ if (IsRoot) { ++ if (IsAllowRootAnyway) { ++ char* rootWarning="Warning! VDR started with root privileges"; ++ isyslog(rootWarning); ++ fprintf(stderr, "%s\n", rootWarning); ++ } else { ++ fprintf (stderr, "%s: sorry, I refuse to run with root privileges\n", argv[0]); ++ return 0; ++ } ++ } ++ + // Only try to change capabilities/user when vdr is called by + // root +- if (!getuid () || !getgid () || !geteuid () || !getegid ()) { ++ if (!IsAllowRootAnyway && (!getuid () || !getgid () || !geteuid () || !getegid ())) { + if(username && set_keepcaps() != 0) + return 2; + diff -Nru vdr-1.0.0/debian/patches/08_security_CAN-2005-0071.dpatch vdr-1.2.6/debian/patches/08_security_CAN-2005-0071.dpatch --- vdr-1.0.0/debian/patches/08_security_CAN-2005-0071.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/patches/08_security_CAN-2005-0071.dpatch 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 08_security_CAN-2005-0071.dpatch by Thomas Schmidt +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixes CAN-2005-0071 (It is not possible to overwrite files with +## DP: the GRAB-Command anymore) + +@DPATCH@ +diff -urNad vdr-1.2.6/dvbdevice.c /tmp/dpep.80S4AN/vdr-1.2.6/dvbdevice.c +--- vdr-1.2.6/dvbdevice.c 2004-04-22 12:48:31.000000000 +0200 ++++ /tmp/dpep.80S4AN/vdr-1.2.6/dvbdevice.c 2005-01-16 21:51:24.000000000 +0100 +@@ -505,8 +505,10 @@ + Quality = 255; //XXX is this 'best'??? + + isyslog("grabbing to %s (%s %d %d %d)", FileName, Jpeg ? "JPEG" : "PNM", Quality, vm.width, vm.height); +- FILE *f = fopen(FileName, "wb"); +- if (f) { ++ int fd = open(FileName, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 00640); ++ if (fd > -1) { ++ FILE *f = fdopen(fd, "wb"); ++ if (f) { + if (Jpeg) { + // write JPEG file: + struct jpeg_compress_struct cinfo; +@@ -540,7 +542,8 @@ + } + } + fclose(f); +- } ++ } ++ } + else { + LOG_ERROR_STR(FileName); + result |= 1; diff -Nru vdr-1.0.0/debian/patches/security-compatibility-videodir.diff vdr-1.2.6/debian/patches/security-compatibility-videodir.diff --- vdr-1.0.0/debian/patches/security-compatibility-videodir.diff 2002-04-03 13:12:07.000000000 +0200 +++ vdr-1.2.6/debian/patches/security-compatibility-videodir.diff 1970-01-01 01:00:00.000000000 +0100 @@ -1,78 +0,0 @@ ---- vdr-0.98+1.0.0pre5.orig/Makefile -+++ vdr-0.98+1.0.0pre5/Makefile -@@ -55,7 +55,7 @@ - # Implicit rules: - - %.o: %.c -- g++ -g -O2 -Wall -Woverloaded-virtual -m486 -c $(DEFINES) $(INCLUDES) $< -+ g++ -g -O2 -Wall -Woverloaded-virtual -c $(DEFINES) $(INCLUDES) $< - - # Dependencies: - ---- vdr-0.98+1.0.0pre5.orig/vdr.c -+++ vdr-0.98+1.0.0pre5/vdr.c -@@ -39,6 +39,7 @@ - #include "recording.h" - #include "tools.h" - #include "videodir.h" -+#include - - #ifdef REMOTE_KBD - #define KEYS_CONF "keys-pc.conf" -@@ -77,7 +78,12 @@ - - // Command line options: - -+// changed by the Debian maintainer -+/*#if defined(REMOTE_NONE) - #define DEFAULTSVDRPPORT 2001 -+#else */ -+#define DEFAULTSVDRPPORT 0 -+/*#endif */ - #define DEFAULTWATCHDOG 0 // seconds - - int SVDRPport = DEFAULTSVDRPPORT; -@@ -87,6 +93,7 @@ - int WatchdogTimeout = DEFAULTWATCHDOG; - const char *Terminal = NULL; - const char *Shutdown = NULL; -+ VideoDirectory = getenv("HOME"); - - static struct option long_options[] = { - { "audio", required_argument, NULL, 'a' }, -@@ -177,7 +184,7 @@ - break; - case 'p': if (isnumber(optarg)) - SVDRPport = atoi(optarg); -- else { -+ else { - fprintf(stderr, "vdr: invalid port number: %s\n", optarg); - return 2; - } -@@ -254,6 +261,16 @@ - - if (!ConfigDirectory) - ConfigDirectory = VideoDirectory; -+ -+ /* added by Debian maintainer: installs a template of the channel.conf file */ -+ char *bla, *bla2, *bla3; -+ bla = (char *) malloc (strlen(ConfigDirectory) + 120); -+ strcpy(bla, ConfigDirectory); -+ strcat(bla,"/channels.conf"); -+ bla2 = strdup(bla); -+ bla3= strdup(bla); -+ sprintf(bla, "if [ -f /usr/share/doc/vdr/examples/channels.conf.gz -a ! -f %s ] ; then zcat /usr/share/doc/vdr/examples/channels.conf.gz >> %s ; fi", bla2, bla3); -+ system(bla); - - Setup.Load(AddDirectory(ConfigDirectory, "setup.conf")); - Channels.Load(AddDirectory(ConfigDirectory, "channels.conf")); ---- vdr-0.98+1.0.0pre5.orig/videodir.c -+++ vdr-0.98+1.0.0pre5/videodir.c -@@ -39,6 +39,7 @@ - - cVideoDirectory::cVideoDirectory(void) - { -+// VideoDirectory = getenv("HOME"); - length = strlen(VideoDirectory); - name = (VideoDirectory[length - 1] == '0') ? strdup(VideoDirectory) : NULL; - stored = adjusted = NULL; diff -Nru vdr-1.0.0/debian/patches/security-z50_CAN-2005-0071_fopen vdr-1.2.6/debian/patches/security-z50_CAN-2005-0071_fopen --- vdr-1.0.0/debian/patches/security-z50_CAN-2005-0071_fopen 2005-01-16 15:43:59.000000000 +0100 +++ vdr-1.2.6/debian/patches/security-z50_CAN-2005-0071_fopen 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -diff -u -p -Nr --exclude CVS vdr-1.0.0.orig/dvbapi.c vdr-1.0.0/dvbapi.c ---- vdr-1.0.0.orig/dvbapi.c 2002-04-07 11:35:51.000000000 +0200 -+++ vdr-1.0.0/dvbapi.c 2005-01-16 15:41:39.000000000 +0100 -@@ -1987,8 +1987,10 @@ bool cDvbApi::GrabImage(const char *File - Quality = 255; //XXX is this 'best'??? - - isyslog(LOG_INFO, "grabbing to %s (%s %d %d %d)", FileName, Jpeg ? "JPEG" : "PNM", Quality, vm.width, vm.height); -- FILE *f = fopen(FileName, "wb"); -- if (f) { -+ int fd = open(FileName, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600); -+ if (fd > -1) { -+ FILE *f = fdopen(fd, "wb"); -+ if (f) { - if (Jpeg) { - // write JPEG file: - struct jpeg_compress_struct cinfo; -@@ -2022,7 +2024,8 @@ bool cDvbApi::GrabImage(const char *File - } - } - fclose(f); -- } -+ } -+ } - else { - LOG_ERROR_STR(FileName); - result |= 1; diff -Nru vdr-1.0.0/debian/README.Debian vdr-1.2.6/debian/README.Debian --- vdr-1.0.0/debian/README.Debian 2002-04-03 12:46:01.000000000 +0200 +++ vdr-1.2.6/debian/README.Debian 2006-05-18 20:03:12.000000000 +0200 @@ -3,16 +3,184 @@ Comments to the Debian version: - - The SVDRP port is disabled by default for security reasons. Feel free to - specify the --port option and it will be enabled. - You need a DVB card and with a driver using the "Linux DVB API" - (http://www.linuxtv.org/developer/dvbapi.xml). Currently only the drivers - for Siemens based cards are available, but it is not clear whether they may - be added to Debian before the Firmware license has been clarified. - - the default video directory is the home directory. Can be changed with the - -v option. - - example channel lists can be found in the documentation directory. + (http://www.linuxtv.org/developer/dvbapi.xml). The standard VDR + (without special plugins) requires a DVB-Card with an integrated + mpeg-decoder, a so called Full-Featured Card. (For example the + Hauppauge Nexus, or a TechnoTrend FullFeatured 1.x) - all the small scripts and tools distributed with the package are located in - /usr/share/vdr/. You may use and modify them for you own purposes. + /usr/lib/vdr/. You may use and modify them for you own purposes. + - if you want to use the vdr-initscript, edit /etc/default/vdr and change + ENABLED=0 to ENABLED=1, and the other Options in this file + - video-dir is moved to /var/lib/video see #234429 + - cfg-dir was moved to /var/lib/vdr, to be FHS-compliant + - The selection of your favourite vdr-binary (vdr-daemon, vdr-kbd, vdr-lirc or + vdr-rcu) is now handeled via update-alternatives, so if you have more than + one of this packages installed, and are not happy with the default + priorities, you can select the binary via "update-alternatives --config vdr" - -- Eduard Bloch , Thu, 13 Dec 2001 01:18:49 +0100 + -- Thomas Schmidt , Tue, 28 Dec 2004 14:22:21 +0100 + + +Automatic Loading of Plugins +---------------------------- + +When starting vdr with "/etc/init.d/vdr start", for each plugin found in +/usr/lib/vdr/plugins the appropriate command line argument -P +will be created automatically. + +If a file /var/lib/vdr/plugins/plugin..conf exists, it will be +parsed for command line arguments for the specified plugin. This file may +contain comments preceeded by a "#" and the command line arguments may also be +distributed across several lines. + + -- Tobias Grimm , Sun, 23 May 2004 18:00:00 +0100 + + +Command-Hooks +------------- + +VDR has the ability, to start external commands using the OSD menu. There are +two types of external commands - normal commands and recording commands. Normal +commands are shown under VDR's main menu entry "commands" while, recording +commands are accessible only in VDR's recordings menu. While normal commands are +executed without any parameters, recording commands will receive the directory +of the selected recording as the first command line argument. + +In order to allow other packages (Addons) to install their own commands, the +command files passed to vdr in /etc/init.d/vdr are generated out of the files +commands..conf and reccmds..conf found in +/usr/share/vdr/command-hooks/. normally should be the name of +the package, that wants to add these commands to VDR. The order of the +commands can be definded in the files order.commands.conf and order.reccmds.conf +in /etc/vdr/command-hooks/. + +If the author of a package wants the user to be able to customize the commands +added to vdr, the command file should be installed to /etc/vdr/command-hooks/ +and only symlinked to /usr/share/vdr/command-hooks/. + +For a description of the command file syntax, refer to commands.conf and +reccmds.conf in the vdr documention. + +Commands added by the user, should go to commands.custom.conf and +reccmds.custom.conf in /etc/vdr/command-hooks/. These files contain also some +examples. + + -- Tobias Grimm , Sun, 23 May 2004 18:00:00 +0100 + + +Recording-Hooks +--------------- + +VDR can execute an external command before a recording starts, after a +recording ends and after a recording has been edited. +In order to allow other packages to specify their own recording actions, +all files in /usr/share/vdr/recording-hooks are executed one after another. +If a file is not an executable or a link to an executable, it is executed as +a shell script. + +Recording hooks are called in their alphabetical order and should follow this +naming scheme: + +R. + +Where is a two digit number, that mainly specifies the execution order +and is a unique descriptor. + +Two parameters are passed to each recording hook: + +Parameter 1 can have the values "before", "after" and "edited", depending +on whether the recording hook is called before the recording starts, +after the recording ends or after the recording has been edited. + +Parameter 2 is the directory of the recording. Be aware, that this directory +doesn't exist before the recording starts. + +If the author of a package wants the user to be able to customize a recording +hook, it should be installed to /etc/vdr/recording-hooks/ and only symlinked +to /usr/share/vdr/recording-hooks/. + +Custom user commands associated with the vdr package, can be added by the user +to /etc/vdr/recording-hooks/R90.custom. + + -- Tobias Grimm , Sun, 23 May 2004 19:00:00 +0100 + + +Shutdown-Hooks +--------------- + +If you press the power key on your remote control, VDR executes a script +provided by the command line option -s. By default, this script will +execute all files in /usr/share/vdr/command-hooks in their alphabetical order. +If a file in there is not executable, it is treated as a shell script. These +so called "Shutdown Hooks" should follow this naming scheme: + +S. + +Where is a two digit number, that mainly specifies the execution order +and is a unique descriptor. + +All shutdown hooks will be passed the same parameters as the main shutdown +script. I.e. the first parameter is the start time of the next timer. Please +refer to the vdr documentation for the other parameters. + +After all shutdown hooks have been process, VDR will be terminated and the +machine will be shut down. + +A shutdown hook may abort the shutdown process by exiting with an errorlevel +unequal to 0. To provide the user with an OSD-message about the reason for +aborting the shutdown, the shutdown hook may write an abort message to stdout +like this: + +ABORT_MESSAGE= + +If the shutdown should only be deferred (i.e. because some background process, +is still active), the shutdown hook may write to stdout: + +TRY_AGAIN= + +In this case, no further shutdown hooks will be processed and the shutdown will +be invoked in TRY_AGAIN minutes again. + +To overwrite the command defined in /etc/default/vdr that will be executed to +shutdown the machine after all shutdown hooks have been processed, a shutdown +hook may write to stdout: + +SHUTDOWNCMD= + +Optional Patches +---------------- + +A lot of VDR enthusiasts have improved VDR by creating patches that fix +existing problems or add new functionality. Some of these patches may not work +for everyone, so we decided to make them optional. This means, that these +patches are only included as dpatch files in the vdr source package, NOT in +the binary packages. They are named opt-_, where is a +two-digit-number and a unique identifier. To enable a patch, just +uncomment it in debian/patches/00list and recompile vdr. + +Most of these optional patches modify the interfaces used by the plugins. This +means, that the plugins become binary incompatible. If you activate/deactivate +patches in the vdr package, all plugins must be recompiled with the new vdr-dev +package! There is only one exception from this rule - patches named +opt--x_ do not affect the plugin interfaces and can therefore +be enabled or disabled without the need to recompile the plugins. + +If you decide to compile your own patched vdr packages, you should set +PLUGIN_CHECK_PATCHLEVEL="yes" in /etc/default/vdr. With this enabled, vdr +will only load plugins, that have been compiled with the correct vdr patch. This +checking is done by using a custom control field called "vdr-patchlevel". When +compiling vdr with some optional patches enabled, these patches will be listed +in this control field and added to vdr-dev as /usr/include/vdr/patchlevel. +When compiling a plugin, this patchlevel file is added as the "vdr-patchlevel" +control field to the plugins binary package. By comparing the "vdr-patchlevel" +field of vdr and the plugin packages, the vdr package can decide whether to +load a plugin or not. + +Keep in mind, that if you enable any optional patches, you can't use apt-get +anymore on the official Debian repositories to update existing vdr or plugin +packages or install additional plugins. You always have to compile the plugins +yourself! The optional patches are mainly intended for people who would like to +create their own customized vdr distribution. + + -- Tobias Grimm , Thu, 3 Jun 2004 02:20:00 +0100 diff -Nru vdr-1.0.0/debian/runvdr vdr-1.2.6/debian/runvdr --- vdr-1.0.0/debian/runvdr 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/runvdr 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,58 @@ +#!/bin/bash +# +# + +. /usr/lib/vdr/config-loader.sh + +OPTIONS="$*" +if [ "$NONPTL" = "1" -a `uname -m` != x86_64 ]; then + VDRCMD="LD_ASSUME_KERNEL=2.4 /usr/bin/vdr $OPTIONS" +else + VDRCMD="/usr/bin/vdr $OPTIONS" +fi + +function get_modulenames () +{ + KVERS=`uname -r | grep -e '2.6'` + if [ -z "$KVERS" ]; then + MODULES=`lsmod | grep dvb-core | cut -d'[' -f2 | cut -d']' -f1` + else + MODULES=`lsmod | grep ^dvb_core | awk '{print $4;}' | awk '{ gsub(/,/," ", $1); print }'` + fi +} + +function set_permissions () +{ + for FILE in av7110_ir budget_ci_ir; do + if [ -e "/proc/$FILE" ]; then + chown $USER.$GROUP /proc/$FILE + fi + done +} + +get_modulenames + +if [ -z "$MODULES" ]; then # If no DVB-Modules were found, try to load + modprobe dvb > /dev/null 2>&1 # the module with the name dvb, this could + get_modulenames # be an alias for the dvb-ttpci-module or +fi # another dvb-module + +MODULES="$MODULES dvb-core" + +while (true) do + set_permissions + eval $VDRCMD >/dev/null 2>&1 + if test $? -eq 0; then exit; fi + logger "restarting VDR" + /usr/bin/killall -q -TERM /usr/bin/vdr + sleep 10 + + for MODULE in $MODULES; do + rmmod $MODULE >/dev/null 2>&1 + wait `pidof rmmod` + done + + for MODULE in $MODULES; do + modprobe $MODULE >/dev/null 2>&1 + done +done diff -Nru vdr-1.0.0/debian/runvdr.8 vdr-1.2.6/debian/runvdr.8 --- vdr-1.0.0/debian/runvdr.8 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/runvdr.8 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,27 @@ +.\" Man page for runvdr + +.TH runvdr 8 +.SH NAME +runvdr +.SH DESCRIPTION +.B runvdr +is called by the init-script of vdr. It acts as a watchdog for vdr and will +reload the dvb-modules and vdr, if vdr exits with an exitcode different from 0. + +.B runvdr +will call /usr/bin/vdr and will pass all Commandline-options directly to +/usr/bin/vdr. + +.B runvdr +needs to be called by root in order to work correct, because it will try to +unload/load kernel-modules! + +.SH AUTHOR +This man-page has been written by Thomas Schmidt +.PP +Permission is granted to copy, distribute and/or modify this document under +the terms of the GNU General Public License, Version 2 any +later version published by the Free Software Foundation. +.PP +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common\-licenses/GPL. diff -Nru vdr-1.0.0/debian/vdr.default vdr-1.2.6/debian/vdr.default --- vdr-1.0.0/debian/vdr.default 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.default 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,31 @@ +# /etc/default/vdr + +# Change to 1 to enable vdr's init-script +ENABLED=0 + +# Change this to 1 if you want vdr to be able to shutdown the +# computer +ENABLE_SHUTDOWN=0 + +# Video-Directory +VIDEO_DIR="/var/lib/video.00" + +# Set this to load only startable plugins (check with "vdr -V -P plugin") +PLUGIN_CHECK_STARTABLE="yes" + +# Set this to load only plugins with the correct patch level +PLUGIN_CHECK_PATCHLEVEL="no" + +# Options that will be passed to vdr's commandline +# for example: OPTIONS="-w 15" +OPTIONS="-w 60" + +# VDR executes this command when the power-off-key of the remote is +# pressed after processing all shutdown hook scripts. Shutdown hooks +# may override this command - see /usr/share/doc/vdr/README.Debian. +SHUTDOWNCMD="/etc/init.d/vdr stop ; sleep 1 ; /sbin/shutdown -h now" + +# Change this to 0 if you want to allow VDR to use NPTL (if available). +# This is disabled by default, although it should be safe to enable it. +# (This has no effect on AMD64 machines.) +NONPTL=1 diff -Nru vdr-1.0.0/debian/vdr.init vdr-1.2.6/debian/vdr.init --- vdr-1.0.0/debian/vdr.init 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.init 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,80 @@ +#! /bin/bash +# +# vdr start-stop script +# + +test -x /usr/sbin/runvdr || exit 0 + +. /usr/lib/vdr/config-loader.sh + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +NAME=vdr +DESC="Linux Video Disk Recorder" + +test "$ENABLE_SHUTDOWN" = "1" && VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown.wrapper" \ + || VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown-message" + +test "$ENABLED" != "0" || exit 0 + +startvdr() +{ + # only start vdr if there is no other instance running + # (Appears as vdr-kbd in the official debian-packages + # and just as vdr in the c't-vdr packages) + if ! ps ax | grep "/usr/bin/\(vdr\|vdr-kbd\) " | grep -qv grep + then + . /usr/lib/vdr/plugin-loader.sh + . /usr/lib/vdr/commands-loader.sh + getplugins + mergecommands "commands" + mergecommands "reccmds" + start-stop-daemon --start --quiet \ + --exec /usr/sbin/runvdr -- -v $VIDEO_DIR -c $CFG_DIR -r $REC_CMD \ + -s $VDRSHUTDOWN -E $EPG_FILE -u $USER -g $GROUP --port $SVDRP_PORT \ + $OPTIONS $PLUGINS & + else + echo -n " - seems to be running already" + fi +} + +stopvdr() +{ + killall -q -TERM runvdr + + # check if the running process is /usr/bin/vdr or /usr/bin/vdr-kbd + if ps ax | grep "/usr/bin/vdr " | grep -qv grep + then + killall -q -TERM /usr/bin/vdr > /dev/null 2>&1 + else + # (assume that vdr-kbd is running) + killall -q -TERM /usr/bin/vdr-kbd > /dev/null 2>&1 + fi +} + +case "$1" in + start) + echo -n "Starting $DESC: $NAME" + startvdr + echo "." + ;; + stop) + echo -n "Stopping $DESC: $NAME" + stopvdr + echo "." + ;; + restart|force-reload) + echo -n "Restarting $DESC: $NAME" + stopvdr + sleep 4 + startvdr + echo "." + ;; + *) + N=/etc/init.d/$NAME + echo "Use: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 + diff -Nru vdr-1.0.0/debian/vdr.NEWS vdr-1.2.6/debian/vdr.NEWS --- vdr-1.0.0/debian/vdr.NEWS 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.NEWS 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,64 @@ +vdr (1.2.6-9) experimental; urgency=low + + This release adds a patch which allows us to have just one binary- + package for all four control-methods, so we do not need the + packages vdr-daemon, vdr-kbd, vdr-lirc and vdr-rcu anymore. + You can run vdr with the control-method you want by calling + /usr/bin/vdr-{daemon,kbd,lirc,rcu} or by using + + update-alternatives --config vdr + + and setting it to the desired control-method. (lirc is default) + After this a call of /usr/bin/vdr will allways use the control- + method you selected with update-alternatives. + + -- Thomas Schmidt Sun, 27 Feb 2005 00:44:05 +0100 + +vdr (1.2.6-6) unstable; urgency=low + + The most important change in this release is that vdr from now on + will run under the username vdr, not as root, this is due to some + security problems when vdr runs as root, the video-directory and + configfiles will be changed at installation, so they are owned by + the user and group vdr. + + The second thing is that the automatic shutdown of vdr is now disabled + by default, you can enable it again by changing ENABLE_SHUTDOWN to 1 + in /etc/default/vdr. + + In this release we also changed the default VIDEO_DIR from + /var/lib/video to /var/lib/video.00, to make adding extra harddiscs + for vdr very easy by just creating /var/lib/video.0{1,2,3,...} and + mounting the drive(s) there. In existing installations we will simply + create a symlink /var/lib/video.00 which points to /var/lib/video. In + new installations /var/lib/video will be a symlink which points to + /var/lib/video.00. (These changes will only be asked when you + selected yes in the debconf-question to create the video-directory!) + + -- Thomas Schmidt Fri, 14 Jan 2005 12:17:51 +0100 + +vdr (1.2.6-4) unstable; urgency=low + + This is the first release from the VDR and DVB Packaging Team + + Many thanks to Tobias Grimm and Thomas Günther for the various improvements + of the package. + + In this Release, we changed the path of the conf-files to /var/lib/vdr, + static conf-files will still be under /etc/vdr, and symlinked to + /var/lib/vdr. + If you allready have non-static files (channels.conf, remote.conf, + setup.conf and timers.conf), these files will be moved by the + postinst-script to /var/lib/vdr. + + The most important change in this release is the new init-system of vdr, + which was taken from c't-vdr, a woody-based distribution, optimized for vdr. + - Plugins are not any longer loaded via /etc/default/vdr, instead of this, + every installed plugin will be loaded automatically. The order of the + plugins can be configured via /etc/vdr/plugins/order.conf. + - The commands.conf and the reccmds.conf files will be auto-generated + by the init-script for better integration of vdr-addons. + If you allready have a commands.conf or reccmds.conf, you should move it + to /etc/vdr/command-hooks/{commands|reccmds}.custom.conf . + + -- Thomas Schmidt Sat, 29 May 2004 19:43:49 +0200 diff -Nru vdr-1.0.0/debian/vdr.postinst vdr-1.2.6/debian/vdr.postinst --- vdr-1.0.0/debian/vdr.postinst 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.postinst 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,186 @@ +#! /bin/sh +# postinst script for vdr +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +# source debconf lib +#. /usr/share/debconf/confmodule + +case "$1" in + configure) + + . /usr/share/debconf/confmodule + + # Try to stop vdr a second time when we are upgrading + # from a version smaller 1.2.6-9, because the init-script + # of the old version can not stop vdr without a existing + # /usr/bin/vdr + if [ ! -z $2 ]; then + if `dpkg --compare-versions $2 lt 1.2.6-9`; then + if [ -x "/etc/init.d/vdr" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d vdr stop || exit 0 + else + /etc/init.d/vdr stop || exit 0 + fi + fi + fi + fi + + # move cfg-files from /etc/vdr to /var/lib/vdr + for FILE in remote.conf setup.conf timers.conf; do + if [ -e /etc/vdr/$FILE ] && [ ! -e /var/lib/vdr/$FILE ]; then + printf "Note: Moving /etc/vdr/$FILE to /var/lib/vdr/$FILE\n" + mv /etc/vdr/$FILE /var/lib/vdr/$FILE + fi + done + + # install/move channels.conf + if [ ! -e /var/lib/vdr/channels.conf ]; then + if [ -e /etc/vdr/channels.conf ]; then + printf "Note: Moving /etc/vdr/channels.conf to /var/lib/vdr/channels.conf\n" + mv /etc/vdr/channels.conf /var/lib/vdr/channels.conf + else + db_get vdr/select_dvb_card + + case "$RET" in + Satellite) + gzip -dc /usr/share/doc/vdr/examples/channels.conf.gz \ + > /var/lib/vdr/channels.conf + chmod 644 /var/lib/vdr/channels.conf + ;; + Terrestrial) + gzip -dc /usr/share/doc/vdr/examples/channels.conf.terr.gz \ + > /var/lib/vdr/channels.conf + chmod 644 /var/lib/vdr/channels.conf + ;; + Cable) + gzip -dc /usr/share/doc/vdr/examples/channels.conf.cable.gz \ + > /var/lib/vdr/channels.conf + chmod 644 /var/lib/vdr/channels.conf + ;; + esac + fi + fi + + # create needed devices nodes + if [ ! -e /dev/dvb/ ]; then + echo -n "Creating DVB-Devices: " + cd /dev && MAKEDEV dvb + echo "done." + fi + + db_get vdr/create_video_dir + if $RET; then + # check if an old directory /var/lib/video exists, and + # symlink it to /var/lib/video.00 + if [ -d /var/lib/video ] && [ ! -e /var/lib/video.00 ]; then + ln -s video /var/lib/video.00 + fi + + # create /var/lib/video.00 if it does not exist + if [ ! -e /var/lib/video.00 ]; then + mkdir /var/lib/video.00 + fi + + # check if /var/lib/video.00 exists and /var/lib/video is + # missing, then create the symlink /var/lib/video which + # points to /var/lib/video.00 + if [ ! -e /var/lib/video ] && [ -e /var/lib/video.00 ]; then + ln -s video.00 /var/lib/video + fi + fi + + # ensure that user and group 'vdr' exist + USER=vdr + GROUP=vdr + if ! getent group | grep -q "^$GROUP:" ; then + echo -n "Adding group $GROUP.." + addgroup --quiet --system $GROUP + echo "..done" + fi + if ! getent passwd | grep -q "^$USER:"; then + echo -n "Adding user $USER.." + adduser --system --home /var/lib/vdr --shell /bin/false \ + --gecos "VDR user" --no-create-home \ + --disabled-login --disabled-password \ + --ingroup $GROUP \ + $USER + echo "...done" + fi + + # put vdr in group video so that it can access the DVB device nodes + adduser $USER video > /dev/null || true + + # put vdr in group cdrom so that it can access the cdrom and dvd + # device nodes + adduser $USER cdrom > /dev/null || true + + # ensure that vdr's config and recording files are correctly owned + [ -e /var/lib/video ] && chown -R $USER:$GROUP /var/lib/video/ + if [ -e /var/lib/vdr ] ; then + chown $USER:$GROUP /var/lib/vdr + chown $USER:$GROUP /var/lib/vdr/* > /dev/null 2>&1 || true + fi + if [ -e /var/cache/vdr ] ; then + chown $USER:$GROUP /var/cache/vdr + chown $USER:$GROUP /var/cache/vdr/* > /dev/null 2>&1|| true + fi + + # make /usr/lib/vdr/vdr-shutdown.wrapper setuid/setgid + # (owner root:vdr, mode 6750) + if [ -e /usr/lib/vdr/vdr-shutdown.wrapper ] ; then + chown root:$GROUP /usr/lib/vdr/vdr-shutdown.wrapper && \ + chmod 6750 /usr/lib/vdr/vdr-shutdown.wrapper + fi + + # Install alternatives for the different control methods + update-alternatives --install /usr/bin/vdr vdr /usr/bin/vdr-lirc 120 + update-alternatives --install /usr/bin/vdr vdr /usr/bin/vdr-kbd 110 + update-alternatives --install /usr/bin/vdr vdr /usr/bin/vdr-rcu 105 + update-alternatives --install /usr/bin/vdr vdr /usr/bin/vdr-daemon 100 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +db_stop + + +# FIXME +# wait for vdr to properly shutdown before it is restarted again +sleep 5 + + +#DEBHELPER# + +exit 0 diff -Nru vdr-1.0.0/debian/vdr.postrm vdr-1.2.6/debian/vdr.postrm --- vdr-1.0.0/debian/vdr.postrm 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.postrm 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,44 @@ +#! /bin/sh +# postrm script for vdr-plugin-#PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + rm -f /var/cache/vdr/commands.conf > /dev/null 2>&1 || true + rm -f /var/cache/vdr/reccmds.conf > /dev/null 2>&1 || true + rm -f /var/cache/vdr/epg.data > /dev/null 2>&1 || true + rm -f /var/lib/vdr/channels.conf > /dev/null 2>&1 || true + rm -f /var/lib/vdr/remote.conf > /dev/null 2>&1 || true + rm -f /var/lib/vdr/setup.conf > /dev/null 2>&1 || true + rm -f /var/lib/vdr/timers.conf > /dev/null 2>&1 || true + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -Nru vdr-1.0.0/debian/vdr.prerm vdr-1.2.6/debian/vdr.prerm --- vdr-1.0.0/debian/vdr.prerm 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr.prerm 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,19 @@ +#! /bin/sh +# prerm script for vdr +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + remove) + update-alternatives --remove vdr /usr/bin/vdr-daemon + update-alternatives --remove vdr /usr/bin/vdr-kbd + update-alternatives --remove vdr /usr/bin/vdr-lirc + update-alternatives --remove vdr /usr/bin/vdr-rcu + ;; +esac + +#DEBHELPER# + +exit 0 diff -Nru vdr-1.0.0/debian/vdr-shutdown vdr-1.2.6/debian/vdr-shutdown --- vdr-1.0.0/debian/vdr-shutdown 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr-shutdown 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,54 @@ +#!/bin/sh +# +# VDR Shutdown Script - Tobias Grimm +# ------------------- +# +# see README.Debian +# + +. /usr/lib/vdr/config-loader.sh + +SHUTDOWN_HOOKS_DIR=/usr/share/vdr/shutdown-hooks/ + +log="logger -t vdr-shutdown" +svdrpsend="/usr/lib/vdr/svdrpsend.pl" + +osdmsg() +{ + # OSD message must be deferred, to let VDR display it AFTER the + # shutdown script has been executed + sleep 2 + $svdrpsend MESG "$1" +} + +shutdownhooks=`find $SHUTDOWN_HOOKS_DIR -maxdepth 1 -xtype f | sort` + +for shutdownhook in $shutdownhooks; do + TRY_AGAIN=0 + + if [ -x $shutdownhook ]; then + $log "executing $shutdownhook" + result_data=`$shutdownhook $*` + else + $log "executing $shutdownhook as shell script" + result_data=`/bin/sh $shutdownhook $*` + fi + result=$? + eval $result_data + if [ $result -ne 0 ] ; then + $log "Shutdown aborted by $shutdownhook with exitcode $result" + osdmsg "Shutdown abgebrochen / Shutdown aborted!" & + [ -z "$ABORT_MESSAGE" ] || osdmsg "$ABORT_MESSAGE" & + exit $result + fi + + if [ $TRY_AGAIN -gt 0 ] + then + $log "$shutdownhook requests to try again in $TRY_AGAIN minutes" + echo "$svdrpsend HITK Power" | at now + $TRY_AGAIN minutes + osdmsg "Shutdown aborted. Retry in $TRY_AGAIN minutes." & + exit 0 + fi +done + +eval $SHUTDOWNCMD diff -Nru vdr-1.0.0/debian/vdr-shutdown-message vdr-1.2.6/debian/vdr-shutdown-message --- vdr-1.0.0/debian/vdr-shutdown-message 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr-shutdown-message 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,19 @@ +#!/bin/sh + +svdrpsend="/usr/lib/vdr/svdrpsend.pl" +log="logger -t vdr-shutdown" + +MESSAGE="Shutdown deactivated (see /etc/default/vdr)" + +osdmsg() +{ + # OSD message must be deferred, to let VDR display it AFTER the + # shutdown script has been executed + sleep 2 + $svdrpsend MESG "$1" +} + +osdmsg $MESSAGE & +$log $MESSAGE & + +exit 1 diff -Nru vdr-1.0.0/debian/vdr-shutdown-wrapper.c vdr-1.2.6/debian/vdr-shutdown-wrapper.c --- vdr-1.0.0/debian/vdr-shutdown-wrapper.c 1970-01-01 01:00:00.000000000 +0100 +++ vdr-1.2.6/debian/vdr-shutdown-wrapper.c 2006-05-18 20:03:12.000000000 +0200 @@ -0,0 +1,3 @@ +int main (int argc, char *argv[]) { + return execv("/usr/lib/vdr/vdr-shutdown", argv); +}