Changeset 43283


Ignore:
Timestamp:
01/23/19 19:45:14 (5 years ago)
Author:
obi
Message:

update titan.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/oealliance/usr/bin/titan.sh

    r43262 r43283  
    1 if [ -L /mnt ];then
    2         rm -f /mnt
    3 fi
    4 
    5 if [ -e /var/etc/.erasemtd ] || [ ! -e /mnt/swapextensions ]; then
    6         if [ -e /media/hdd/backup/.oebuildbackup ];then
    7                 BACKUPDIR=$(cat /media/hdd/backup/.oebuildbackup)
    8                 cp -a $BACKUPDIR /mnt
    9                 mv -f /media/hdd/backup/.oebuildbackup /media/hdd/backup/.oebuildbackup.restored
    10         else
    11                 infobox -pos -1 75% 10015 "MNT" "            Formatiere Laufwerk            " &
    12                 if [ -e /mnt ];then
    13                         echo "remove mnt files"
    14                         rm -rf /mnt
    15                 fi
    16                 cp -a /etc/titan.restore/mnt /
    17                 mkdir /mnt/swapextensions
    18                 mkdir /mnt/bin
    19                 mkdir /mnt/tpk
    20                 sleep 10
    21                 rm -r /var/etc/.erasemtd
    22                 rm -r /var/etc/.backupmtd
    23 
    24                 #ubifs needs sync
    25                 sync
    26 
    27                 #startMicomUpdate
    28 
    29         #       killall infobox
    30         #       infobox 9999 INFO "Initializing MNT" "" "you can power off the receiver now,"  "in case it does not reboot" &
    31         #       sleep 2
    32                 reboot
    33         fi
    34 fi
    35 
    36 date
    37 echo npdate
    38 ntpdate -b ptbtime1.ptb.de &
    39 #sleep 5
    40 
    41 echo "####################################"
    42 date
    43 echo "####################################"
    44 
    45 if [ -e /proc/stb/info/boxtype ]; then
    46         stbcheck=`cat /proc/stb/info/boxtype`
    47         if [ $stbcheck == "sf8008" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ]; then
    48                 count=`ps -ef |grep libreader |grep -v "grep" |wc -l`
    49                 if [ 0 == $count ];then
    50                         libreader 720P_50
    51                 fi
    52         fi
    53 fi
    54 
    55 if [ -x /usr/bin/showiframe ]; then
     1startmnt()
     2{
     3        if [ -L /mnt ];then
     4                rm -f /mnt
     5        fi
     6
     7        if [ -e /var/etc/.erasemtd ] || [ ! -e /mnt/swapextensions ]; then
     8                if [ -e /media/hdd/backup/.oebuildbackup ];then
     9                        BACKUPDIR=$(cat /media/hdd/backup/.oebuildbackup)
     10                        cp -a $BACKUPDIR /mnt
     11                        mv -f /media/hdd/backup/.oebuildbackup /media/hdd/backup/.oebuildbackup.restored
     12                else
     13                        infobox -pos -1 75% 10015 "MNT" "            Formatiere Laufwerk            " &
     14                        if [ -e /mnt ];then
     15                                echo "remove mnt files"
     16                                rm -rf /mnt
     17                        fi
     18                        cp -a /etc/titan.restore/mnt /
     19                        mkdir /mnt/swapextensions
     20                        mkdir /mnt/bin
     21                        mkdir /mnt/tpk
     22                        sleep 10
     23                        rm -r /var/etc/.erasemtd
     24                        rm -r /var/etc/.backupmtd
     25
     26                        #ubifs needs sync
     27                        sync
     28
     29                        #startMicomUpdate
     30
     31                #       killall infobox
     32                #       infobox 9999 INFO "Initializing MNT" "" "you can power off the receiver now,"  "in case it does not reboot" &
     33                #       sleep 2
     34                        reboot
     35                fi
     36        fi
     37}
     38
     39checkopkg()
     40{
     41        if [ $(cat /etc/opkg/opkg.conf | grep "dest / /" | wc -l) -eq 0 ];then
     42                echo "dest / /" >> /etc/opkg/opkg.conf
     43        fi
     44        if [ $(cat /etc/opkg/opkg.conf | grep "dest /mnt/swapextensions /mnt/swapextensions" | wc -l) -eq 0 ];then
     45                echo "dest /mnt/swapextensions /mnt/swapextensions" >> /etc/opkg/opkg.conf
     46        fi
     47        if [ $(cat /etc/opkg/opkg.conf | grep "dest /var/swap /var/swap" | wc -l) -eq 0 ];then
     48                echo "dest /var/swap /var/swap" >> /etc/opkg/opkg.conf
     49        fi
     50}
     51
     52checklibs()
     53{
     54        #check for sundtek tuner helper lib
     55        if [ -e /opt/lib/libmediaclient.so ]; then
     56                LIBS="/opt/lib/libmediaclient.so /usr/lib/libopen.so.0.0.0"
     57        elif [ -e /usr/lib/libopen.so.0.0.0 ]; then
     58                LIBS="/usr/lib/libopen.so.0.0.0"
     59        fi
     60
     61        #check for specific pagecache helper lib
     62        if [ -e /usr/lib/libpagecache.so ]; then
     63                LIBS="$LIBS /usr/lib/libpagecache.so"
     64        fi
     65
     66        #check for receiver specific passthrough helper lib
     67        if [ -e /usr/lib/libpassthrough.so ]; then
     68                LIBS="$LIBS /usr/lib/libpassthrough.so"
     69        fi
     70
     71        # in case sysctl.conf is not properly loaded - load sysctl.conf here again...
     72        sysctl -p
     73
     74        if [ -e /usr/lib/libssl.so.1.0.2 ] && [ ! -e /usr/lib/libssl.so.1.0.0 ];then
     75                echo "create symlink /usr/lib/libssl.so.1.0.2 -> /usr/lib/libssl.so.1.0.0"
     76                ln -s /usr/lib/libssl.so.1.0.2 /usr/lib/libssl.so.1.0.0
     77        fi
     78
     79}
     80
     81setdate()
     82{
     83        date
     84        echo npdate
     85        ntpdate -b ptbtime1.ptb.de &
     86        echo "####################################"
     87        date
     88        echo "####################################"
     89}
     90
     91startbootlogo()
     92{
    5693        if [ -e /proc/stb/info/boxtype ]; then
    57                 stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2`
    58                 if [ ! $stbcheck == "u5" ]; then
     94                stbcheck=`cat /proc/stb/info/boxtype`
     95                if [ $stbcheck == "sf8008" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ]; then
     96                        count=`ps -ef |grep libreader |grep -v "grep" |wc -l`
     97                        if [ 0 == $count ];then
     98                                libreader 720P_50
     99                        fi
     100                fi
     101        fi
     102
     103        if [ -x /usr/bin/showiframe ]; then
     104                if [ -e /proc/stb/info/boxtype ]; then
     105                        stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2`
     106                        if [ ! $stbcheck == "u5" ]; then
     107                                killall -9 showiframe; sleep 1
     108                        fi
     109                else
    59110                        killall -9 showiframe; sleep 1
    60111                fi
    61         else
    62                 killall -9 showiframe; sleep 1
    63         fi
    64         if [ -f /etc/enigma2/backdrop.mvi ]; then
    65                 /usr/bin/showiframe /etc/enigma2/backdrop.mvi
    66         elif [ -f /usr/share/backdrop.mvi ]; then
    67                 /usr/bin/showiframe /usr/share/backdrop.mvi
    68         fi
    69 fi
    70 
    71 if [ -d /home/root ]; then
    72         cd /home/root
    73         export HOME=/home/root
    74 fi
    75 
    76 #check for sundtek tuner helper lib
    77 if [ -e /opt/lib/libmediaclient.so ]; then
    78         LIBS="/opt/lib/libmediaclient.so /usr/lib/libopen.so.0.0.0"
    79 elif [ -e /usr/lib/libopen.so.0.0.0 ]; then
    80         LIBS="/usr/lib/libopen.so.0.0.0"
    81 fi
    82 
    83 #check for specific pagecache helper lib
    84 if [ -e /usr/lib/libpagecache.so ]; then
    85         LIBS="$LIBS /usr/lib/libpagecache.so"
    86 fi
    87 
    88 #check for receiver specific passthrough helper lib
    89 if [ -e /usr/lib/libpassthrough.so ]; then
    90         LIBS="$LIBS /usr/lib/libpassthrough.so"
    91 fi
    92 
    93 # in case sysctl.conf is not properly loaded - load sysctl.conf here again...
    94 sysctl -p
    95 
    96 if [ -e /usr/lib/libssl.so.1.0.2 ] && [ ! -e /usr/lib/libssl.so.1.0.0 ];then
    97         echo "create symlink /usr/lib/libssl.so.1.0.2 -> /usr/lib/libssl.so.1.0.0"
    98         ln -s /usr/lib/libssl.so.1.0.2 /usr/lib/libssl.so.1.0.0
    99 fi
    100 
    101 LD_PRELOAD=$LIBS /usr/local/bin/titan /mnt/config/titan.cfg
    102 
    103 # enigma2 exit codes:
    104 #
    105 # 1 - halt
    106 # 2 - reboot
    107 # 3 - restart enigma
    108 #
    109 # >128 signal
    110 
    111 ret=$?
    112 
    113 if [ "$ret" -ne "1" ]; then
    114         if [ -e /proc/stb/info/boxtype ]; then
    115                 stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2`
    116                 if [ $stbcheck == "u5" ]; then
    117                         killall -9 showiframe; sleep 5
    118                 fi
    119                 stbcheck=`cat /proc/stb/info/boxtype`
    120                 if [ $stbcheck == "sf8008" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ] ; then
    121                         killall -9 libreader; sleep 5
    122                 fi
    123         fi
    124 fi
    125 
    126 case $ret in
    127         1)
    128                 /sbin/halt
    129                 ;;
    130         2)
    131                 if [ -f /proc/stb/fp/force_restart ]; then
    132                         echo 1 > /proc/stb/fp/force_restart
    133                 fi
    134                 /sbin/reboot
    135                 ;;
    136         3)
    137                 rm -fR /home/root/.gstreamer-0.10
    138                 rm -f /tmp/.listen.camd.socket.ignore
    139                 ;;
    140         4)
    141                 /sbin/rmmod lcd
    142                 /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log
    143                 sleep 1;
    144                 /sbin/rmmod fp
    145                 /sbin/modprobe fp
    146                 /sbin/reboot
    147                 ;;
    148         16)
    149                 echo "rescue" > /proc/stb/fp/boot_mode
    150                 /sbin/reboot
    151                 ;;
    152         42)
    153                 python /usr/lib/enigma2/python/upgrade.pyo
    154                 ;;
    155         43)
    156                 init 1
    157                 ;;
    158         44)
    159                 # little hack but it will be fixed soon in drivers
    160                 /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/bin/fbclear
    161                 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/wait.mvi
    162                 echo fpupload >/proc/vfd && sleep 3 && dd bs=256k if=/tmp/micom.bin of=/dev/mcu
    163                 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/reboot.mvi
    164                 # Wait forever for the user to power off
    165                 while(true) ; do sleep 60 ; done
    166                 ;;
    167         45)
    168                 echo "    " > /dev/lcd0
    169                 /usr/bin/gigablue_wol
    170                 ;;
    171         *)
    172                 rm -f /tmp/.listen.camd.socket.ignore
    173                 ;;
    174 esac
     112                if [ -f /etc/enigma2/backdrop.mvi ]; then
     113                        /usr/bin/showiframe /etc/enigma2/backdrop.mvi
     114                elif [ -f /usr/share/backdrop.mvi ]; then
     115                        /usr/bin/showiframe /usr/share/backdrop.mvi
     116                fi
     117        fi
     118}
     119
     120startsethomedir()
     121{
     122        if [ -d /home/root ]; then
     123                cd /home/root
     124                export HOME=/home/root
     125        fi
     126}
     127
     128startgui()
     129{
     130        LD_PRELOAD=$LIBS /usr/local/bin/titan /mnt/config/titan.cfg
     131
     132        # titan exit codes:
     133        #
     134        # 1 - halt
     135        # 2 - reboot
     136        # 3 - restart enigma
     137        #
     138        # >128 signal
     139
     140        ret=$?
     141
     142        if [ "$ret" -ne "1" ]; then
     143                if [ -e /proc/stb/info/boxtype ]; then
     144                        stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2`
     145                        if [ $stbcheck == "u5" ]; then
     146                                killall -9 showiframe; sleep 5
     147                        fi
     148                        stbcheck=`cat /proc/stb/info/boxtype`
     149                        if [ $stbcheck == "sf8008" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ] ; then
     150                                killall -9 libreader; sleep 5
     151                        fi
     152                fi
     153        fi
     154
     155        case $ret in
     156                1)
     157                        /sbin/halt
     158                        ;;
     159                2)
     160                        if [ -f /proc/stb/fp/force_restart ]; then
     161                                echo 1 > /proc/stb/fp/force_restart
     162                        fi
     163                        /sbin/reboot
     164                        ;;
     165                3)
     166                        rm -fR /home/root/.gstreamer-0.10
     167                        rm -f /tmp/.listen.camd.socket.ignore
     168                        ;;
     169                4)
     170                        /sbin/rmmod lcd
     171                        /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log
     172                        sleep 1;
     173                        /sbin/rmmod fp
     174                        /sbin/modprobe fp
     175                        /sbin/reboot
     176                        ;;
     177                16)
     178                        echo "rescue" > /proc/stb/fp/boot_mode
     179                        /sbin/reboot
     180                        ;;
     181                42)
     182                        python /usr/lib/enigma2/python/upgrade.pyo
     183                        ;;
     184                43)
     185                        init 1
     186                        ;;
     187                44)
     188                        # little hack but it will be fixed soon in drivers
     189                        /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/bin/fbclear
     190                        /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/wait.mvi
     191                        echo fpupload >/proc/vfd && sleep 3 && dd bs=256k if=/tmp/micom.bin of=/dev/mcu
     192                        /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/reboot.mvi
     193                        # Wait forever for the user to power off
     194                        while(true) ; do sleep 60 ; done
     195                        ;;
     196                45)
     197                        echo "    " > /dev/lcd0
     198                        /usr/bin/gigablue_wol
     199                        ;;
     200                *)
     201                        rm -f /tmp/.listen.camd.socket.ignore
     202                        ;;
     203        esac
     204}
     205
     206startmountmnt
     207startopkg
     208startsetdate
     209startbootlogo
     210startchecklibs
     211startsethomedir
     212startgui
Note: See TracChangeset for help on using the changeset viewer.