Anbei die Daten
#!/bin/sh
#
# by Thomas Koch <tom@linvdr.org>
# 10.05.2003
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
umask 022
export PATH
#
stty onlcr
hwclock -s
progress() {
i=0
total=80
line=7
let t=$1*$total/100
while [ $i -lt $t ]; do
echo -n -e "\033[$line;${i}H"
echo -n -e "\033[42;32m \033[0m"
echo -n -e "\033[$(($line+1));0H"
echo -n -e "\033[2K"
echo -n $2
let i=$i+1
done
}
execute() {
OLDIFS=$IFS
IFS=""
echo $* >/dev/tty13 2>/dev/tty13
$* >/dev/tty13 2>/dev/tty13
IFS=$OLDIFS
}
# correct the system time (settime wakeup method)
execute /usr/bin/correcttime.sh
# mount /proc
progress 5 "mounting proc"
execute mount -n /proc
# enabling dma
progress 10 "turn dma on"
for drive in /proc/ide/hd?; do
media=`cat $drive/media`
device="/dev/`basename $drive`"
if [ $media == "disk" ]; then
execute hdparm -d 1 $device
else
if [ x$DMA_ONLY_FOR_DISKS != x"yes" ]; then
if [ $media == "cdrom" ]; then
execute hdparm -d 1 $device
fi
fi
fi
done
# mount read-only
progress 15 "mount read only"
execute mount -n -o remount,ro /
# fsck
progress 20 "file system check"
execute fsck -y /
execute fsck -y -A -R
# mount
progress 30 "mounting file systems"
execute mount -n -o remount,rw /
echo -n > /etc/mtab
# to re-create mtab, silly he?
execute mount -f -o remount /
execute mount -a
#
(cat /etc/modules; echo) | while read module args; do
case "$module" in
\#*|"") continue ;;
esac
execute modprobe $module $args
done
#
if [ -e /etc/modules.setup ]; then
(cat /etc/modules.setup; echo) | while read module args; do
case "$module" in
\#*|"") continue ;;
esac
execute modprobe $module $args
done
fi
# create and mount swapfile
SWAPFILE=/var/vm/swapfile
if [ ! -e $SWAPFILE ]; then
# check if we have enough space
freespace=`df | grep "/$" | cut -b 41-52`
if [ "$[$freespace/1024]" -gt "512" ]; then
progress 40 "create swapfile"
execute dd if=/dev/zero of=$SWAPFILE bs=1M count=256
execute mkswap -c $SWAPFILE
execute chmod 600 $SWAPFILE
fi
fi
if [ -e $SWAPFILE ]; then
execute swapon -a
fi
execute swapon -a
execute /usr/bin/firstrun.sh
# setup
while [ ! -e /etc/sysconfig ]; do
/usr/bin/SETUP
clear
done
. /etc/sysconfig
# load keymap
if [ -r /etc/console/boottime.kmap.gz ]; then
execute loadkeys /etc/console/boottime.kmap.gz
fi
# clean up
execute rm -fr /tmp/*
execute rm -fr /var/run/*
execute rm -f /etc/vdr/toconvert_lock
#
if [ x$CDROM_DEVICE != x ]; then
progress 45 "set optical drive speed"
if [ $[$CDROM_SPEED+0] -gt 0 ]; then
execute hdparm -E $CDROM_SPEED $CDROM_DEVICE
fi
fi
# create ramdisk
progress 50 "create and format ramdisk"
# XXX better check
if [ x$RAMDISK_SIZE != x ]; then
if [ $[$RAMDISK_SIZE+0] -lt 4 ]; then
RAMDISK_SIZE=4
fi
else
RAMDISK_SIZE=4
fi
execute mount -t tmpfs -o size=${RAMDISK_SIZE}M /dev/shm /ramdisk
execute cp -a /var/cache/ramdisk/* /ramdisk
execute rm -f /var/run/*
execute echo -n > /var/log/wtmp
execute echo -n > /var/run/utmp
execute echo -n > /var/log/lastlog
# set hostname
progress 60 "set hostname"
execute hostname -F /etc/hostname
# logging
progress 70 "starting syslog"
execute klogd -c 1
if [ x$RINGBUFFER_SYSLOG == x"no" ]; then
execute syslogd -O /var/log/messages
else
execute syslogd -C
echo "HINT: LinVDR is using the busybox syslogd." > /var/log/messages
echo "Type \"logread\" or \"logread -f\" to see syslog messages." >> /var/log/messages
fi
#
progress 80 "starting vdr"
#execute kill $STPID
execute modprobe imon_vfd
execute /usr/bin/LCDd &
execute /etc/init.d/runvdr start &
# network
progress 90 "setting up network"
execute ifconfig lo 127.0.0.1 up
if [ x$NETWORKING_LAN == x"yes" ]; then
if [ x$NETWORK_DRIVER_LAN != x ]; then
execute modprobe $NETWORK_DRIVER_LAN
else
echo "... failed, correct settings in /etc/sysconfig"
fi
if [ x$USE_DHCP_LAN = x"yes" ]; then
execute udhcpc -i eth0 -b -H `hostname`
elif [ -n "$IP_LAN" ]; then
ifconfig eth0 $IP_LAN up
if [ -n "$GATEWAY_LAN" ]; then
execute route add default gw $GATEWAY_LAN
fi
if [ -n "${DOMAIN_LAN}${NAMESERVER_LAN}" ]; then
rm -f /etc/resolv.conf
if [ -n "$DOMAIN_LAN" ]; then
echo "search $DOMAIN_LAN" >> /etc/resolv.conf
fi
if [ -n "$NAMESERVER_LAN" ]; then
echo "nameserver $NAMESERVER_LAN" >> /etc/resolv.conf
fi
fi
else
echo "... failed, correct settings in /etc/sysconfig"
fi
if [ x$START_SSHD != x"no" ]; then
sshd
fi
portmap
fi
# acpi
if [ -d /proc/acpi ]; then
execute acpid -c /etc/acpi/events
else
execute modprobe apm
fi
#
if [ -e /etc/init.d/boot.local ]; then
progress 95 "running boot.local"
. /etc/init.d/boot.local
fi
(sleep 30 && /etc/init.d/rcStart.delayed) &
#
progress 100 "done."
echo