Page 1 of 2

A first test port of SamyGO to E-Series

Posted: Sun Nov 25, 2012 10:51 am
by mamaich
Here is a first attempt to port SamyGO to E-Series TV. Hack is done via widget. Tested on my UE32ES6727, should work on other models based on T-MST10PDEUC, and may work on different models with ARM CPU too.

Installation:
1. Download: SamyGO_ES_mstar_unfinished.zip, (alternative download)
2. Setup the apache server (or the full development environment) on your PC, and copy the contents htdocs_on_apache_server directory to your htdocs dir on TV. Don't forget to edit widgetlist.xml and change the IP address there.
3. Setup developer account on TV and download widget from your apache server
4. Copy contents of USB_disk directory to your fat-formatted USB disk (NTFS may work too, but not checked)
5. Insert USB disk into TV, run the SamyGO widget
6. If you'll see the "success" message - you'll have a working telnet and FTP on your TV with root access
7. Connect via telnet to TV and type "sh -x /mnt/rcSGO" - this would run SamyGO.
I've intentionally left a manual launch of SamyGo script, as SamyGO is untested and most things are probably broken.
You may add the "sh -x /mnt/rcSGO &" line to the end of "/mnt/bin/runonce.sh" script - and rcSGO would be automatically run by the widget (edit the file via FTP and don't forget to run "chmod" on it and "sync" before rebooting TV).

SamyGO currently cannot be installed to be run automatically on TV start, so each time you'll need to launch the widget. Autostart can be done in the future - but not by me, I'll be busy with other stuff.
Archive does not contain all .KO kernel modules I have. You may take the compiled modules here: modules-mstar-0064.zip, (alternative download)
The only thing that I've checked in SamyGO - http://ip_address_of_tv:1080 outputs the phpinfo(). I have not tested NFS or samba mounts as I don't use them.

As we don't have devpts device in TV - telnet daemons from busybox are not working. Archive contains my own telnetd implementation (samygo_telnetd), it is capable of running interactive shell, you may run MC, but input capabilities are limited.

Some internals.
Hacking is done as described here: viewtopic.php?f=53&t=5015
SamyGO files are contained in file SamyGO\128mb.xfs on USB disk. Why this is done - described here: viewtopic.php?f=48&t=5019

Note:
I would not continue working on this SamyGO distribution as I don't use it at all. Publishing my work here so that someone may continue the work. I'm currently busy with other stuff.

Re: A first test port of SamyGO to E-Series

Posted: Sun Nov 25, 2012 3:43 pm
by hades
On 7th step:
SpoilerShow
Image
moded telnet and ftp working fine, but not lighttpd and phpinfo() on _IP_:1080

go.log
SpoilerShow
+ ln -s /dev/loop3 /tmp/loopnone
+ sync
+ /tmp/bin/busybox losetup /tmp/loopnone /dtv/usb/sda1/SamyGO/128mb.xfs
+ /tmp/bin/busybox mount -o sync,exec /tmp/loopnone /mnt
+ sleep 1+ /mnt/bin/runonce.sh
+ sync
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/sunrpc.ko': No such file or directory
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/lockd.ko': No such file or directory
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/cifs.ko': No such file or directory
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/fuse.ko': No such file or directory
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/isofs.ko': No such file or directory
insmod: can't read '/mnt/lib/modules/64/2.6.35.13/nfs.ko': No such file or directory
tcpsvd: listening on 0.0.0.0:21, starting
Starting simple telnet server
Socket created
bind done
Waiting for incoming connections...
[EmpMain::EmpMain(60)] <<< EmpMain start >>>
[EmpMain::EmpMain(65)] [1;31;42m 3 != argc[0m
Connection accepted
running shell
IO thread started
Error reading
shell exited
Connection accepted
running shell
IO thread started
tcpsvd: start 1286 192.168.1.45:21-192.168.1.25:58810
tcpsvd: status 1/30
tcpsvd: end 1286 exit 1
tcpsvd: status 0/30
tcpsvd: start 1293 192.168.1.45:21-192.168.1.25:59094
tcpsvd: status 1/30

Code: Select all

exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
or

Code: Select all

exec setsid sh -c 'exec sh </dev/ttyS0 >/dev/ttyS0 2>&1'
as described in BusyBox FAQ doesn't work. Any suggestions?

Re: A first test port of SamyGO to E-Series

Posted: Wed Nov 28, 2012 11:02 am
by tuxons
On UE40ES8007 before start widget in console write Error: can't find samygo.log!!!

Re: A first test port of SamyGO to E-Series

Posted: Wed Nov 28, 2012 11:12 am
by juusso
Seems, not only you - on all reports from T-ECPDEUC models this error exists. Waiting for mamaich comment...

Re: A first test port of SamyGO to E-Series

Posted: Fri Nov 30, 2012 3:12 am
by E3V3A
mamaich wrote:...Archive does not contain all .KO kernel modules I have. You may take the compiled modules here...
It would be useful if you could tell us what firmware you're using, and if these modules have been modified or compiled outside of Samsung FW??
...As we don't have devpts device in TV - telnet daemons from busybox are not working. Archive contains my own telnetd implementation (samygo_telnetd), it is capable of running interactive shell, you may run MC, but input capabilities are limited...
What would be required to implement this?
... Publishing my work here so that someone may continue the work. I'm currently busy with other stuff.
We'd be happy to continue your work, but I think we'd need some more input from you. About how it works and what need to be done/changed.

Re: A first test port of SamyGO to E-Series

Posted: Fri Nov 30, 2012 8:35 am
by juusso
I can answer to some of your questions.
yes, modules are cross-compiled, because all required sources and ready-to-use toolchain is available on opensource.samsung.com. You just need proper kernel config and environment.

To implement full telnet, you have recompile kernel, change rootfs (add missing binaries and so on), calculate hashes and flash all this shtuff to tv. You also probably need to change boot-up scripts to let your service running.

Yes, we woul`d be happy to get more info from devel too, but what he already posted is quite enough to make work further. What do we have: the root access, doesnt matter it is not true shell and has limitations, we have compiled modules, we even have full SamyGO framework adapted to ES series.

The question "what is needed" is not correct. You tell what is still missing (sure you have to test it first) and if you have proper skills for developing, try to add those/these missing features. I agree not everything here is well documented, you have to order info by peaces in forum/wiki. Situation could be others, but no human resources who is willing to make this hard job, we are just hobbyists here... Any help is much appreciated :)

Re: A first test port of SamyGO to E-Series

Posted: Fri Nov 30, 2012 4:50 pm
by E3V3A
tuxons wrote:On UE40ES8007 before start widget in console write Error: can't find samygo.log!!!
Would it have something to do with this?
run.sh:

Code: Select all

...
/bin/sh -x /tmp/bin/go.sh >$USBDIR/SamyGO/go.log 2>&1
...
Perhaps we should replace "go.log" with "samygo.log"?

Re: A first test port of SamyGO to E-Series

Posted: Fri Nov 30, 2012 6:30 pm
by arris69
mamaich wrote:Here is a first attempt to port SamyGO to E-Series TV. Hack is done via widget. Tested on my UE32ES6727, should work on other models based on T-MST10PDEUC, and may work on different models with ARM CPU too.

...
1. all binaries are hier: http://sourceforge.net/projects/samygo/ ... RM%20CPUs/ (since 2012-09-06)
2. package with kernel modules for different ECP and MST10 firmwares (samsung changed modules version string 2x) are also avail, developer just need to ask...
3. latest version of init scripts: http://samygo.svn.sourceforge.net/viewv ... xtensions/ or on the new location: http://sourceforge.net/p/samygo/code/12 ... xtensions/

hth
arris

Re: A first test port of SamyGO to E-Series

Posted: Fri Nov 30, 2012 9:17 pm
by juusso
E3V3A wrote: Perhaps we should replace "go.log" with "samygo.log"?
where it comes from:

Code: Select all

function Func2()
{
	var FilePlugin = document.getElementById("pluginObjectFile");
    var Ok=0;
    eval("Ok=FilePlugin.IsExistedPath('" + usb + "/SamyGO/go.log')"); <==================== 
 
    if(Ok==1)
    	Log("\r\nSuccess!");
    else
    	Log("\r\nError: can't find samygo.log!!!");
    Log("------------------------------------");
    Log("Press any key or wait 5 seconds to exit...");
    setTimeout(widgetAPI.sendReturnEvent,5000);
} 
and:

Code: Select all

eval("FilePlugin.Delete('" + usb + "/SamyGO/go.log')");
To get rid out this error, is enough to comment out the row(s) above - doesnt matter if the log file is deleted or not, isnt? :)
Or just create empty USB/SamyGO/go.log if wont edit widget`s code.

Re: A first test port of SamyGO to E-Series

Posted: Mon Dec 03, 2012 2:24 am
by mamaich
juuso wrote:To get rid out this error, is enough to comment out the row(s) above - doesnt matter if the log file is deleted or not, isnt? :)
Or just create empty USB/SamyGO/go.log if wont edit widget`s code.
SamyGO/go.log is created on successful hack. So this error means that the hack was unsuccessful, so creating the file would give you nothing.

There are 2 reasons for this:
- there is no camera EMP on your TV (but I think that there should be a different error in this case)
- /dtv is not on LD_LIBRARY_PATH on your TV

Solution for the first one - just manually launch web browser, skype or any other widget that uses libm.so. Widget would hang, but telnet would be active.
Solution for the second one - search for a different directory in LD_LIBRARY_PATH that is writable and is tmpfs (i.e. cleaned on every reboot). If you'ld place libm.so into a persistent dir - you'll definitely block your device from booting, so be careful here. Or use a different rooting method - the easiest one would be replacing one of the system emps with our own one, not all of them are digitally signed. I'd recommend replacing the libFamilyStory.so - so your hack can be run by pressing the corresponding button on the remote. I would not do that myself as I'm busy now in a real life.
It would be useful if you could tell us what firmware you're using, and if these modules have been modified or compiled outside of Samsung FW??
Obviously I'm using the samsung sources and toolchain from opensource.samsung.com. There is a minor bug in their sources - one of the version headers (I don't remember its name) contains 0062 version, while TV requires 0064 version for compiled modules. Just edit this header in sources - and modules would be loaded fine.

Regarding devpts. It can be built as an external module, but it would not work - it requires PTY support in kernel that is absent. It would require lots of time to hack PTY sources to make them as a loadable KO, and I don't think that anyone would be willing to waste his time for that.