/mtd_boot/usb file ?

Here is information about customize your B series firmware..:!:This forum is NOT FOR USER questions or problems but DEVELOPER.
Post Reply

User avatar
juusso
SamyGO Moderator
Posts: 9972
Joined: Sun Mar 07, 2010 6:20 pm

Re: /mtd_boot/usb file ?

Post by juusso » Mon Mar 21, 2011 9:15 am

Code: Select all

#!/bin/sh

if [ ! -d /proc/bus/usb ] ; then
        if [ -f /mtd_boot/modules/usb-storage.ko ]; then
                echo "Boot USB Driver Upload ..."
                insmod -f /mtd_boot/modules/usbcore.ko
                insmod -f /mtd_boot/modules/ohci-hcd.ko
                insmod -f /mtd_boot/modules/ehci-hcd.ko
                insmod -f /mtd_boot/modules/usb-storage.ko
        fi

        lsmod > /dtv/ls_tmp
        find_usb_mod=`sed -n '/usb_storage/p' /dtv/ls_tmp`
        if [ -n "$find_usb_mod" ]; then
                echo "USB module is already inserted"
        else
                echo "USB module in RFS will be inserted"
                insmod -f $BOOT_RFS/usbcore.ko
                insmod -f $BOOT_RFS/ohci-hcd.ko
                insmod -f $BOOT_RFS/ehci-hcd.ko
                insmod -f $BOOT_RFS/usb-storage.ko
                lsmod > /dtv/ls_tmp
                find_usb_mod=`sed -n '/usb_storage/p' /dtv/ls_tmp`

                if [ -n "$find_usb_mod" ]; then
                        echo "USB module in RFS is inserted"
                else
                        #shutdown. can not use usb module
                        echo "no usb module is inserted"

                        $BOOT_RFS/MicomCtrl 18
                        $BOOT_RFS/MicomCtrl 18
                        $BOOT_RFS/MicomCtrl 18
                        $BOOT_RFS/MicomCtrl 18
                        $BOOT_RFS/MicomCtrl 18
                fi
        fi

        $BOOT_MOUNT/MicomCtrl 23
        $BOOT_MOUNT/MicomCtrl 23
        $BOOT_MOUNT/MicomCtrl 23
        $BOOT_MOUNT/MicomCtrl 23
        $BOOT_MOUNT/MicomCtrl 23

        rm -f /dtv/ls_tmp

        echo "USB detection time: 1-12 sec."
        x=0
        while [ $x -lt 12 ]
        do
        #x=`expr $x + 1`
        x=$(($x + 1))
        sleep 1

        if [ -d /dtv/usb/sda ]; then
                MOUNT_DIR=sda
                break
        elif [ -d /dtv/usb/sda1 ]; then
                MOUNT_DIR=sda1
                break
        elif [ -d /dtv/usb/sda2 ]; then
                MOUNT_DIR=sda2
                break
        elif [ -d /dtv/usb/sda3 ]; then
                MOUNT_DIR=sda3
                break
        elif [ $x -eq 12 ]; then
                MOUNT_DIR=sda
                echo "default path - /dtv/usb/sda"
                break
        fi

        echo $x
        done
        echo "sda path : [$MOUNT_DIR]"
        mount -t usbfs none /proc/bus/usb

else
        echo "USB Driver already Uploaded..."

        echo "USB detection time: 1-12 sec."
        x=0
        while [ $x -lt 12 ]
        do
        #x=`expr $x + 1`
        x=$(($x + 1))
        sleep 1

        if [ -d /dtv/usb/sda ]; then
                MOUNT_DIR=sda
                break
        elif [ -d /dtv/usb/sda1 ]; then
                MOUNT_DIR=sda1
                break
        elif [ -d /dtv/usb/sda2 ]; then
                MOUNT_DIR=sda2
                break
        elif [ -d /dtv/usb/sda3 ]; then
                MOUNT_DIR=sda3
                break
        elif [ $x -eq 12 ]; then
                MOUNT_DIR=sda
                echo "default path - /dtv/usb/sda"
                break
        fi

        echo $x
        done
        echo "sda path : [$MOUNT_DIR]"
fi

sleep 1

PROJECT_TAG=`cat /.info`
if [ -e /dtv/usb/$MOUNT_DIR/$PROJECT_TAG/run.sh ]; then
        echo "USB DownLoad Start(PRJ) !!"
        chmod +x /dtv/usb/$MOUNT_DIR/$PROJECT_TAG/run.sh
        . /dtv/usb/$MOUNT_DIR/$PROJECT_TAG/run.sh

elif [ -e /dtv/usb/$MOUNT_DIR/run.sh ]; then
        echo "USB DownLoad Start(ROOT) !!"
        chmod +x /dtv/usb/$MOUNT_DIR/run.sh
        . /dtv/usb/$MOUNT_DIR/run.sh

elif [ -e /dtv/usb/$MOUNT_DIR/$PROJECT_TAG/run.sh.enc ]; then
        echo "USB DownLoad Start(PRJ,ENC) !!"
        /dtv/usb/$MOUNT_DIR/$PROJECT_TAG/ddcmp -e $PROJECT_TAG -i /dtv/usb/$MOUN                                                             T_DIR/$PROJECT_TAG/run.sh.enc -o /dtv/run.sh
        chmod +x /dtv/run.sh
        . /dtv/run.sh

elif [ -e /dtv/usb/$MOUNT_DIR/run.sh.enc ]; then
        echo "USB DownLoad Start(ROOT,ENC) !!"
        /dtv/usb/$MOUNT_DIR/ddcmp -e $PROJECT_TAG -i /dtv/usb/$MOUNT_DIR/run.sh.                                                             enc -o /dtv/run.sh
        chmod +x /dtv/run.sh
        . /dtv/run.sh

else
        echo "No USB is found...Shutdown"
        umount /dtv/usb/$MOUNT_DIR

        $BOOT_MOUNT/MicomCtrl 22
        $BOOT_MOUNT/MicomCtrl 22
        $BOOT_MOUNT/MicomCtrl 22
        $BOOT_MOUNT/MicomCtrl 22
        $BOOT_MOUNT/MicomCtrl 22

        $BOOT_MOUNT/MicomCtrl 18
        $BOOT_MOUNT/MicomCtrl 18
        $BOOT_MOUNT/MicomCtrl 18
        $BOOT_MOUNT/MicomCtrl 18
        $BOOT_MOUNT/MicomCtrl 18
        exit 1

fi

exit 1
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. Imagerooting K seriesImage, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

Post Reply

Return to “[B] Firmware”