Page 3 of 10
Re: [App] libRunWidget D/E/F/H
Posted: Mon Jul 20, 2015 9:39 pm
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

Re: [App] libRunWidget D/E/F/H
Posted: Mon Jul 20, 2015 10:35 pm
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.
Re: [App] libRunWidget D/E/F/H
Posted: Mon Jul 27, 2015 9:34 pm
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!?
Re: [App] libRunWidget D/E/F/H
Posted: Mon Jul 27, 2015 9:57 pm
by zoelechat
What about
at the beginning of script?

Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 4:57 am
by juusso
Or /bin/busybox cp OR /mnt/bin/busybox cp
Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 7:49 am
by smart_lover
zoelechat wrote:What about
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.
Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 7:50 am
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.
Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 9:26 am
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:
or
Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 9:29 am
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:
or
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.
Re: [App] libRunWidget D/E/F/H
Posted: Tue Jul 28, 2015 9:48 am
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
