Aus ReelBox Maniacs
#!/bin/ash
#
# Reel Multimedia AG 2005
#
start_time=`date +%s`
#
# read configuration vars
. /etc/sysconfig
#
# Global vars
#
export IMAGEDIR="/etc/reel/images"
export IMAGEPREFIX="boot"
#export TZ=MET-$TIMEZONE
#
# setup frontpanle display
/sbin/reelfpctl -clearled 7 -brightness 240 -displaymode 0
/sbin/reelfpctl -showpnm $IMAGEDIR/${IMAGEPREFIX}01.pnm
/etc/init.d/fpleds
#/sbin/reelfpctl -clearled 7
# Start Memsettings
#memsettings
# start-stop-daemon needs /proc
mount -t proc proc /proc
modprobe unix #0.3s
# Start VDR_Control for remote an FP keys
#start-stop-daemon --start -x /usr/bin/vdr_control &
#prepare /etc
#modprobe ext2
#/sbin/fsck -yA
#mount -n -o remount,rw,noatime,nodiratime,sync,dirsync /etc
mount -n -o remount,rw,noatime,nodiratime /etc
#install timeinfo file
/etc/init.d/timezone start
# Mount filesystem, prepare /var and /tmp
mount -t sysfs sysfs /sys
mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /tmp
#prepare /var
/etc/init.d/mkvar start
#cp -ra /var/* /tmp
#mount -t tmpfs tmpfs /var
#mv /tmp/* /var
#prepare /boot
#mount -t ext2 /dev/tffsa1 /boot
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}02.pnm
# Network + Services
echo "Starting network"
/etc/init.d/network start
# we start services quite early, so if anything goes wrong we have telnet
echo "Starting network services"
/etc/init.d/netservices start
#echo "Breaking `basename $0` for testing purposes"
#exit 1
#4s
# Start BSP-15 inkl Player
echo "Loading bsp drivers"
/etc/init.d/bsp15 start #4.5s
/etc/init.d/i2c start #2.8s
cd /var/run/pvr1100
#sleep 2
echo "Starting BSP-Player"
runbsp15.sh /usr/share/reel/player_ps.out -disp DRGB -spfc >/dev/tty2 2>&1 &
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}03.pnm
# Load nesc. modules
/etc/init.d/udev start #0.2s
/etc/init.d/dvb start #0.8s
# Set Focus (Video out)
/etc/init.d/reelvidmode start >/dev/tty8 &
touch /tmp/.isboot
# Switch ISA-Demux
touch /tmp/demux_state
#reelhwctl -reset -scart-enable 1 -scart-tv or -scart-vcr ic -video-mute 15
#Start Reel-FPGA Bitfile
/usr/sbin/fpga_load -1 /usr/share/reel/reelfpga.bin & # 4.5
#Start fs modules
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}04.pnm
modprobe sc1200 # 3s
modprobe ide-disk # 0.4
modprobe ide-cd # 0.5
modprobe reiserfs # 0.4
modprobe jfs # 0.2
modprobe ext3 # 0.6
modprobe isofs # 0.2
#modprobe vfat # 0.4
modprobe rtc # 0.2
modprobe nls_iso8859-1 # 0.2
#
# as /dev/hdb is missing, the DoC might be seen as this
# so boot procedure is hda hdb hdc ... ???
hdparm -d1 /dev/hda /dev/hdc /dev/hdd # 0.0
eject -t -p /dev/hda & # 3.2 (Slider open) / 2.3 (Slider closed)
speedcontrol -x6 /dev/hda
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}05.pnm
# Set sound parameters
/etc/init.d/audio start
let "`grep UseDolbyDigital /etc/video/setup.conf `"
if [ "$UseDolbyDigital" = "1" ] ; then
/etc/init.d/spdif_out start
fi
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}06.pnm
#mount /mnt with a writeable filesystem large enough to keep the epg data
mount -t tmpfs -o size=10M tmpfs /mnt
for i in hd dvd net1 net2 ext1 ext2 ; do
install -d -m 000 /mnt/$i
done
# Mount HDD
/sbin/fsck -ya /dev/hdc1
mount /dev/hdc1 /mnt/hd # 10.9 (Reiserfs, SAMSUNG SV1604N)
/sbin/reelfpctl -displaymode 0 -showpnm $IMAGEDIR/${IMAGEPREFIX}07.pnm
# Setting modules for external storage
modprobe scsi_mod
modprobe sd_mod
modprobe sr_mod
modprobe sg
modprobe ide-scsi
/etc/init.d/ext_devices
/etc/init.d/smb_client
/etc/init.d/nfs_client
VIDEODIR=/mnt/hd
if grep hdc1 /proc/mounts ; then
ldconfig
#hdc is mounted so box has a harddrive
#check if there's a video directory on hdc1
if [ ! -d /mnt/hd/video ] ; then
# we have a hd but it is not migrated
install -d -m777 /mnt/hd/video
mv /mnt/hd/* /mnt/hd/video
for i in music movies opt ; do
install -d -m777 /mnt/hd/$i
done
else
#paranoia
chmod 777 /mnt/hd/video
fi
VIDEODIR=/mnt/hd/video
for i in ext1 ext2 ext3 net1 net2 ; do
if [ ! -L $i ] ; then
ln -s /mnt/$i $VIDEODIR/$i
fi
done
else
#box has no hd; lets look for a network or external drive
for i in ext1 ext2 ext3 net1 net2 ; do
if grep /mnt/$i /proc/mounts ; then
VIDEODIR=/mnt/$i
break
fi
done
fi
export VIDEODIR
# Cache directory for osdteletext
mkdir /tmp/vtx
# Cache directory for osdteletext
modprobe cdfs
# Fireing up VDR
/etc/init.d/reelvdr -bsp-started >/dev/tty1 2>&1 & # ca. 15s to picture
echo "needed $((`date +%s`-$start_time))s up to here"
/etc/init.d/httpd
/etc/init.d/smb_server