How to enable Advanced mode startup script


From SamyGO
Jump to: navigation, search

How to enable Advanced mode

This How to will help you enable startup scripts which we call Advanced Mode. With it, you can start your preferred options like Telnet/WiFi/NFS and SAMBA Shares etc... on your TV startup.

Fist of all you need to change rc.local to boot from the writable partition. You can archive this two ways:

  1. Manually Modifying the Firmware. (NEED TO ADD MY HOWTO)
  2. Automated Way - SamyGO Firmware Patcher (with modification).

I can confirm i have tested both methods and it worked on mine. (DO THIS AT YOUR OWN RISK!!!)

Manually Modify Firmware

To modify the firmware manually please see the two guides bellow, currently the Linux guide is not yet complete.

Automated Firmware Update

To use the SamyGO Firmware Patcher to modify your firmware you will benefit from having less chance of bricking your TV. You will also be able to take advantage of the VideoAR fix, and not need all the tools detailed in the Manual Enable Guide.

You will need to do the following:

Download the latest SamyGO Firmware Patcher

Download the latest UNRESTRICTED (preFEB) firmware and extract it. Firmware to download you can find on Old&Good firmware section or search (or ask) on forum. Also old firmwares are available on Samsung Open Source Release Center.
run SamyGo.py against the latest downloaded firmware. *note this needs to be a clean firmware not an already modified one. example:

python ./SamyGO.py ./T-CHU7DEUC/

and select "Advanced mode" instead of Telnet when is requested.

Flash the Modified Firmware

Move the T-CHU7DEUC directory and all of its contents to an USB drive, plugin the USB drive into your TV and manually start the upgrade via the appropriate menu entry on your TV.

Rooting TV

You needed to use TV's bash command line to configure/put your scripts. There is 2 way to archieve such goal.

Telnet Way

Firstly you needed to enable telnet because "Advanced Mode" does not start telnet automatically. So Download SamyGO Telnet Enabler Program extract it to your USB Flash, then plug it to TV. Using the Content Library from Pup-Up menu, select USB, then under Game Menu, select and start SamyGO application once. TV will goes black than returns to menu. This will enable your TV's telnet once. Connect to your TV via telnet. If you use windows, you can use a command prompt or better PuTTY. *nix guys just use a console.

telnet <Your TV's IP depending your configuration>

The default username is root with no password.

Serial Console Way

You can also use ExLink cable to use Enable Serial Console on non CI+ Devices to connect your TV( yeah but not for CI+ devices )

Add Auto Start Scripts

Enable Telnet and Back-Door

This will enable Telnet and also open back-door for fixing boot-loop situations.

You firstly need to create and add info to SamyGO.sh which is what the TV is trying to boot from in rc.local

$ vi /mtd_rwarea/SamyGO.sh

Now add the following:

#!/bin/sh

# Enable Telnetd
mount -t devpts devpts /dev/pts
telnetd
sleep 20

# Open back-door for fixing boot-loop situations
sleep 20       # Allow USB stick to settle
USB="/dtv/usb/sda1"    # USB mount-point

if [ -f $USB/usb.sh ];then
  $USB/usb.sh    # USB-File detected.
else
  if [ -f /mtd_rwarea/mtd_rwarea.sh ];then
	/mtd_rwarea/mtd_rwarea.sh # Run normal startup script
  fi
  if [ -f /mtd_rwarea/mount.sh ];then
     /mtd_rwarea/mount.sh # Run mount script
  fi
  # Alternatives of Samsung WiFi Link Stick
  # You need to download the new mods and place them in /mtd_rwarea/drivers/
  if [ -f /mtd_rwarea/.wifi-rt2870 ];then
	rmmod rt2870sta # Unloading original rt2870sta
	sleep 5
	insmod /mtd_rwarea/drivers/rt2870sta.ko # Loading modified rt2870sta
  fi
  if [ -f /mtd_rwarea/.wifi-rt73 ];then
	rmmod rt73 	# Unloading original rt73
	sleep 5
	insmod /mtd_rwarea/drivers/rt73.ko # Loading modified rt73
  fi
