Bootnfs file

/etc/rcS.d/S04aufs_ramfs
### BEGIN INIT INFO
# Provides:          aufs_ramfs checkroot-bootclean checkfs
# Required-Start:    hostname mountkernfs
# Required-Stop:     
# Should-Start:      
# Should-Stop:       
# Default-Start:     S
# Default-Stop:      
# Short-Description: Aufs Ramfs and specific hostname stuff
### END INIT INFO
 
 
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Aufs Ramfs and specific hostname stuff"
NAME=AufsRamfs
 
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
 
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
 
HOSTNAME=$(hostname)
 
#
# Function that starts the daemon/service
#
do_start()
{
  # ramfs : grow dynamically : aufs won't mount over it
  # tmpfs : doesn't grow dynamically
  /bin/mount -t tmpfs ramfsrwtmp /tmp -o noatime,nodev,nosuid,noexec,size=20M,mode=1777
  touch /tmp/.clean
 
  mkdir /tmp/varfs /tmp/etcfs
  /bin/mount -t aufs var_aufs /var -o br:/tmp/varfs=rw:/var=ro
  if [ -d /target/host-$HOSTNAME ];
  then
    /bin/mount -t aufs etc_aufs /etc -o br:/tmp/etcfs=rw:/target/host-$HOSTNAME/etc=ro:/etc=ro
  else
    /bin/mount -t aufs etc_aufs /etc -o br:/tmp/etcfs=rw:/etc=ro
  fi
}
 
case "$1" in
  'start')
    log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    log_end_msg 0
    ;;
  *)
    echo "Usage: $SCRIPTNAME {start}" >&2
    exit 3
    ;;
esac
/etc/rcS.d/S17mount_home
#!/bin/sh
### BEGIN INIT INFO
# Provides:          aufs_home
# Required-Start:    x11-common nfs-common
# Required-Stop:     $time
# Default-Start:     S
# Default-Stop:
# Short-Description: Aufs specific home
### END INIT INFO
 
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Aufs specific home"
NAME=AufsHome
 
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
 
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
 
HOSTNAME=$(hostname)
 
#
# Function that starts the daemon/service
#
do_start()
{
  # automaticaly find / mount source
  ROOT_DIR=$(mount | grep "on / type nfs" | cut -d' ' -f 1 | cut -d"/" -f1-3 )
  /bin/mount -t nfs -o noatime,rsize=65536,wsize=65536,hard,nolock,async,intr,sec=sys ${ROOT_DIR}/home /home
 
  if [ -d /home/mythtv-$HOSTNAME ];
  then
    /bin/mount -t aufs home_aufs /home/mythtv -o br:/home/mythtv-$HOSTNAME=rw:/home/mythtv=ro
  fi
 
}
 
do_stop()
{
  umount /home/mythtv
  umount /home
}
 
case "$1" in
  'start')
    log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    log_end_msg 0
    ;;
  'stop')
    log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    log_end_msg 0
    ;;
  *)
    echo "Usage: $SCRIPTNAME {start|stop}" >&2
    exit 3
    ;;
esac
/etc/rc2.d/S01rc.target
#!/bin/sh
### BEGIN INIT INFO
# Provides:          rc.target
# Required-Start:    $remote_fs $time
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Run /etc/rc.target if it exist
### END INIT INFO
#
#
 
PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
. /lib/init/vars.sh
. /lib/lsb/init-functions
 
do_start() {
  if [ -x /etc/rc.target ]; then
    [ "$VERBOSE" != no ] && log_begin_msg "Running target boot scripts (/etc/rc.target)"
    /etc/rc.target
    ES=$?
    [ "$VERBOSE" != no ] && log_end_msg $ES
    return $ES
  fi
}
 
case "$1" in
  start)
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    ;;
  *)
    echo "Usage: $0 start|stop" >&2
    exit 3
    ;;
esac
/etc/rc2.d/S02startx
#!/bin/sh
### BEGIN INIT INFO
# Provides:          startx
# Required-Start:    $remote_fs $time nvidia-kernel rc.target
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO
#
#
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/startx
NAME=startx
DESC="X server"
 
. /lib/init/vars.sh
. /lib/lsb/init-functions
 
case "$1" in
  start)
    log_begin_msg "Starting $DESC: "
    rm -f /home/mythtv/.Xauthority*
    /bin/su - mythtv -c /usr/bin/startx 2>/dev/null 1>&2 &
    log_end_msg 0
    ;;
  stop)
    echo -n "Stopping $DESC: "
    chvt 1
    echo "$NAME."
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart}" >&2
    exit 1
    ;;
esac
 
exit 0