All pastes #242858 Raw Edit

Untitled

public text v1 · immutable
·published 2006-11-07 20:08 UTC
rendered paste body
At the end of my /etc/rc.d/rc.local (Slackware)  I have the following:

if [ -x /etc/rc.d/rc.pvr ]; then
  if ! grep nopvr /proc/cmdline 1> /dev/null 2> /dev/null ; then
    . /etc/rc.d/rc.pvr start
  fi
fi



 Then I have rc.pvr which is in charge of loading the ivtv stuff and start mythbackend if the machine has those init scripts available. Note, my backend is using ivtv 0.20rcj so the rc.ivtv would have to be updated for a newer version of ivtv.


 I can disable any portion of this using "nopvr, noautologin, noivtv, nomythtv" at the lilo boot prompt.


mythtv@woop:~$ cat /etc/rc.d/rc.pvr   
#!/bin/sh
# Don't load ivtv if 'noivtv' was given at boot.
if [ -x /etc/rc.d/rc.ivtv ]; then
  if ! grep noivtv /proc/cmdline 1> /dev/null 2> /dev/null ; then
    . /etc/rc.d/rc.ivtv start
  fi
fi

# Don't load mythtv if 'nomythtv' was given at boot.
if [ -x /etc/rc.d/rc.mythtv ]; then
  if ! grep nomyth /proc/cmdline 1> /dev/null 2> /dev/null ; then
    . /etc/rc.d/rc.mythtv start
  fi
fi
#
# Don't load the dxr3 if 'nodxr3' was given at boot.
#if [ -x /etc/rc.d/rc.dxr3 ]; then
#  if ! grep nodxr3 /proc/cmdline 1> /dev/null 2> /dev/null ; then
#    . /etc/rc.d/rc.dxr3 start
#  fi
#fi

if ! grep nosensors /proc/cmdline 1> /dev/null 2> /dev/null ; then
   echo "Loading i2c/lm sensors"
   modprobe i2c-sensor
   modprobe i2c-isa
   modprobe w83627hf
   /usr/bin/sensors -s
fi


if ! grep noautologin /proc/cmdline 1> /dev/null 2> /dev/null ; then
  echo "Launching XWindows"
  su - mythtv -c "bash -l startx -- -dpi 100" &
fi



mythtv@woop:~$ cat /etc/rc.d/rc.ivtv 
#!/bin/sh
#
# /etc/rc.d/rc.ivtv
#
# Start/stop/restart the ivtv device driver modules.
#

ivtv_load() {
   echo "Loading IVTV Driver Modules"
   echo -n "tuner..."
   /sbin/modprobe tuner type=2
   echo -n "msp3400..."
   /sbin/modprobe msp3400
   echo -n "saa7115..."
   /sbin/modprobe saa7115
   echo -n "ivtv..."
   /sbin/modprobe ivtv
   echo "Done!"
 
   echo "Setting PVR to NTSC - 720x480"
   /usr/local/bin/ivtvctl -u 0x3000
   /usr/local/bin/ivtvctl -p 4
   /usr/local/bin/ivtvctl -f width=720,height=480
#   /usr/local/bin/ivtvctl -c dnr_mode=0,dnr_temporal=4,dnr_spatial=4
   /usr/local/bin/ivtvctl -d /dev/video1 -u 0x3000
   /usr/local/bin/ivtvctl -d /dev/video1 -p 4
   /usr/local/bin/ivtvctl -d /dev/video1 -f width=720,height=480
#   /usr/local/bin/ivtvctl -d /dev/video1 -c dnr_mode=0,dnr_temporal=4,dnr_spatial=4

}

ivtv_unload() {
   echo "Unloading IVTV Driver Modules"
   echo -n "saa7115..."
   rmmod saa7115
   echo -n "ivtv..."
   rmmod ivtv
   echo -n "msp3400..."
   rmmod msp3400
   echo -n "tuner..."
   rmmod tuner
   echo -n "tveeprom..."
   rmmod tveeprom
   echo "Done!"
}

ivtv_reload() {
  ivtv_unload
  sleep 2
  ivtv_load
}

case "$1" in
'start')
  ivtv_load
  ;;
'stop')
  ivtv_unload
  ;;
'restart')
  ivtv_reload
  ;;
'reload')
  ivtv_reload
  ;;
*)
  # Default is "start", for backwards compatibility with previous
  # Slackware versions.  This may change to a 'usage' error someday.
  ivtv_load
esac


mythtv@woop:~$ cat /etc/rc.d/rc.mythtv
#!/bin/sh
#
# /etc/rc.d/rc.mythtv
#


LOGFILE="/var/log/mythtv.log"
PIDFILE="/var/run/mythbackend.pid"

mythtv_load() {
   if [ -x /usr/local/bin/mythbackend ]; then
     echo "Launching MythBackend"
     /usr/local/bin/mythbackend --logfile $LOGFILE --pidfile $PIDFILE -d
   fi
}

mythtv_unload() {
   echo "Shutting down MythBackend"
   kill `cat $PIDFILE`
}

mythtv_reload() {
  mythtv_unload
  sleep 1
  mythtv_load
}

case "$1" in
'start')
  mythtv_load
  ;;
'stop')
  mythtv_unload
  ;;
'restart')
  mythtv_reload
  ;;
'reload')
  mythtv_reload
  ;;
*)
  # Default is "start", for backwards compatibility with previous
  # Slackware versions.  This may change to a 'usage' error someday.
  mythtv_load
esac