fi

exit

If you don't know how to use vi save it to your usb stick and copy it or edit the file with vi and use ":wq!" without the quotes to exit and save the file.

Now you need to change the permissions on the file

$ chmod 755 /mtd_rwarea/SamyGO.sh

If you do not wish to use auto mounting or anything else you can stop here, just reboot your TV and confirm telnet is enabled. Or carry on to enable mounting.

Enable Mounts

If you wish to use auto mounting NFS/CIFS/SMB you will need to edit /mtd_rwarea/mount.sh

$ vi /mtd_rwarea/mount.sh

Add the following to mount.sh

#!/bin/sh

# If /mtd_rwarea/.nfs Exists then Mount NFS Shares on Virtual USB
# touch /mtd_rwarea/.nfs if you wish to use NFS Shares and mount on a Virtaul USB

if [ -f /mtd_rwarea/.nfs ];then
  echo "Mounting NFS Shares on Virtual USB"

  # Set NFS Settings
  VUSB="/dtv/usb/sda4"    # Your Virtual USB mount-point
  NFSS="10.0.0.10"   # NFS Server

  NFS1="Series"   # NFS Share 1 (Media)
  NFS2="Music"   # NFS Share 2 (Music)
  NFS3="Pictures"   # NFS Share 3 (Pics)
  NFS4="Video"   # NFS Share 4 (Other)

  NFSS1="series"   # NFS Server Share 1 (Media)
  NFSS2="music"   # NFS Server Share 2 (Music)
  NFSS3="pics"   # NFS Server Share 3 (Pics)
  NFSS4="vids"   # NFS Server Share 4 (other)

  # Only Process if NFS Shares are not mounted
  if [ `mount | grep -c $VUSB` == 0 ]; then

     # Create Directory Structure for Virtual USB
     echo "Creating Virtual USB Directory Structure"
     mkdir -p $VUSB
     mkdir -p $VUSB/$NFS1
     mkdir -p $VUSB/$NFS2
     mkdir -p $VUSB/$NFS3
     mkdir -p $VUSB/$NFS4

     echo "Mounting NFS Shares"
     mount -o nolock $NFSS:/$NFSS1 $VUSB/$NFS1 -t nfs
     mount -o nolock $NFSS:/$NFSS2 $VUSB/$NFS2 -t nfs
     mount -o nolock $NFSS:/$NFSS3 $VUSB/$NFS3 -t nfs
     mount -o nolock $NFSS:/$NFSS4 $VUSB/$NFS4 -t nfs
   
     # Append Virtual USB to log file. This Allows you to view the device in media.p
     echo "Appending Virtual USB to log"
echo "[sdd]
Vendor : Linux
Product : Virtual USB
Serial : Q80VQLFL
Devpath : 4
Lun : 0
MountDir : /dtv/usb/sda4
FileSystem : vfat

" >> /dtv/usb/log
  else
     echo "NFS Shares already Mounted"
  fi
fi

if [ -f /mtd_rwarea/.nfs-usb ];then
  echo "Mounting NFS Shares on USB"
  # Allow USB-stick to settle
  sleep 20

  # Set NFS Settings
  VUSB="/dtv/usb/sda1"    # Your Virtual USB mount-point
  NFSS="10.0.0.10"   # NFS Server

  NFS1="Series"   # NFS Share 1 (Media)
  NFS2="Music"   # NFS Share 2 (Music)
  NFS3="Pictures"   # NFS Share 3 (Pics)
  NFS4="Video"   # NFS Share 4 (Other)

  NFSS1="series"   # NFS Server Share 1 (Media)
  NFSS2="music"   # NFS Server Share 2 (Music)
  NFSS3="pics"   # NFS Server Share 3 (Pics)
  NFSS4="vids"   # NFS Server Share 4 (other)

  # Only Process if NFS Shares are not mounted
  if [ `mount | grep -c $VUSB` == 0 ]; then

     # Create Directory Structure for Virtual USB
     echo "Creating Virtual USB Directory Structure"
     mkdir -p $VUSB
     mkdir -p $VUSB/$NFS1
     mkdir -p $VUSB/$NFS2
     mkdir -p $VUSB/$NFS3
     mkdir -p $VUSB/$NFS4

     echo "Mounting NFS Shares"
     mount -o nolock $NFSS:/$NFSS1 $VUSB/$NFS1 -t nfs
     mount -o nolock $NFSS:/$NFSS2 $VUSB/$NFS2 -t nfs
     mount -o nolock $NFSS:/$NFSS3 $VUSB/$NFS3 -t nfs
     mount -o nolock $NFSS:/$NFSS4 $VUSB/$NFS4 -t nfs
  elsethe two files
     echo "NFS Shares already Mounted"
  fi
