#!/bin/sh
. /var/etc/autostart/start-config
model=`cat /etc/model`
if uname -a | grep -q "stm22"; then
linuxver="stm22"
fi
if uname -a | grep -q "stm23"; then
linuxver="stm23"
fi
if uname -a | grep -q "stm24"; then
linuxver="stm24"
fi
if [ -e /usr/local/bin/neutrino ]; then
SWTYPE="neutrino"
else
SWTYPE="enigma2"
fi
INPUT=$1
REBOOT=$2
CMD="[start.sh]"
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start
fi
if [ "$debug" = 'full' ]; then
set -x
fi
if [ -z $INPUT ]; then
echo "[start.sh] use start.sh <first|swap|e2|last|reboot|recovery|neutrino>"
exit
fi
ipcheck()
{
#check ob ip aus 4 teilen mit punkten gestrennt besteht
if [ `echo "$1" | tr "." "\n" | wc -l` -ne 4 ]; then
return 1
fi
IFS_old=$IFS
IFS=.
for i in $ip; do
#check ob der teil eine nummer ist
if ! echo "$i" | grep -q "^[0-9]*$"; then
IFS=$IFS_old
return 1
fi
#check ob der teil nicht leer ist
if [ ! "$i" ]; then
IFS=$IFS_old
return 1
fi
#check ob der teil kleiner gleich 255
if [ $i -gt 255 ]; then
IFS=$IFS_old
return 1
fi
done
IFS=$IFS_old
return 0
}
startServer() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start ftp and telnet
fi
/usr/sbin/telnetd -l /bin/login
/etc/init.d/vsftpd start
}
startFsckswap() {
if [ "$fsckswap" == "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] fsck swapstick
fi
SWAPDEV=`blkid -w /dev/null -c /dev/null -s LABEL | grep -m1 SWAP | cut -d ":" -f1`
TYPE=`blkid -w /dev/null -c /dev/null -s TYPE | grep -m1 "$SWAPDEV" | sed 's/^.*TYPE="//;s/".*$//'`
if [ "$SWAPDEV" ]; then
if [ "$TYPE" == "fat" ] || [ "$TYPE" == "vfat" ]; then /sbin/fsck.vfat -y "$SWAPDEV"; fi
if [ "$TYPE" == "ext2" ] || [ "$TYPE" == "ext3" ]; then /sbin/fsck."$TYPE" -f -p "$SWAPDEV"; fi
if [ "$TYPE" == "jfs" ]; then /sbin/jfs_fsck -a -p "$SWAPDEV"; fi
fi
fi
}
startFsckrecord() {
if [ "$fsckrecord" == "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] fsck record device
fi
RECORDDEV=`blkid -w /dev/null -c /dev/null -s RECORD | grep -m1 SWAP | cut -d ":" -f1`
TYPE=`blkid -w /dev/null -c /dev/null -s TYPE | grep -m1 "$RECORDDEV" | sed 's/^.*TYPE="//;s/".*$//'`
if [ "$RECORDDEV" ]; then
if [ "$TYPE" == "fat" ] || [ "$TYPE" == "vfat" ]; then /sbin/fsck.vfat -y "$RECORDDEV"; fi
if [ "$TYPE" == "ext2" ] || [ "$TYPE" == "ext3" ]; then /sbin/fsck."$TYPE" -f -p "$RECORDDEV"; fi
if [ "$TYPE" == "jfs" ]; then /sbin/jfs_fsck -a -p "$RECORDDEV"; fi
fi
fi
}
startMount() {
if [ -e /var/swap/swapfile ]; then
if [ -e /etc/.fullusb ] || [ -e /etc/.usbimage ]; then
echo $CMD ["$INPUT"] skip remove SWAP fom usb
else
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] remove SWAP fom Flash
fi
rm -rf /var/swap/swapfile
fi
fi
if [ "$automountshel" = "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startMount
fi
amount
if [ -e /var/etc/.bamount ]; then
BAamount &
fi
fi
if [ ! -e /tmp/.swapdev ] && [ -e /var/baroot/BASWAP ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] mount BASWAP
fi
mount --bind /var/baroot/BASWAP /var/swap
fi
}
startPlugload() {
if [ "$plugload" = "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start Plugload
fi
/var/etc/PlugLoad.sh
fi
}
startCheckfree() {
if [ -e /sbin/checkfree ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] checkfree
fi
/sbin/checkfree
fi
}
startLoadmodules() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] load Module
fi
LIST=`ls -1 /var/lib/modules`
for ROUND in $LIST; do
insmod /var/lib/modules/"$ROUND"
done
}
startRmemthy() {
if [ "$rmemthy" = 'y' ] && [ -e /media/autofs ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start rmemthy
fi
LIST=`ls -1 /media/autofs`
for ROUND in $LIST; do
LENG=`ls -al /media/autofs/"$ROUND" | wc -l`
if [ "$LENG" = "2" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] remove empty folder $LIST / $ROUND
fi
rm -rf /media/autofs/"$ROUND"
fi
done
LIST=`ls -1 /media/usb`
for ROUND in $LIST; do
LENG=`ls -al /media/usb/"$ROUND" | wc -l`
if [ "$LENG" = "2" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] remove empty folder $LIST / $ROUND
fi
rm -rf /media/usb/"$ROUND"
fi
done
LENG=`ls -al /media/usb | wc -l`
if [ "$LENG" = "2" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] remove empty folder /media/usb
fi
rm -rf /media/usb
fi
LENG=`ls -al /media/autofs | wc -l`
if [ "$LENG" = "2" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] remove empty folder /media/autofs
fi
rm -rf /media/autofs
fi
fi
}
startAutodns() {
if [ "$autodns" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start autodns
fi
autodns &
fi
}
startRmplaylist() {
if [ "$playlist" = 'y' ] && [ -e /var/usr/local/share/enigma2/playlist.e2pls ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start remove playlist
fi
rm /var/usr/local/share/enigma2/playlist.e2pls
fi
}
startPortmap() {
if [ "$portmap" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start portmap
fi
/etc/init.d/portmap start
fi
}
startBootstop() {
if [ $bootstop -ne 0 ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start sleep $bootstop s
fi
sleep $bootstop
fi
}
startSamba() {
if [ `grep interfaces /var/etc/smb.conf | sed 's/interfaces = //'` = "/" ];then
sed -e "s!interfaces = /!interfaces = lokalhost/255.255.255.0!" -i /var/etc/smb.conf
fi
IP="`ifconfig | grep inet | grep Bcast | cut -d : -f 2 | sed 's/ Bcast//' | sed 's/ //'`"
KIP=`grep interfaces /var/etc/smb.conf | sed 's/interfaces = //' | cut -d "/" -f1`
if [ ! "$KIP" = "$IP" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] set $KIP -> $IP in smb.conf
fi
if [ -z "$IP" ]; then IP="192.168.100.10"; fi
if [ -z "$KIP" ]; then KIP="192.168.100.11"; fi
sed -e "s/$KIP/$IP/g" -i /var/etc/smb.conf
fi
MASK="`ifconfig | grep inet | grep Bcast | cut -d : -f 4 | sed 's/ Bcast//' | sed 's/ //'`"
KMASK=`grep interfaces /var/etc/smb.conf | sed 's/interfaces = //' | cut -d "/" -f2`
if [ ! "$KMASK" = "$MASK" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] set $KMASK -> $MASK in smb.conf
fi
if [ -z "$MASK" ]; then MASK="255.255.255.0"; fi
if [ -z "$KMASK" ]; then KMASK="255.255.255.1"; fi
sed -e "s/$KMASK/$MASK/g" -i /var/etc/smb.conf
fi
devlist=`cat /proc/diskstats | cut -c 11- | cut -d " " -f1 | grep "sd[a-z][0-9]"`
blkid=`blkid -w /dev/null -c /dev/null`
mountlist=""
for device in $devlist; do
label=`echo -e "$blkid" | grep "^/dev/$device:" | grep LABEL= | sed 's/^.*LABEL="//;s/".*$//' | tr -d " " | tr -d "-"`
if [ "$label" = "XE2BA" ] || [ "$label" = "XBA" ] || [ "$label" = "SWAP" ] || [ "$label" = "SWAP" ] || [ "$label" = "MINI1" ] || [ "$label" = "MINI2" ] || [ "$label" = "MINI3" ] || [ "$label" = "MINI4" ] || [ "$label" = "MINI5" ] || [ "$label" = "MINI6" ] || [ "$label" = "MINI7" ] || [ "$label" = "MINI8" ] || [ "$label" = "MINI9" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] skip $device with label $label to smb.conf
fi
else
if [ `cat /proc/mounts | grep "/dev/$device" | cut -d " " -f2 | tail -n1 | tr "/" "\n" | sed '/^ *$/d' | wc -l` == "3" ]; then
tmpdir=`cat /proc/mounts | grep /dev/$device | cut -d " " -f2`
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] add $device with label $label to smb.conf
fi
mountlist="$tmpdir $mountlist"
fi
fi
done
smbdlist=`cat /var/etc/smb.conf`
HOSTN=`hostname`
if ! grep -q "$HOSTN" /etc/hosts; then
echo $IP $HOSTN >> /etc/hosts
fi
# if ! grep -q "$HOSTN" /var/etc/smb.conf; then
# hostnameold=`echo -e "$smbdlist" | grep "netbios name =" | tr " " "\n" | tail -n1`
# sed -e "s/$hostnameold/$HOSTN/g" -i /var/etc/smb.conf
# fi
# echo "[global]" > /var/etc/smb.conf
# echo "load printers = no" >> /var/etc/smb.conf
# echo "guest account = root" >> /var/etc/smb.conf
# echo "log file = /tmp/smb.log" >> /var/etc/smb.conf
# echo "security = share" >> /var/etc/smb.conf
# echo "netbios name = $HOSTN" >> /var/etc/smb.conf
# echo "server string = Duckbox" >> /var/etc/smb.conf
# echo "workgroup = LAN" >> /var/etc/smb.conf
# echo "interfaces = $IP" >> /var/etc/smb.conf
for mountdir in $mountlist; do
if [ `cat /var/etc/smb.conf | grep "$mountdir" | wc -l` -eq 0 ];then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] add mountdir $mountdir to smb.conf
fi
meta=`echo $mountdir | tr "/" "\n" | tail -n1`
echo -e "\n" >> /var/etc/smb.conf
echo "[$meta]" >> /var/etc/smb.conf
echo "comment = Media Files on $meta Drive" >> /var/etc/smb.conf
echo "path = $mountdir" >> /var/etc/smb.conf
echo "read only = no" >> /var/etc/smb.conf
echo "public = yes" >> /var/etc/smb.conf
echo "guest ok = yes" >> /var/etc/smb.conf
fi
done
sed '/^ *$/d' -i /var/etc/smb.conf
if [ "$sambaserver" = 'y' ] && [ -e /var/bin/smbd ] && [ -e /var/bin/nmbd ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start samba
fi
/var/bin/smbd -D
sleep 1
/var/bin/nmbd -D
fi
}
startNfs() {
if [ "$nfsserver" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start startNfs
fi
/etc/init.d/portmap start &
/etc/init.d/nfs-kernel-server start &
fi
}
startStickextensions() {
if grep -q /var/swap /proc/mounts; then
if [ ! -e /var/swap/automount ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create automount DIR
fi
mkdir /var/swap/automount
fi
if [ ! -e /var/swap/skins ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create skins DIR
fi
mkdir /var/swap/skins
fi
if [ ! -e /var/swap/saver ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create swap DIR
fi
mkdir /var/swap/saver
fi
if [ ! -e /var/swap/mcskins ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create swap DIR
fi
mkdir /var/swap/mcskins
fi
if [ ! -e /var/swap/images ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create swap DIR
fi
mkdir /var/swap/images
fi
if [ ! -e /var/swap/extensions ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create extensions DIR
fi
mkdir /var/swap/extensions
fi
LIST=`ls -1 /var/swap/extensions`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /usr/lib/enigma2/python/Plugins/Extensions/"$ROUND" ]; then
ln -s "/var/swap/extensions/$ROUND" /usr/lib/enigma2/python/Plugins/Extensions/"$ROUND"
fi
done
if [ ! -e /var/swap/bin ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create bin DIR
fi
mkdir /var/swap/bin
fi
LIST=`ls -1 /var/swap/bin`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /var/bin/"$ROUND" ]; then
ln -s "/var/swap/bin/$ROUND" /var/bin/"$ROUND"
fi
done
if [ ! -e /var/swap/fonts ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create swap DIR
fi
mkdir /var/swap/fonts
fi
LIST=`ls -1 /var/swap/fonts`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /var/usr/share/fonts/"$ROUND" ]; then
ln -s "/var/swap/fonts/$ROUND" /var/usr/share/fonts/"$ROUND"
fi
done
if [ ! -e /var/swap/modules ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create modules DIR
fi
mkdir /var/swap/modules
fi
LIST=`ls -1 /var/swap/modules`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /var/lib/modules/"$ROUND" ]; then
ln -s "/var/swap/modules/$ROUND" /var/lib/modules/"$ROUND"
fi
done
if [ ! -e /var/swap/picon ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create picon DIR
fi
mkdir /var/swap/picon
fi
if [ ! -e /var/usr/local/share/enigma2/picon ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink picon to swapstick
fi
ln -s /var/swap/picon /var/usr/local/share/enigma2/picon
fi
if [ ! -e /var/swap/keys ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create keys DIR
fi
mkdir /var/swap/keys
fi
LIST=`ls -1 /var/swap/keys`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /var/keys/"$ROUND" ]; then
cp "/var/swap/keys/$ROUND" /var/keys/"$ROUND"
fi
done
if [ ! -e /var/swap/lib ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create lib DIR
fi
mkdir /var/swap/lib
fi
LIST=`ls -1 /var/swap/lib`
for ROUND in $LIST; do
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create symlink $ROUND to swapstick
fi
if [ ! -e /var/usr/lib/"$ROUND" ]; then
ln -s "/var/swap/lib/$ROUND" /var/usr/lib/"$ROUND"
fi
done
if [ ! -e /var/swap/boot ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create boot DIR
fi
mkdir /var/swap/boot
fi
if [ ! -e /var/swap/python2.6 ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create python2.6 DIR
fi
mkdir /var/swap/python2.6
fi
fi
}
startEmu() {
if [ "$emu" != "off" ] && [ -e /var/emu/`echo "$emu" | cut -d ' ' -f1` ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start $emu
fi
emu1=`echo $emu | tr "/" "\n" | tail -n1`
running=`pidof $emu1`
cp /var/etc/"$emu1".emu /tmp/.activecam
if [ -z $running ]; then
if [ `echo $emu | grep -o ";" | wc -l` -gt 0 ]; then
emu1=`echo $emu | cut -d ';' -f 1`
emu2=`echo $emu | cut -d ';' -f 2`
( /var/emu/$emu1
sleep 5
$emu2 )&
else
# "/var/emu/$emu" &
/var/emu/$emu &
fi
if [ "$iwatch" = "y" ] && [ `echo "$emu" | tr '[A-Z]' '[a-z]' | grep "incubus" | wc -l` != 0 ]; then
if [ ! "$debug" = 'off' ]; then
echo start incubus_watch
fi
/sbin/incubus_watch &
fi
fi
fi
}
startReader() {
if [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ]; then
if [ -e /var/bin/.oscam ];then
/var/usr/lib/enigma2/python/Plugins/Extensions/Oscam_Control/reader.sh start &
fi
fi
}
startPl2303() {
if [ -e /lib/modules/usbserial.ko ] && [ -e /lib/modules/pl2303.ko ] && [ "$pl2303" = "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load pl2303 modul
fi
if [ ! "$nr_usbreaders" ]; then
nr_usbreaders=2
fi
if [ "$nr_usbreaders" -gt 0 ]; then
i=-1
while [[ $((++i)) -lt "$nr_usbreaders" ]]; do
mknod -m 666 /dev/ttyUSB"$i" c 188 "$i"
done
fi
/sbin/insmod /lib/modules/usbserial.ko >/dev/null 2>&1
/sbin/insmod /lib/modules/pl2303.ko
fi
}
startFtdi() {
if [ -e /lib/modules/usbserial.ko ] && [ -e /lib/modules/ftdi.ko ] && [ "$ftdi" = "y" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load Ftdi modul
fi
if [ ! "$nr_usbreaders" ]; then
nr_usbreaders=2
fi
if [ "$nr_usbreaders" -gt 0 ]; then
i=-1
while [[ $((++i)) -lt "$nr_usbreaders" ]]; do
mknod -m 666 /dev/ttyUSB"$i" c 188 "$i"
done
fi
/sbin/insmod /lib/modules/usbserial.ko >/dev/null 2>&1
/sbin/insmod /lib/modules/ftdi.ko
fi
}
startProfile() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Create Profile
fi
echo "0.02 PYTHON_START
0.18 LANGUAGE
0.77 LOAD:InfoBar
0.81 LOAD:GUISkin
0.84 LOAD:ElementTree
1.99 LOAD:enigma_skin
2.58 LoadSkin
2.80 LoadSkinDefault
3.07 LoadSkinDefaultDone
3.08 LOAD:Source
3.08 LOAD:GUIComponent
3.47 LOAD:enigma
3.48 LOAD:InfoBarGenerics
3.64 ChannelSelection.py 1
6.86 ChannelSelection.py 2
6.86 ChannelSelection.py 2.1
6.89 ChannelSelection.py 2.2
6.89 ChannelSelection.py 2.3
6.89 ChannelSelection.py 3
6.93 ChannelSelection.py 4
6.95 ChannelSelection.py after imports
7.80 LOAD:InitBar_Components
7.80 LOAD:HelpableScreen
7.81 ParentalControl
7.84 LOAD:Navigation
7.92 LOAD:skin
7.92 LOAD:Tools
7.93 ReloadProfiles
8.01 Twisted
14.61 LOAD
lugin
14.62 LOAD:Wizard
14.97 misc
14.98 LOAD:ScreenGlobals
15.05 Screen
15.05 Standby,PowerKey
15.06 Scart
15.07 Load:CI
15.09 Load:VolumeControl
15.12 VolumeControl
15.12 Init:skin
15.57 InputDevice
15.58 AVSwitch
15.64 RecordingConfig
15.65 UsageConfig
16.08 keymapparser
16.38 Network
16.44 LCD
16.46 SetupDevices
18.35 RFMod
18.35 Init:CI
18.37 readPluginList
20.65 Init:Session
20.69 wizards
23.03 Init:VolumeControl
23.11 Init
owerKey
23.13 RunReactor" > /var/tmp/profile &
touch /var/tmp/blacklist &
touch /var/tmp/playlist.e2pls &
touch /var/tmp/whitelist &
}
startNetmodule() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start Load Netmodule
fi
if [ -e /lib/modules/fuse.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load fuse.ko modul
fi
/sbin/insmod /lib/modules/fuse.ko
fi
if [ -e /lib/modules/ntfs.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load ntfs.ko modul
fi
/sbin/insmod /lib/modules/ntfs.ko
fi
if [ -e /lib/modules/cifs.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load cifs.ko modul
fi
/sbin/insmod /lib/modules/cifs.ko
fi
if [ -e /lib/modules/nfs_acl.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load nfs_acl.ko modul
fi
/sbin/insmod /lib/modules/nfs_acl.ko
fi
if [ -e /lib/modules/exportfs.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load exportfs.ko modul
fi
/sbin/insmod /lib/modules/exportfs.ko
fi
if [ -e /lib/modules/nfsd.ko ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Load nfsd.ko modul
fi
/sbin/insmod /lib/modules/nfsd.ko
fi
}
startRcreboot() {
if [ "$rcreboot" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start RC-Reboot
fi
/usr/bin/awk -f /etc/init.d/getfb.awk /dev/input/event0 &
fi
}
startCrossepg() {
if [ -e /usr/lib/enigma2/python/Plugins/SystemPlugins/CrossEPG/crossepg/crossepg_epgmove.sh ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start CROSSEPG
fi
/usr/lib/enigma2/python/Plugins/SystemPlugins/CrossEPG/crossepg/crossepg_epgmove.sh
fi
}
startFontsize() {
if [ "$1" = "reboot" ] || ([ "$1" = "ba" ] && [ -e /var/etc/.firstnet ]); then
if [ "$fontsize" = 'big' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] set fontsize to $fontsize
fi
FILE=/var/usr/local/share/enigma2/skin_default.xml
sed -e 's!<widget font="Regular;17" position="640,130" render="Label" size="350,380" source="ServiceEvent">!<widget font="Regular;22" position="640,130" render="Label" size="350,380" source="ServiceEvent">!g' -i $FILE
sed -e 's!<widget foregroundColorServiceNotAvail="#5a5a5a" name="list" position="30,74" scrollbarMode="showOnDemand" serviceInfoFont="Regular;17" serviceItemHeight="21" serviceNameFont="Regular;19" serviceNumberFont="Regular;19" size="590,442"/>!<widget foregroundColorServiceNotAvail="#5a5a5a" name="list" position="30,74" scrollbarMode="showOnDemand" serviceInfoFont="Regular;22" serviceItemHeight="26" serviceNameFont="Regular;24" serviceNumberFont="Regular;24" size="590,442"/>!g' -i $FILE
fi
if [ "$fontsize" = 'small' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] set fontsize to $fontsize
fi
FILE=/var/usr/local/share/enigma2/skin_default.xml
sed -e 's!<widget font="Regular;22" position="640,130" render="Label" size="350,380" source="ServiceEvent">!<widget font="Regular;17" position="640,130" render="Label" size="350,380" source="ServiceEvent">!g' -i $FILE
sed -e 's!<widget foregroundColorServiceNotAvail="#5a5a5a" name="list" position="30,74" scrollbarMode="showOnDemand" serviceInfoFont="Regular;22" serviceItemHeight="26" serviceNameFont="Regular;24" serviceNumberFont="Regular;24" size="590,442"/>!<widget foregroundColorServiceNotAvail="#5a5a5a" name="list" position="30,74" scrollbarMode="showOnDemand" serviceInfoFont="Regular;17" serviceItemHeight="21" serviceNameFont="Regular;19" serviceNumberFont="Regular;19" size="590,442"/>!g' -i $FILE
fi
fi
}
startFonts() {
if [ ! -e /var/usr/share/fonts/default.ttf ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] restore default fonts
fi
cp /var/usr/share/fonts/backup-default.ttf /var/usr/share/fonts/default.ttf
fi
}
startRedbutton() {
if [ "$model" = "ufs910" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] stop red button
fi
echo "B" > /dev/ttyAS1
fi
}
startBa() {
if [ ! -e /etc/.BAImage ]; then
if [ -e /var/baroot/ba/bainit ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start bainit
fi
mkdir /tmp/badevice
mount --bind /var/badevice /tmp/badevice
if [ "$model" = "ufs910" ]; then
if [ `grep /dev/mtdblock3 /proc/mounts | tail -n 1 | wc -l` -eq 1 ]; then
/var/baroot/ba/bainit > /var/ba.log 2>&1
fi
elif [ "$model" = "ufs922" ]; then
if [ `grep /dev/mtdblock3 /proc/mounts | tail -n 1 | wc -l` -eq 1 ]; then
if [ -e /var/baroot/.e2flash ]; then
/var/baroot/ba/bainit > /var/ba.log 2>&1
fi
fi
fi
umount /tmp/badevice
rmdir /tmp/badevice
fi
fi
}
startBootdelay() {
if [ -e /var/etc/.bootdelay ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] start set bootdelay 1
fi
fw_setenv bootdelay 1
rm /var/etc/.bootdelay
fi
}
startWlan() {
WLAN_LOG=/tmp/wlan.log
rm -f $WLAN_LOG
touch $WLAN_LOG
if [ -f /var/etc/autostart/wlan ]; then
WLAN_STARTMODE=load
. /var/etc/autostart/wlan
else
echo "wireless plugin not installed" | tee -a $WLAN_LOG
fi
}
startNet() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startNet
fi
networkcmd="/etc/init.d/networking"
netrestart=0
iface="eth0"
[ ! -z $1 ] && iface=$1 && networkcmd=$networkcmd.$iface && netrestart=1
if [ -e /var/etc/.firstnet ]; then
if [ -e /var/swap/backup/network/interfaces ]; then
cp /var/swap/backup/network/interfaces /var/etc/network/interfaces
netrestart=1
fi
if [ -e /var/swap/backup/etc/resolv.conf ]; then
cp /var/swap/backup/etc/resolv.conf /var/etc/resolv.conf
netrestart=1
fi
fi
if [ $netrestart = 1 ];then
$networkcmd restart
sleep 1
fi
if [ -z `cat /var/etc/network/interfaces | grep ^"auto $iface"` ]; then
echo $CMD ["$INPUT"] network $iface not activated
else
echo $CMD ["$INPUT"] network read $iface
if [ ! -z "`ifconfig | grep $iface`" ]; then
IP=`ifconfig $iface | grep -m1 "inet addr" | sed s/"^\s*"// | sed s/" \+"/" "/g | cut -d " " -f2 | cut -d ":" -f2`
GW=`route -n | grep -m1 "^0.0.0.0" | sed s/" \+"/" "/g | cut -d " " -f2`
MASK=`ifconfig $iface | grep -m1 "inet addr" | sed s/"^\s*"// | sed s/" \+"/" "/g | cut -d " " -f4 | cut -d ":" -f2`
DNS=`cat /var/etc/resolv.conf | grep nameserver | cut -d" " -f2`
if [ -z "$DNS" ]; then DNS="no dns on firstboot"; fi
echo -e "INTERFACE: $iface\nIP-ADDRESSE: $IP\nNETMASKE: $MASK\nDNS-SERVER: $DNS\nGATEWAY: $GW" >> /tmp/.infobox
fi
fi
if [ "$showip" = 'status' ]; then
echo "$TYPE" > /dev/vfd &
fi
[ $iface == "$WLAN_IF" ] && IP="W$IP"
if [ "$showip" = 'ip' ]; then
echo $IP > /dev/vfd &
fi
echo $GW > /var/etc/default_gw
if [ "$model" = "ufs910" ] && [ "$iface" == "eth0" ] ; then
( echo 1 > /proc/smsc911x/setspeed; echo 10 > /proc/smsc911x/deas; echo 0 > /proc/smsc911x/tx_pio )
fi
rm /var/etc/.firstnet
}
startShowinfo() {
if [ "$showiptv" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startShowinfo
fi
VERSION=`cat /etc/version`
a=0
while [ ! -e /tmp/.swapready ]; do
sleep 1
a=$(($a+1))
if [ $a -gt 10 ]; then break; fi
done
while read line; do
param="$param \"$line\""
done < /tmp/.infobox
if [ ! -z "$param" ]; then
(
eval infobox 5 "BOOT-INFO" $param \"--------------------------------\" \"VERSION: $VERSION\"
touch /tmp/.showinfoready
)&
fi
rm -f /tmp/.swapready
fi
}
startSetvol() {
if [ "$model" = "ufs922" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startSetvol
fi
echo $CMD ["$INPUT"] setvolume
python /sbin/setvolume.pyc &
fi
}
startSystemdown() {
start_sec.sh 2 /sbin/fuser -k /dev/dvb/adapter0/frontend0
start_sec.sh 2 pkill tuxtxt
start_sec.sh 2 pkill -9 tuxtxt
start_sec.sh 10 sync
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Swapoff
fi
start_sec.sh 10 swap swapfileoff
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Stop Emu
fi
start_sec.sh 2 killall -9 `grep "emu=" /var/etc/autostart/start-config | cut -d \" -f 2 | cut -d " " -f0`
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Umount Disks
fi
devlist=`cat /proc/diskstats | cut -c 11- | cut -d " " -f1 | grep "sd[a-z][0-9]"`
if [ ! -z "$devlist" ]; then
for device in $devlist; do
echo $CMD ["$INPUT"] umount -fl /dev/"$device"
start_sec.sh 10 umount -fl /dev/"$device"
done
startFsckrecord
startFsckswap
fi
}
startReboot() {
if [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ]; then
/bin/cubefpctl --setgmtoffset
/bin/cubefpctl --syncfptime
elif [ "$model" = "tf7700" ]; then
/bin/tffpctl --setgmtoffset
fi
if [ "$REBOOT" == "1" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] SHUTDOWN
fi
echo "SHUTDOWN" > /dev/vfd
echo "$CMD SHUTDOWN"
if [ -e /var/etc/.errorcount ]; then
rm /var/etc/.errorcount
fi
/var/etc/boot/poweroff.sh
startSystemdown
init 0
elif [ "$REBOOT" == "2" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] REBOOT
fi
echo "REBOOT" > /dev/vfd
echo "$CMD REBOOT"
if [ -e /var/etc/.errorcount ]; then
rm /var/etc/.errorcount
fi
/var/etc/boot/reboot.sh
startSystemdown
init 6
elif [ "$REBOOT" == "3" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] E2 RESTART
fi
start_sec.sh 2 /sbin/fuser -k /dev/dvb/adapter0/frontend0
echo "E2 RESTART" > /dev/vfd
echo "$CMD E2 RESTART"
start_sec.sh 2 pkill tuxtxt
start_sec.sh 2 pkill -9 tuxtxt
startSetvol
start_sec.sh 2 killall -9 `cat /var/etc/autostart/start-config | grep emu | cut -d \" -f2 | cut -d " " -f0`
(sleep 10;startEmu)&
echo "0" > /proc/progress
/var/etc/boot/bootlogo.sh &
elif [ "$REBOOT" == "20" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] E2 RESTART
fi
start_sec.sh 2 /sbin/fuser -k /dev/dvb/adapter0/frontend0
echo "QT-BROWSER" > /dev/vfd
echo "$CMD QT-BROWSER"
start_sec.sh 2 pkill tuxtxt
start_sec.sh 2 pkill -9 tuxtxt
oldmode=`cat /proc/stb/video/videomode`
echo 720p50 >/proc/stb/video/videomode
sleep 2
/var/bin/browser/browser -qws
sleep 2
echo $oldmode >/proc/stb/video/videomode
echo "QT-BROWSER" > /dev/vfd
start_sec.sh 2 killall -9 `cat /var/etc/autostart/start-config | grep emu | cut -d \" -f2 | cut -d " " -f0`
(sleep 10;startEmu)&
echo "0" > /proc/progress
/var/etc/boot/bootlogo.sh &
else
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] ERROR
fi
sleep $errorstop
echo "ERROR REBOOT" > /dev/vfd
echo "$CMD ERROR REBOOT"
if [ "$e2errorboot" != "y" ]; then
echo "." >> /var/etc/.error
/var/etc/boot/reboot.sh
startSystemdown
fi
init 6
fi
}
startFirst() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Boot first
fi
touch /var/etc/.first &
}
startRm_first_error() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Remove first and error
fi
rm -f /var/etc/.first
rm -f /var/etc/.error
rm -f /var/etc/.firstszap
}
startHddicon() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] Set HDD Icon
fi
if [ -e /tmp/.recorddev ] && [ ! "$model" = "at7000" ]; then
vfdctl +hdd
else
if [ -e /etc/.BAImage ] && [ ! "$model" = "at7000" ]; then
if grep -q "/hdd" /proc/mounts; then
vfdctl +hdd
fi
fi
fi
}
startSwap() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startSwap
fi
swap
}
startGetbootvid() {
if [ $model = "ufs912" ] || [ $model = "at7500" ]; then
rm -f /var/etc/.getbootvid
elif [ -e /var/etc/.getbootvid ] && [ ! -e /etc/.BAImage ]; then
if grep -q /var/swap /proc/mounts && checknet; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startgetbootvid
fi
infobox 9999 "UPDATE" "ACHTUNG: Videos downloaden ??" " " "OK = Weiter" "RED/BLUE = Abbrechen / Reboot" &
echo "FB - ABFRAGE" > /dev/vfd
abfrage /dev/input/event0; ret=$?
echo " " > /dev/vfd
killall infobox
if [ $ret -eq 0 ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startgetbootvid started download
fi
killall -9 infobox
infobox 5 Info "Try to download Boot-/Reboot-/Shutdownvideo. Please wait!" &
echo "Load Bootvideo" > /dev/vfd
if [ ! -e /var/swap/boot ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] create boot DIR
fi
mkdir /var/swap/boot
fi
rm -f /var/swap/boot/bootvideo.mkv /var/swap/boot/rebootvideo.mkv /var/swap/boot/bootvideo.mvi /var/swap/boot/poweroffvideo.mkv
sync
cd /var/swap/boot
wget.info `cat /var/etc/ipkg/official-feed.conf | cut -d " " -f3`/boot/bootvideo.mkv
if [ $? -eq 0 ]; then
wget.info `cat /var/etc/ipkg/official-feed.conf | cut -d " " -f3`/boot/bootvideo.mvi
wget.info `cat /var/etc/ipkg/official-feed.conf | cut -d " " -f3`/boot/poweroffvideo.mkv
wget.info `cat /var/etc/ipkg/official-feed.conf | cut -d " " -f3`/boot/rebootvideo.mkv
fi
fi
fi
rm -f /var/etc/.getbootvid
sync
else
rm -f /var/etc/.getbootvid
fi
}
startCpu_frequ() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startCpu_frequ
fi
if [ $pll0_ndiv_mdiv -gt 0 ]; then
echo $pll0_ndiv_mdiv > /proc/cpu_frequ/pll0_ndiv_mdiv
fi
if [ $pll1_ndiv_mdiv -gt 0 ]; then
echo $pll1_ndiv_mdiv > /proc/cpu_frequ/pll1_ndiv_mdiv
fi
if [ $pll1_fdma_bypass -eq 1 ]; then
echo 1 > /proc/cpu_frequ/pll1_fdma_bypass
fi
}
startCpu_frequ_stop() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startCpu_frequ_stop
fi
if [ "$only_boot_overclock" = "y" ]; then
pll0_ndiv_mdiv=15110 # 531MHZ
pll1_ndiv_mdiv=34057 # 399MHZ
echo 0 > /proc/cpu_frequ/pll1_fdma_bypass
startCpu_frequ
fi
}
startRestore() {
if grep -q /var/swap /proc/mounts; then
if [ ! -e /var/etc/automount/automounts.xml ] && [ -e /var/swap/automount/automounts.xml ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] copy automounts.xml to flash
fi
cp /var/swap/automount/automounts.xml /var/etc/automount/automounts.xml
fi
if [ ! -e /var/swap/automount/automounts.xml ] && [ -e /var/etc/automount/automounts.xml ] ; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] copy automounts.xml to swap
fi
cp /var/etc/automount/automounts.xml /var/swap/automount/automounts.xml
fi
fi
/sbin/settings $SWTYPE restore # in this file restoring will be processed....
startCpu_frequ # set cpu frequence after restore, so we have full cpu power on first boot after restore
}
startSysctl() {
if [ "$model" = "ufs910" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startSysctl
fi
echo 0 > /proc/sys/net/ipv4/tcp_timestamps &
echo 0 > /proc/sys/net/ipv4/tcp_sack &
fi
}
startFan() {
# Start Fan
if [ "$model" = "ufs922" ]; then
echo "Set Fan Speed"
fanspeed=`grep config.Fan.speed /etc/enigma2/settings | cut -d "=" -f 2`
if [ "$fanspeed" ]; then
if [ "$fanspeed" = "0" ];then
echo "115" >/proc/stb/fan/fan_ctrl
fi
if [ "$fanspeed" = "1" ];then
echo "130" >/proc/stb/fan/fan_ctrl
fi
if [ "$fanspeed" = "2" ];then
echo "145" >/proc/stb/fan/fan_ctrl
fi
if [ "$fanspeed" = "3" ];then
echo "155" >/proc/stb/fan/fan_ctrl
fi
if [ "$fanspeed" = "4" ];then
echo "170" >/proc/stb/fan/fan_ctrl
fi
else
# if no value found set to 1500rpm
echo "170" >/proc/stb/fan/fan_ctrl
fi
fi
}
startLoadpartition() {
if [ "$loadpartition" = 'y' ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startLoadpartition
fi
if [ "$1" ]; then
hdparm -z "/dev/$1"
else
for dev in sda sdb sdc sde sdf sdg; do
hdparm -z "/dev/$dev"
done
fi
#sleep 2
fi
}
startAutoFS() {
if [ -e /var/etc/autofs ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startAutoFS
fi
if grep -q "True" /var/etc/autofs; then
/etc/init.d/autofs start &
fi
fi
}
startRepair() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startRepair
fi
#rm -f /media/hdd/epg.dat
#rm -f /media/hdd/epg.dat.sav
#rm -f "$epg_file"
epgfilelocation=`cat /etc/enigma2/settings | grep config.misc.epgcache_filename | cut -d "=" -f 2`
if [ "$epgfilelocation" ]; then
rm -f "$epgfilelocation"
else
rm -f /media/hdd/epg.dat
fi
resolvsize=`ls -l /var/etc/resolv.conf 2>/dev/null | cut -c 30-42`
if [ ! -z "$resolvsize" ] && [ $resolvsize -gt 2048 ]; then
rm -f /var/etc/resolv.conf
fi
sed "/config.skin.primary_skin=/d" -i /etc/enigma2/settings
if [ -L /var/usr/local/share/enigma2/skin_default ]; then
rm -f /var/usr/local/share/enigma2/skin_default
ln -s /usr/local/share/skin_default /var/usr/local/share/enigma2/skin_default
fi
if [ -L /var/usr/local/share/enigma2/skin_default.xml ]; then
rm -f /var/usr/local/share/enigma2/skin_default.xml
ln -s /usr/local/share/skin_default.xml /var/usr/local/share/enigma2/skin_default.xml
fi
if [ -L /var/usr/local/share/enigma2/skin.xml ]; then
rm -f /var/usr/local/share/enigma2/skin.xml
ln -s /usr/local/share/skin.xml /var/usr/local/share/enigma2/skin.xml
fi
infobox 9999 INFO "FSCK" "Soll ein Filesystemcheck durchgefuehrt werden ?" " " "OK = Check durchfuehren" "Exit = Keine Check durchfuehren" &
echo "FB - ABFRAGE" > /dev/vfd
abfrage /dev/input/event0; ret=$?
echo " " > /dev/vfd
killall infobox
if [ $ret -eq 0 ]; then
swap swapfileoff
devlist=`cat /proc/diskstats | cut -c 11- | cut -d " " -f1 | grep "sd[a-z][0-9]"`
for device in $devlist; do
echo $CMD ["$INPUT"] umount -fl /dev/"$device"
umount -fl /dev/"$device"
done
rm -f /tmp/.swapdev
rm -f /tmp/.recorddev
oldfsckswap="$fsckswap"
oldfsckrecord="$fsckrecord"
fsckswap="y"
fsckrecord="y"
startFsckrecord
startFsckswap
fsckswap="$oldfsckswap"
fsckrecord="$oldfsckrecord"
amount
swap
fi
}
startOnlineupdate() {
#Hole Imagelist
update.sh getfilelist
lastimg=`ls -1 /tmp/online | grep _"$model"_ | grep _FULL_ | tail -n1`
if [ ! -z "$lastimg" ]; then
infobox 9999 INFO "Gefundenes Image:" "$lastimg" " " "OK = Update durchfuehren" "Exit = Keine Update durchfuehren" &
echo "FB - ABFRAGE" > /dev/vfd
abfrage /dev/input/event0; ret=$?
echo " " > /dev/vfd
killall infobox
if [ $ret -eq 0 ]; then
#Online Update
update.sh online full $lastimg
fi
else
infobox 3 INFO "Leider wurde kein Image am Server gefunden."
fi
}
startHaltonerror() {
if [ `cat /proc/stb/fp/was_timer_wakeup` = "1" ] && [ -e /var/etc/.error ]; then
if [ -e /var/etc/.errorcount ]; then
echo "`expr \`cat /var/etc/.errorcount\` \"+\" \"1\"`" > /var/etc/.errorcount
else
echo "1" > /var/etc/.errorcount
fi
if [ `cat /var/etc/.errorcount` -lt 3 ]; then
rm /var/etc/.error
fi
fi
if [ "$repairmodus" != "0" ] && [ -e /var/etc/.error ]; then
if [ "$repairmodus" = "2" ] && [ `cat /var/etc/.error | wc -l` -lt 2 ]; then return; fi
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startHaltonerror
fi
a=0
while [ ! -e /tmp/.showinfoready ]; do
sleep 1
a=$(($a+1))
if [ $a -gt 10 ]; then break; fi
done
if [ ! -e /etc/.BAImage ] && [ ! -e /etc/.usbimage ]; then
infobox 9999 INFO "Ein Fehler wurde beim letzten REBOOT festgestellt." "Mit TELNET koennen Reperaturen durchgefuehrt werden." "ErrorLog in /media/hdd wenn rmcrashlog im Panel deaktiviert." " " "OK = Fortsetzen" "ROT = Reparieren (bei Bootschleife)" "BLAU = Online Update" &
else
infobox 9999 INFO "Ein Fehler wurde beim letzten REBOOT festgestellt." "Mit TELNET koennen Reperaturen durchgefuehrt werden." "ErrorLog in /media/hdd wenn rmcrashlog im Panel deaktiviert." " " "OK = Fortsetzen" "ROT = Reparieren (bei Bootschleife)" &
fi
rm -f /var/etc/.error
touch /tmp/szap_stopRC
echo "FB - ABFRAGE" > /dev/vfd
abfrage /dev/input/event0; ret=$?
echo " " > /dev/vfd
rm -f /tmp/szap_stopRC
killall infobox
if [ $ret -eq 2 ] && [ ! -e /etc/.BAImage ] && [ ! -e /etc/.usbimage ]; then
startOnlineupdate
fi
if [ $ret -eq 3 ]; then
startRepair
fi
fi
rm -f /tmp/.showinfoready
}
startWorkaround() {
if [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startWorkaround
fi
/var/bin/rem &
fi
}
startTimefix() {
if [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startTimefix
fi
(
/var/bin/ntpdate ptbtime1.ptb.de
if [ $? -eq 0 ]; then
cubefpctl --setgmtoffset
cubefpctl --syncfptime
fi
) &
fi
if [ "$1" == "e2" ]; then
if [ "$model" = "at700" ] || [ "$model" = "at7000" ] || [ "$model" = "at7500" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startTimefix e2
fi
date=`date "+%H:%M:%S %m-%d-%Y"`
echo $CMD ["$INPUT"] current Date : $date
/bin/fp_control -s $date
fi
fi
}
startLink() {
if [ ! -e /usr/local/share/enigma2/timers.xml ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startLink
fi
ln -s /etc/enigma2/timers.xml /usr/local/share/enigma2/timers.xml &
fi
}
startNetmount() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startNetmount first
fi
nmount first &
}
startFirstplugload() {
if [ -e /var/etc/PlugLoad.cfg.firstboot ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startFirstplugload
fi
rm /var/etc/PlugLoad.cfg
mv /var/etc/PlugLoad.cfg.firstboot /var/etc/PlugLoad.cfg
fi
}
startVolumeMigrate() {
if [ -e /var/etc/.firstnet ] && [ "$model" = "tf7700" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startVolumeMigrate $model
fi
devlist=`cat /proc/diskstats | cut -c 11- | cut -d " " -f1 | grep "sd[a-z][0-9]"`
blkid=`blkid -w /dev/null -c /dev/null`
for device in $devlist; do
label=`echo -e "$blkid" | grep "^/dev/$device:" | grep LABEL= | sed 's/^.*LABEL="//;s/".*$//' | tr -d " " | tr -d "-"`
type=`echo -e "$blkid" | grep "^/dev/$device:" | grep TYPE= | sed 's/^.*TYPE="//;s/".*$//'`
if [ "$label" == "" ] && [ "$device" == "sda1" ] ; then
echo "found TDT Image Partition on $device"
echo "Create MINI9 LABEL"
tune2fs -L MINI9 /dev/$device
continue
fi
if [ "$type" == "swap" ] && [ "$label" == "" ] && [ "$device" == "sda2" ]; then
if [ ! -e /tmp/.swappart ]; then
echo "found TDT SWAP on $device"
echo "Create SWAPPART LABEL"
echo "SWAPPART" > /tmp/swaplabel
dd if=/tmp/swaplabel of="/dev/$device" seek=1052 bs=1 count=8
rm -f /tmp/swaplabel
echo "$device#swap" > /tmp/.swappart
fi
continue
fi
if [ "$label" == "" ] && [ "$device" == "sda3" ] ; then
echo "found TDT Movie Partition on $device"
echo "Create RECORD LABEL"
tune2fs -L RECORD /dev/$device
continue
fi
done
elif [ -e /var/etc/.firstnet ] && [ "$model" = "at7000" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startVolumeMigrate $model
fi
if [ `blkid | grep 'TYPE="jfs"' | grep sda1 | wc -l` -eq 1 ]; then
echo Label /dev/sda1 with RECORD
jfs_tune -L "RECORD" /dev/sda1
fi
elif [ -e /var/etc/.firstnet ] && [ "$model" = "at7500" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startVolumeMigrate $model
fi
if [ `blkid | grep 'TYPE="jfs"' | grep sda1 | wc -l` -eq 1 ]; then
echo Label /dev/sda1 with RECORD
jfs_tune -L "RECORD" /dev/sda1
fi
fi
}
startFixBootArgs() {
if [ "$model" = "tf7700" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startFixBootArgs $model
fi
echo "/dev/mtd2 0x00000000 0x00010000 0x10000" > /var/fw_env.config
dnsip=`cat /var/etc/resolv.conf | grep nameserver | cut -d" " -f2`
ipaddr=`ifconfig eth0 | grep -m1 "inet addr" | sed s/"^\s*"// | sed s/" \+"/" "/g | cut -d " " -f2 | cut -d ":" -f2`
serverip=`route -n | grep -m1 "^0.0.0.0" | sed s/" \+"/" "/g | cut -d " " -f2`
gateway=`route -n | grep -m1 "^0.0.0.0" | sed s/" \+"/" "/g | cut -d " " -f2`
if [ -z "$dnsip" ]; then DNS="$gateway"; fi
RANDOM=`date +%s`
HEX1=`printf "%02x\n" $((($RANDOM + 1)%255))`
HEX2=`printf "%02x\n" $((($RANDOM + 43)%255))`
HEX3=`printf "%02x\n" $((($RANDOM + 76)%255))`
if [ "$HEX1" = "ffffffff" ] ; then
ethaddr="00:3e:9e:11:22:33"
else
ethaddr="00:3e:9e:$HEX1:$HEX2:$HEX3"
fi
netmask=`ifconfig eth0 | grep Bcast | cut -d ":" -f4`
HELP=`fw_printenv`
ba1=`echo "$HELP" | grep ba1= | sed 's/ba1=//'`
bootargs=`echo "$HELP" | grep bootargs= | sed 's/bootargs=//'`
HELP=`echo "$ba1" | tr " " "\n" | grep "^ip=" | sed 's/^ip=//'`
OLDIPBA1=`echo "$HELP" | cut -d ":" -f 1`
fixba1=`echo "console=ttyAS0,115200 root=/dev/sda1 rw init=/bin/devinit ip=$ipaddr:$serverip:$gateway:$netmask:tf7700:eth0
ff mem=128m coprocessor_mem=4m@0x10000000,4m@0x10400000 rootdelay=6 nwhwconf=device:eth0,hwaddr:$ethaddr"`
HELP=`echo "$bootargs" | tr " " "\n" | grep "^ip=" | sed 's/^ip=//'`
OLDIP=`echo "$HELP" | cut -d ":" -f 1`
fixbootargs=`echo "console=ttyAS0,115200 root=/dev/sda1 rw init=/bin/devinit ip=$ipaddr:$serverip:$gateway:$netmask:tf7700:eth0
ff mem=128m coprocessor_mem=4m@0x10000000,4m@0x10400000 rootdelay=6 nwhwconf=device:eth0,hwaddr:$ethaddr"`
if [ ! "$OLDIPBA1" = "$ipaddr" ] || [ ! "$OLDIP" = "$ipaddr" ] ; then
fw_setenv ba1 `echo $fixba1`
fw_setenv bootargs `echo $fixbootargs`
fw_setenv ipaddr `echo $ipaddr`
fw_setenv serverip `echo $serverip`
fw_setenv gateway `echo $gateway`
fw_setenv netmask `echo $netmask`
fw_setenv dnsip `echo $dnsip`
fw_setenv ethaddr `echo $ethaddr`
fi
elif [ "$model" = "ipbox9000" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox910" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startFixBootArgs $model
fi
dnsip=`cat /var/etc/resolv.conf | grep nameserver | cut -d" " -f2`
ipaddr=`ifconfig eth0 | grep -m1 "inet addr" | sed s/"^\s*"// | sed s/" \+"/" "/g | cut -d " " -f2 | cut -d ":" -f2`
serverip=`route -n | grep -m1 "^0.0.0.0" | sed s/" \+"/" "/g | cut -d " " -f2`
gateway=`route -n | grep -m1 "^0.0.0.0" | sed s/" \+"/" "/g | cut -d " " -f2`
if [ -z "$dnsip" ]; then DNS="$gateway"; fi
netmask=`ifconfig eth0 | grep Bcast | cut -d ":" -f4`
HELP=`fw_printenv`
bootargsusb=`echo "$HELP" | grep bootargsusb= | sed 's/bootargsusb=//'`
bootargs=`echo "$HELP" | grep bootargs= | sed 's/bootargs=//'`
HELP=`echo "$bootargsusb" | tr " " "\n" | grep "^ip=" | sed 's/^ip=//'`
OLDIPUSB=`echo "$HELP" | cut -d ":" -f 1`
fixbootargsusb=`echo "$bootargsusb" | sed s/${HELP}/${ipaddr}:${serverip}:${gateway}:${netmask}:cuberevo:eth0
ff/g`
HELP=`echo "$bootargs" | tr " " "\n" | grep "^ip=" | sed 's/^ip=//'`
OLDIP=`echo "$HELP" | cut -d ":" -f 1`
fixbootargs=`echo "$bootargs" | sed s/${HELP}/${ipaddr}:${serverip}:${gateway}:${netmask}:cuberevo:eth0
ff/g`
if [ ! "$OLDIPUSB" = "$ipaddr" ] || [ ! "$OLDIP" = "$ipaddr" ] ; then
fw_setenv bootargsusb `echo $fixbootargsusb`
fw_setenv bootargs `echo $fixbootargs`
fw_setenv ipaddr `echo $ipaddr`
fw_setenv serverip `echo $serverip`
fw_setenv gateway `echo $gateway`
fw_setenv netmask `echo $netmask`
fw_setenv dnsip `echo $dnsip`
fi
fi
}
startVideoTune() {
brightness=`cat /etc/enigma2/settings | grep config.VideoTune.Brightness | cut -d "=" -f 2`
if [ $brightness ]; then
echo $brightness > /proc/stb/video/plane/psi_brightness
else
echo "128" > /proc/stb/video/plane/psi_brightness
fi
contrast=`cat /etc/enigma2/settings | grep config.VideoTune.Contrast | cut -d "=" -f 2`
if [ $contrast ]; then
echo $contrast > /proc/stb/video/plane/psi_contrast
else
echo "128" > /proc/stb/video/plane/psi_contrast
fi
saturation=`cat /etc/enigma2/settings | grep config.VideoTune.Saturation | cut -d "=" -f 2`
if [ $saturation ]; then
echo $saturation > /proc/stb/video/plane/psi_saturation
else
echo "128" > /proc/stb/video/plane/psi_saturation
fi
tint=`cat /etc/enigma2/settings | grep config.VideoTune.Tint | cut -d "=" -f 2`
if [ $tint ]; then
echo $tint > /proc/stb/video/plane/psi_tint
else
echo "128" > /proc/stb/video/plane/psi_tint
fi
}
startPowerLed() {
if [ "$model" = "at7000" ]; then
echo "Set PowerLed"
level=`grep config.PowerLed.Level /etc/enigma2/settings | cut -d "=" -f 2`
if [ "$level" ]; then
fp_control -P "$level"
else
# if no value found set to 15
fp_control -P 15
fi
fi
}
startModule() {
# instead of loading FW in rcS to mount swapstick before loading optional audio.elf
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startModule
fi
loader="/bin/ustslave"
# symlink audio.elf from stick before checking
if [ -e /var/swap/bin/audio.elf ]; then
if [ ! -e /var/bin/audio.elf ]; then
ln -s /var/swap/bin/audio.elf /var/bin/audio.elf
fi
fi
# mme bug workaround
dd if=/dev/
zero of=/dev/st231-0 bs=1024 count=4096
dd if=/dev/
zero of=/dev/st231-1 bs=1024 count=4096
# end mme bug wa
if [ "$oldaudiofw" == 'y' ] && [ -e /var/bin/audio.elf ]; then
echo $CMD ["$INPUT"] load OLD audio firmware
$loader /dev/st231-1 /var/bin/audio.elf
else
echo $CMD ["$INPUT"] load audio firmware
$loader /dev/st231-1 /boot/audio.elf
fi
echo $CMD ["$INPUT"] load video firmware
$loader /dev/st231-0 /boot/video.elf
}
checkPIN() {
if [ "$PinOn" == 'y' ]; then
echo "PIN - Eingabe" > /dev/vfd
if [ $Pin ]; then
w1=`echo $Pin | cut -c1`
w2=`echo $Pin | cut -c2`
w3=`echo $Pin | cut -c3`
w4=`echo $Pin | cut -c4`
pin $w1 $w2 $w3 $w4; ret=$?
else
pin 1 2 3 4; ret=$?
fi
if [ $ret -eq 1 ]; then
echo "ERROR" > /dev/vfd
sync
reboot
else
echo "PIN --> OK" > /dev/vfd
touch /tmp/.pinok
fi
fi
}
startSet_was_timer_wakeup() {
if [ "$model" != "ufs922" ]; then
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startSet_was_timer_wakeup
fi
if [ "$model" = "ipbox9000" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox910" ]; then
set_was_timer_wakeup 90 &
else
set_was_timer_wakeup &
fi
fi
}
startTuner_sleep() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startTuner_sleep
fi
if [ "$tuner_sleep_off" = "y" ]; then
#deaktivate tuner sleep, fix problems on some tuners
echo 0 > /sys/module/dvb_core/parameters/dvb_shutdown_timeout
fi
}
startMakeDevs() {
if [ ! "$debug" = 'off' ]; then
echo $CMD ["$INPUT"] startMakeDevs
fi
cd /dev
echo "$CMD startMakeDevs create bpamem"
/sbin/MAKEDEV bpamem
if [ "$model" = "tf7700" ] || [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ];then
if [ -e /dev/ttyAS1 ]; then
rm -f /dev/ttyAS1
fi
fi
if [ "$model" = "ufs922" ] || [ "$model" = "at7000" ] || [ "$model" = "ipbox910" ] || [ "$model" = "ipbox900" ] || [ "$model" = "ipbox91" ] || [ "$model" = "ipbox9000" ];then
echo "$CMD startMakeDevs create sci0/1"
mknod /dev/sci0 c 253 0
mknod /dev/sci1 c 253 1
echo "$CMD startMakeDevs create ca2"
mknod /dev/dvb/adapter0/ca2 c 212 38
elif [ "$model" = "at7500" ];then
echo "$CMD startMakeDevs create sci0"
mknod /dev/sci0 c 169 0
mknod /dev/sci1 c 169 1
elif [ "$model" = "at700" ];then
echo "$CMD startMakeDevs create sci0"
mknod /dev/sci0 c 169 0
elif [ "$model" = "tf7700" ]; then
mknod -m 0666 /dev/fpc c 62 0 2>/dev/null
mknod -m 0666 /dev/rc c 62 1 2>/dev/null
mknod -m 0666 /dev/fplarge c 62 2 2>/dev/null
mknod -m 0666 /dev/fpsmall c 62 3 2>/dev/null
echo "$CMD startMakeDevs create ca2"
mknod /dev/dvb/adapter0/ca2 c 212 38
# Update the GMT offset after creating the relevant devices
/bin/tffpctl --setgmtoffset
fi
}
if [ "$1" = "first" ] ;then
startMakeDevs
startCpu_frequ
startWorkaround
startSysctl
startFirst
startAutoFS
startLink
#alles vor dieser Zeile sollte im Hintergrund gestartet werden (&)
startBootstop
startLoadpartition
startVolumeMigrate
startNetmodule
startMount
startModule
startBa
startFtdi
elif [ "$1" = "swap" ] ;then
startSwap
startRestore
startFontsize ba
(startNet; startShowinfo) &
startTimefix
startWlan
elif [ "$1" = "enigma2" ] ;then
startTuner_sleep
checkPIN
startRcreboot
startPlugload
startNetmount
/var/emu/camd3.902 /var/keys/camd3.config &
startEmu
startFan
startProfile
startFonts
startCrossepg
startRedbutton
startSetvol
startHaltonerror
startReader
startPl2303
# startFtdi
startVideoTune
startPowerLed
startSet_was_timer_wakeup
elif [ "$1" = "last" ] ;then
startCpu_frequ_stop
sleep 10
startTimefix e2
startFixBootArgs
startRm_first_error
startStickextensions &
startHddicon
startLoadmodules &
startAutodns
startRmplaylist
startSamba &
startNfs
startFirstplugload
elif [ "$1" = "reboot" ] ;then
startGetbootvid
startFontsize reboot
startReboot
startBootdelay
startRmemthy
elif [ "$1" = "recovery" ] ;then
startOnlineupdate
elif [ "$1" = "neutrino" ] ;then
startRcreboot
startNetmount
startEmu
startFonts
startHaltonerror
startReader
startPl2303
startVideoTune
startPowerLed
fi
exit