###################################### SMBFS pour partage reseau # aptitude install smbfs #smbclient #smbclient - a LanManager-like simple client for Unix #smbfs - mount and umount commands for the smbfs (for kernels >= than 2.2.x) mkdir /media/partage chmod -R 775 /media/partage chown -R vdr:vdr /media/partage vi /etc/hosts 192.168.0.52 toto.myhome.local toto test : mount -t cifs -o username=toto-res,password=xxxxx //toto/partage /media/partage/ umount /media/partage vi /etc/fstab //toto/partage /media/partage cifs credentials=/etc/samba/.partage,uid=vdr,gid=vdr,rw 0 0 :wq vi /etc/samba/.partage username=toto-res password=xxxxx :wq chmod 600 /etc/samba/.partage uid et gid = vdr mount /media/partage vi /etc/vdr/plugins/mplayersources.conf /media/partage;partage;2 # info : partage monter au boot du micro, par le root. peut pas etre demonter par le menu! ################## AJOUR D'UN FICHIER DE DEMARRAGE VDR ################################# vi /etc/vdr/xinit_vdr.sh #!/bin/bash # /etc/vdr/xinit_vdr.sh # Utilise par /etc/X11/xinit/xinitrc PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=vdr DESC="Linux Video Disk Recorder" DAEMON=/usr/sbin/runvdr PIDFILE=/var/run/runvdr.pid VDRPRG=/usr/bin/vdr test -x $DAEMON || exit 0 test -x $VDRPRG || exit 0 . /usr/lib/vdr/config-loader.sh # Set shutdown command test "$ENABLE_SHUTDOWN" = "1" && VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown.wrapper" \ || VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown-message" . /usr/lib/vdr/plugin-loader.sh . /usr/lib/vdr/commands-loader.sh clean_console() { if [ "$KEYB_TTY" != "" ]; then tput -Tlinux clear > $KEYB_TTY fi } configure_console_input() { if [ "$KEYB_TTY" != "" ]; then clean_console echo -e "This tty is currently mapped to VDR, keypresses aren't echoed.\r" > $KEYB_ echo -n "For a login prompt switch to another console." > $KEYB_TTY REDIRECT="< $KEYB_TTY" if [ "$KEYB_TTY_SWITCH" = "1" ]; then chvt `echo "$KEYB_TTY" | sed "s/\/dev\/tty//"` fi fi } startvdr() { #CMD=$(ps -eaf | grep watchdog | grep -v grep | wc -l) #if [ "$CMD" != "0" ] ; then getplugins mergecommands "commands" mergecommands "reccmds" configure_console_input if [ "$VFAT" == "1" ]; then OPTIONS="--vfat $OPTIONS" fi $DAEMON -v $VIDEO_DIR -c $CFG_DIR -L $PLUGIN_DIR -r $REC_CMD \ -s $VDRSHUTDOWN -E $EPG_FILE -u $USER -g /tmp \ --port $SVDRP_PORT $OPTIONS $PLUGINS $REDIRECT & VDRPID="$!" echo $VDRPID > $PIDFILE } :wq chmod a+x /etc/vdr/xinit_vdr.sh ######################################################################################### vi /etc/X11/xinit/xinitrc #!/bin/bash # $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ # /etc/X11/xinit/xinitrc # # global xinitrc file, used by all X sessions started by xinit (startx) # invoke global X session script xhost + local:vdr@ xset -display :0.0 s off -dpms . /etc/vdr/xinit_vdr.sh #. /etc/X11/Xsession startvdr wait $PIDVDR halt :wq ######################################################################################## ######################################################################################### Demarrage auto vi /etc/init.d/startx #!/bin/sh PATH=/usr/sbin:/usr/bin/:/sbin:/bin DESC="Xorg and VDR" NAME=startx DAEMON=/usr/bin/$NAME DAEMON_ARGS="" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME [ -x "$DAEMON" ] || exit 0 # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 } do_stop() { #PIDS22STARTX=$(ps -eaf | grep S22startx | grep -v grep | awk '{ print $2 }') #PIDVDR=$(/dev/null 2>&1 & #killall -q -TERM /usr/bin/vdr wait `pidof vdr` # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE # Arret du micro avec la telecommande #halt return "$RETVAL" } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop}" >&2 exit 3 ;; esac : :wq chmod 755 /etc/init.d/startx ####################################################################################################" ARRET AUTO #############################################"" vi /usr/share/vdr/shutdown-hooks/S80.shutdown #!/bin/sh PIDFILE=/var/run/runvdr.pid #LOG=/var/log/vdrshutdown.log LOG="logger -t shutdown" $LOG "vdrshutdown...$(date)" # check for PID file $LOG "vdr test pidfile? pidfile=$PIDFILE" if [ -f $PIDFILE ] ; then $LOG "PIDFILE exist" # PID file is there, is it readable? if [ -r $PIDFILE ] ; then $LOG "PIDFILE readable" # is there a process? VDRPID=$(cat $PIDFILE) $LOG "TRY TO KILL VDR vdrpid=$VDRPID" /etc/init.d/startx stop if [ $? -eq 0 ] ; then $LOG "VDR Stopped with pid=$VDRPID" #rm $PIDFILE else $LOG "Could not stop VDR!" fi else $LOG "PIDFILE not readable" fi else $LOG "PIDFILE does not exist!" fi :wq ####################################################################################### update-rc.d startx start 98 2 3 4 5 . stop 01 0 1 6 . Si erreur on peut refaire : update-rc.d -f startx remove ############################ # Ajout d'un boot par UUID, pour les pb de plug sata ou usb # car je boot sur cle usb avoir toujours un boot quelque soit le port usb utilisé. ####################################################################################### apt-get install uuid-runtime /lib/udev/vol_id -u /dev/sda1 e8129ddf-e997-49de-88d2-a9d0937ef5b0 vi /etc/fstab #/dev/sda1 UUID=e8129ddf-e997-49de-88d2-a9d0937ef5b0 / ext3 defaults,errors=remount-ro 0 1 vi /boot/grub/menu.lst kernel /boot/vmlinuz-2.6.25-3-486 root=UUID=e8129ddf-e997-49de-88d2-a9d0937ef5b0 ro uuidgen #> ad33562f-d862-4961-b43c-f702705c10c8 swapoff -a mkswap -U ad33562f-d862-4961-b43c-f702705c10c8 /dev/sda5 /lib/udev/vol_id /dev/sda5 swapon -a vi /etc/fstab #/dev/sda5 UUID=ad33562f-d862-4961-b43c-f702705c10c8 none swap sw 0 0 :wq dpkg-reconfigure initramfs-tools reboot ######### Exemple de menu.lst title Debian GNU/Linux, kernel 2.6.24-etchnhalf.1-486 root (hd0,0) kernel /boot/vmlinuz-2.6.24-etchnhalf.1-486 root=UUID=5640aaf3-bb1c-4fb4-b64d-151354b101b3 ro initrd /boot/initrd.img-2.6.24-etchnhalf.1-486 title Debian GNU/Linux, kernel 2.6.24-etchnhalf.1-486 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24-etchnhalf.1-486 root=UUID=5640aaf3-bb1c-4fb4-b64d-151354b101b3 ro single initrd /boot/initrd.img-2.6.24-etchnhalf.1-486 ################################################################################################################## #####Installation du Disque dur ### #pour cela, activer dans le bios le controleur sata. (les disques sata sont reconnu comme les cles usb en sda,b,c,... # le boot dans le bios doit etre defini, par exemple, USB-HDD,CDROM,SATA # l'installation debian sur cle usb avec des disques sata pour la video rend le boot GRUB inutilisable si le controleur sata est active. ################# fdisk -l # pour voir sur quel controleur on est. /lib/udev/vol_id -u /dev/sda1 mkdir /media/video.00 chown vdr:vdr /media/video.00/ # disque deja formate en ext3 mount -t ext3 /dev/sda1 /media/video.00/ ln -s /media/video.00 /media/video /lib/udev/vol_id -u /dev/sda1 UUID=988d25f8-efb4-4111-a605-b3e08f071025 vi /etc/fstab UUID=988d25f8-efb4-4111-a605-b3e08f071025 /media/video.00 ext3 rw,user,auto 0 0 :wq umount /media/video.00 mount -a ls /media/video #OK ### Modification de vdr pour utiliser le HDD comme disque de sauvegarde vi /usr/lib/vdr/config-loader.sh # Video-Directory #VIDEO_DIR="/var/lib/video.00" VIDEO_DIR="/media/video.00" :wq chown -R vdr:vdr /media/video.00 ######################################################################################### vi /etc/X11/xinit/xinitrc # Ajouter chown -R vdr:vdr /media/video.00 # devant . /etc/vdr/xinit_vdr.sh :wq ######################################################## reboot ############################### MODIFICATION DE BURN vi /etc/vdr/plugins/plugin.burn.conf --tempdir=/media/video/tmp --iso=/media/video.00/export :wq mkdir /media/video.00/export/ mkdir /media/video.00/tmp/ touch /media/video.00/export/no_remove touch /media/video.00/tmp/no_remove ######################################################################################## cd /usr/share/vdr/command-hooks vi commands.ctvdr.conf # modifier : #VDR-Wartung ... : echo "ohne Funktion" #-Informationen über das VDR-System : /usr/bin/ctvdrinfo #-Systeminformationen : /usr/bin/ctvdrsysinfo #-VDR neu starten? : nohup sh -c "( sleep 2 && /usr/lib/vdr/ctvdrwrapper --restart )" >/dev/null 2>&1 & #-VDR stoppen (ohne auszuschalten)? : nohup sh -c "( sleep 2 && /usr/lib/vdr/ctvdrwrapper --stop )" >/dev/null 2>&1 & VDR-maintenance ... : echo "sans fonction" -Informations sur le système VDR : /usr/bin/ctvdrinfo -Informations système : /usr/bin/ctvdrsysinfo -VDR redémarrer ? : nohup sh -c "( sleep 2 && /usr/lib/vdr/ctvdrwrapper --restart )" >/dev/null 2>&1 & -VDR-arrêter (sans éteindre)? : nohup sh -c "( sleep 2 && /usr/lib/vdr/ctvdrwrapper --stop )" >/dev/null 2>&1 & :wq vi commands.shutdownvdr.conf #System herunterfahren?:/usr/bin/poweroffvdr Arret du système ? : /usr/bin/poweroffvdr :wq vi commands.update-recordings.conf # Aufnahmen-Liste aktualisieren : /usr/bin/touch /media/video/.update # par Mettre à jour la liste des enregistrements : /usr/bin/touch /media/video/.update :wq vi commands.custom.conf # Ajouter Voir les logs d'aptitude_update.log : cat /var/log/aptitude_update.log :wq ######### CONFIGURATION DE BURN aptitude install projectx Menu de vdr -> Configuration -> Greffons -> Burn - Demultiplexeur : Projectx - Taille definit par l'utilisateur ( Moctet) : 1070 - Couper : oui - image et grave ########## Modification du fichier de boot xinitrc pour prendre en compte le netoyage du repertoire video vi /etc/X11/xinit/xinitrc # Ajouter rm -R /media/video.00/vdr-burn.* rm -R /media/video.00/tmp/vdr-burn.* rm /media/video.00/export/*.iso # devant . /etc/vdr/xinit_vdr.sh :wq # Autre plugin pas encore testé : vdr-plugin-cdda ################ convertion film enregistrer en avi, ogg, ... # url http://vdr.bluox.org/wiki/index.php/Vdrrip-plugin aptitude install vdr-plugin-vdrrip mencoder aptitude install ffmpeg #aptitude install ogmrip aptitude install ogmtools libdvdnav-dev mkdir /media/video/vdrrip rm /var/lib/video rm -R /var/lib/video.00 cd /var/lib ln -s /media/video.00 video ##################### diffusion du vdr avec le tuner dvb par le reseau # sur serveur aptitude install vdr-plugin-streamdev-server vi /etc/vdr/plugins/streamdevhosts.conf # mettre son reseau :wq # sur client aptitude install vdr-plugin-streamdev-client # #################################################################################################### # optionnel # ne fonctionne pas encore optimal ######################################################################## PLUGINS micky pour la Freebox ####### Fonctionne quand je lance invoke vdr start etant deja possitionner sur la chaine free en question # mais pas quand je change de chaine avec la telecommande ? cd /usr/local/src wget -c http://vdrbox.lautre.net/fichiers/VDR/packs/vdr-1.6.0-2-micky979.tar.bz2 wget -c http://vdrbox.lautre.net/fichiers/VDR/packs/vdr-1.6.0-1-micky979-extra.tar.bz2 mkdir plugins tar xvfj vdr-1.6.0-1-micky979-extra.tar.bz2 -C plugins cd /usr/local/src/plugins/freeboxtv-0.0.3 aptitude install liblivemedia-dev livemedia-utils aptitude install libxml++2.6-2 libxml++2.6-dev aptitude install xmltv tv_grab_fr --configure tv_grab_fr aptitude install iptraf vi Makefile # Decommenter FREEBOXTV_EPG = 1 :wq make all DVBDIR=/usr VDRDIR=/usr/include/vdr LIBDIR=. cp libvdr-freeboxtv.so.1.6.0 /usr/lib/vdr/plugins/ cd /usr/local/src/plugins/freeboxtv-0.0.3/examples/ mkdir -p /var/lib/vdr/plugins/freeboxtv cp channels.conf.freebox /var/lib/vdr/plugins/freeboxtv/ chown -R vdr:vdr /var/lib/vdr/plugins/ cp /var/lib/vdr/channels.conf /var/lib/vdr/channels.conf.save cp channels.conf-template /var/lib/vdr/channels.conf invoke-rc.d vdr start # Voir debit reseau iptraf wget -c http://mafreebox.freebox.fr/freeboxtv/playlist.m3u