[App] libRunWidget D/E/F/H

Here are software that related with Samsung F series TVs.
Please don't create any new topic here unless you have software to post/release.

zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libRunWidget D/E/F/H

Post by zoelechat »

Add this line just before injection:

Code: Select all

[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
If I understood correctly :)
I do NOT receive any PM. Please use forum.
smart_lover
SamyGO Project Donor
Posts: 161
Joined: Sun May 03, 2015 6:11 am

Re: [App] libRunWidget D/E/F/H

Post by smart_lover »

zoelechat wrote:Add this line just before injection:

Code: Select all

[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
If I understood correctly :)
As always It works like a charm.Thank you so much.
smart_lover
SamyGO Project Donor
Posts: 161
Joined: Sun May 03, 2015 6:11 am

Re: [App] libRunWidget D/E/F/H

Post by smart_lover »

zoelechat wrote:Add this line just before injection:

Code: Select all

[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
If I understood correctly :)
I use following script as init script with this name:99_99_RunWidget.init

Code: Select all

. /dtv/SGO.env

OPTIONS=""

SODIR=$SYSROOT/opt/privateer/usr/libso			# D/E only, on F/H environment LIBSO_DIR is used
SAMYGOSODIR=/mnt/opt/privateer/usr/bin


stop_bootloop()
{
	for USB in /dtv/usb/sd* ; do
		echo "checking $USB"
		[ -e $USB/STOP ] && echo "STOP found. Script exit..." && exit 1
	done
}

case $1 in 
	start)
	stop_bootloop
	[ "$LIBSO_DIR" ] && SODIR=$LIBSO_DIR
	if [ -d /mtd_rwcommon/widgets/user/MyWidget ] ; then
	  samyGOso -A -B -l $SODIR/libRunWidget.so ID:MyWidget
	else
	  $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so SYSTEM:"Installing..."
	  cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user
	  $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so SYSTEM:"Rebooting..."
	  sleep 6
      micom reboot
	fi
	;;
	stop)
	;;
	status)
	[ -f /dtv/RunWidget.log ] && cat /dtv/RunWidget.log || echo "Not started"
	;;
	*)
	echo "Usage: $0 {start|stop|status}" 1>&2
	exit 0
	;;
esac
Although script will run successfully during TV start up process and all files and directories of widget from USB copied to my expected folder, but all files size are 0 bytes!!!
In my init script I want to check if directory (/mtd_rwcommon/widgets/user/MyWidget) is exist then run MyWidget widget and if it does not exist, First copy it and then restart TV, to be able to run it at second run of init script(because libRunWidget will not recognize MyWidget after copy and we have to reboot TV to let libRunWidget run MyWidget).

What is my problem?? Why cp command not working properly here!?
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libRunWidget D/E/F/H

Post by zoelechat »

What about

Code: Select all

#!/bin/sh
at the beginning of script? :)
I do NOT receive any PM. Please use forum.
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [App] libRunWidget D/E/F/H

Post by juusso »

Or /bin/busybox cp OR /mnt/bin/busybox cp
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. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
smart_lover
SamyGO Project Donor
Posts: 161
Joined: Sun May 03, 2015 6:11 am

Re: [App] libRunWidget D/E/F/H

Post by smart_lover »

zoelechat wrote:What about

Code: Select all

#!/bin/sh
at the beginning of script? :)
I intentionally remove '#!/bin/sh' from beginning of init script, because I want to make it more readable here in forum.
My original .init file has '#!/bin/sh' at the beginning of it, And as I told you above(
Although script will run successfully during TV start up process and all files and directories of widget from USB copied to my expected folder, but all files size are 0 bytes!!!
) my script run successfully and CP works great!
But It seems it only copy schema and attribute of files instead of file content.
What can I do?

FYI:Whenever I run CP command that exists in init script manually( I mean 'cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user'). It works well and my file content copied successfully. My problem is when the init script wants to run above CP command.
Last edited by smart_lover on Tue Jul 28, 2015 9:27 am, edited 2 times in total.
smart_lover
SamyGO Project Donor
Posts: 161
Joined: Sun May 03, 2015 6:11 am

Re: [App] libRunWidget D/E/F/H

Post by smart_lover »

juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cp
What do you mean? You mean I have to use another CP command? Please explain.
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libRunWidget D/E/F/H

Post by zoelechat »

smart_lover wrote:
juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cp
What do you mean? You mean I have to use another CP command? Please explain.
TV owns a limited busybox. SamyGO owns 2 more, that's why you could try to force you script to use one of them. I'd say most likely:

Code: Select all

/mnt/bin/busybox cp
or

Code: Select all

/mnt/bin/busybox2 cp
I do NOT receive any PM. Please use forum.
smart_lover
SamyGO Project Donor
Posts: 161
Joined: Sun May 03, 2015 6:11 am

Re: [App] libRunWidget D/E/F/H

Post by smart_lover »

zoelechat wrote:
smart_lover wrote:
juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cp
What do you mean? You mean I have to use another CP command? Please explain.
TV owns a limited busybox. SamyGO owns 2 more, that's why you could try to force you script to use one of them. I'd say most likely:

Code: Select all

/mnt/bin/busybox cp
or

Code: Select all

/mnt/bin/busybox2 cp
Thanks, And what about this:
Whenever I run manually CP command that exists in init script( I mean 'cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user'). It works well and my file contents copy also successfully. But my problem is when the init script wants to run above CP command.

I'll try with your suggestion.
zoelechat
SamyGO Moderator
Posts: 8615
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [App] libRunWidget D/E/F/H

Post by zoelechat »

smart_lover wrote:Whenever I run manually CP command that exists in init script( I mean 'cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user'). It works well and my file contents copy also successfully. But my problem is when the init script wants to run above CP command.
Precisely because environment (->PATH) might not be exactly the same whether you're in-Telnet or in-Script, and possibly the "wrong" cp is used if no path specified :)
I do NOT receive any PM. Please use forum.

Post Reply

Return to “[F] Software”