fi

if [ -f /mtd_rwarea/.nfs_unmount ];then
  echo "Unmounted NFS Shares"
  umount $VUSB/$NFS1
  umount $VUSB/$NFS2
  umount $VUSB/$NFS3
  umount $VUSB/$NFS4
  rm -Rf /dtv/usb/sda4
  rm -Rf /mtd_rwarea/.nfs_unmount
fi

You will need to edit the "# Set NFS Settings" section and also decide if you wish to use a virtual USB stick to mount your shares on or not. I do not see the point in keeping a USB stick in just for mount points hence the mounting to a virtual disk. On some TV's this does not work, however, so then you will be forced to use a real USB stick.

Now you need to change the permissions on the file

$ chmod 755 /mtd_rwarea/mount.sh

If you are going to use the NFS mounting you need to touch /mtd_rwarea/.nfs-usb (ADD SMB AND CIFS)

$ touch /mtd_rwarea/.nfs-usb 

Reboot the TV and watch the magic :)

$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/tbml6                3.1M      3.1M         0 100% /
none                     10.0M     12.0k     10.0M   0% /dtv
/dev/tbml7              896.0k    896.0k         0 100% /mtd_boot
none                     10.0M         0     10.0M   0% /mtd_ram
/dev/stl0/13             11.0M      5.6M      5.3M  52% /mtd_rwarea
/dev/tbml10              60.0M     51.2M      8.8M  85% /mtd_exe
/dev/tbml11              28.6M     28.6M         0 100% /mtd_appdata
/dev/stl0/12            419.0M    383.8M     35.2M  92% /mtd_tlib
/dev/stl1/2              50.0M      2.9M     47.0M   6% /mtd_contents
/dev/stl0/14            118.9M      9.5M    109.4M   8% /mtd_down
/dev/stl1/3             876.9M    224.0k    876.7M   0% /mtd_wiselink
/dev/stl0/15             87.0M     51.4M     35.6M  59% /mtd_swu
/dev/sda1               979.1M     85.6M    893.5M   9% /dtv/usb/sda1
10.0.0.10:/series         7.2T    329.3G      6.8T   4% /dtv/usb/sda4/Series
10.0.0.10:/music          7.2T    329.3G      6.8T   4% /dtv/usb/sda4/Music
10.0.0.10:/pics           7.2T    329.3G      6.8T   4% /dtv/usb/sda4/Pictures
10.0.0.10:/vids           7.2T    329.3G      6.8T   4% /dtv/usb/sda4/Video


Other Info

Just some additional information that you might want to consider.

WiFi

To get wifi working on other wifi dongles please take a look at: Alternatives of Samsung WiFi Link Stick

Download the relevant module place it in /mtd_rwarea/drivers/ you will need to create the relevant file to allow it to auto start on boot.

$ touch /mtd_rwarea/.wifi-rt2870
$ touch /mtd_rwarea/.wifi-rt73

BusyBox

Only use this if you know what you are doing. Some of us cannot use the static BusyBox but the linux geeks out there need a better one.

Extract BusyBox and place just the busybox binary in /mtd_rwarea/bin/


Thanks to dynamic1969 for all his help, erdem_ua for SamyGo.py

Original page created by Sulph8 and converted to Advanced Mode scripts by erdem_ua