Page 1 of 2

UE40D6530 SAMBA problems

Posted: Fri Apr 20, 2012 10:44 pm
by pableiras
I've successfully installed SamyGO app in my TV, UE40D6530, but SAMBA is not working properly.

When I start SAMBA from the test.cgi (it's the same if I run it form shell with sh -x ...) I get the following error:

Code: Select all

+ 
/mtd_down/widgets/user/SamyGO/SamyGO/etc/init.d/04_04_samba.init: line 11: 
: Invalid argument
+ . /dtv/SGO.env
/mtd_down/widgets/user/SamyGO/SamyGO/etc/init.d/04_04_samba.init: .: line 12: can't open '/dtv/SGO.env
'
My 04_04_samba.init script is:

Code: Select all

#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
#       by Ser Lev Arris <arris@ZsoltTech.Com>
#
#       donated for the SamyGo Project
#       http://samygo.sourceforge.net/
#
#       Version: SamyGO svn $Id: 04_04_samba.init 1069 2011-01-03 16:47:24Z arris69 $
#

. /dtv/SGO.env
# sleep 9
##### CHANGE MEEEEE !!!!! ######
USER="<my_user>"
PASSWD="<my pass>"
PERM="rw" # can be ro or rw
##### CHANGE MEEEEE END ######

[ -e /mtd_rwarea/smb_userdata ] && source /mtd_rwarea/smb_userdata

[ -z $USER ] && exit 1
[ -z $PASSWD ] && exit 1

DEST_DIR=$MOUNT_PATH/smb
SERVER="192.168.1.10"
# SERVER="10.0.0.1" # if you want a fixed server
SHARES=""
FR_NAME="Samba Server"
# M_OPTS="rw,user=${USER},password=${PASSWD}"
M_OPTS="$PERM,user=${USER},password=${PASSWD},codepage=cp1250,iocharset=utf8"

SERVERS="Don't set me!!"

do_mount()
{
#		$(echo -e "[sdh]\nVendor : CifsMount\nProduct : $FR_NAME\n\
#Serial : Q80VQLFH\nDevpath : 8\nLun : 0\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/log)

	for i in $S_MOUNTS ; do
		i="$(echo -n $i | sed -e 's/SGOspace/ /g')"
		M_POINT="$DEST_DIR/$1/$(echo -n $i | sed -e "s/\\\$/_/g")"
		mkdir -p "$M_POINT" 
		if [ `cat /proc/mounts | grep -c "$M_POINT"` -lt "1" ] ; then	
			/bin/busybox mount -o "${M_OPTS}" -t cifs "//$1/$i" "$M_POINT"
		else
			echo "$M_POINT is mounted!"
		fi

	done
}

get_shares()
{
	echo "Search Shares" 
	for i in $SERVERS ; do
	echo "on: $i" 
		S_MOUNTS=$(smbclient -s "$SYSROOT/etc/samba/smb.conf" -U ${USER}%${PASSWD} \
		-g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | sed -r 's/.*\|(.*)\|.*/\1/' | sed -r 's/ /SGOspace/g')	
		# -g -L $i | grep "Disk|" | grep -v "\\$" | grep -v " Service" | cut -d "|" -f2)	
	[ -n "$S_MOUNTS" ] && do_mount $i
	done
}

get_servers()
{
	if [ -z "$SERVER" ] ; then
		# SERVERS=$(cat /proc/net/arp | grep -v "IP address" | cut -d " " -f1)
		SERVERS=$(cat /proc/net/arp | grep -v "IP address" | sed 's/^\(\w*.\w*.\w*.\w*\) *.*/\1/')
	else
		SERVERS=$SERVER
	fi
}

case $1 in 
	start)
	insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
	mkdir -p "$DEST_DIR"
	get_servers
	get_shares
	;;
	stop)
	# may can fail if device access the mount from content library
	# for i in $(cat /proc/mounts | grep cifs | cut -d " " -f2) ; do
	for i in $(cat /proc/mounts | grep cifs | grep "$DEST_DIR" | sed 's/^\(.*\) \(.*\) cifs .*/\2/') ; do
		i="$(echo -n $i | sed -r 's/\\040/ /g')"
		/bin/busybox umount "$i"
	done
	;;
	status)
	/bin/mount | grep "$DEST_DIR"
	;;
	*)
	echo "Usage: $0 {start|stop}" 1>&2
	exit 0
	;;
esac
Any clue?

Thanx!

Re: UE40D6530 SAMBA problems

Posted: Sat Apr 21, 2012 10:34 am
by nowo
Perhaps you must set user and pass..

Code: Select all

USER="<my_user>"
PASSWD="<my pass>"

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 11:48 am
by hucky
I have exact same problem.

Like seen in the report samba.init script can't open /dtv/SGO.env

I dont know why. Knowing a bit of shell-scripting it seems to me
all this samba (client) stuff on series D 6xxx is heavily buggy.

For what is line 11 empty? --> error message
What means the space between . and /SGO.env ?

Would be nice if someone will explain complete mounting procedure
on this samsung items...

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 11:52 am
by juusso
hucky wrote: What means the space between . and /SGO.env ?
the dot isn`t just a dot per se here. This is the operator "source" which indicates to use arguments and commands from SGO.env...
So the space here is mandatory and needed :)
You can change the dot to source and you get same result:

Code: Select all

source /dtv/SGO.env
References:
http://ss64.com/bash/period.html

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 12:26 pm
by hucky
Ok,

thanks. But why is "/dtv/SGO.env" not found?

The file exists.

Message:
  • + . /dtv/SGO.env
    /mtd_rwcommon/widgets/user/SamyGO/SamyGO/etc/init.d/04_04_samba.init: .: line 11: can't open '/dtv/SGO.env
    '

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 1:37 pm
by arris69
hucky wrote:I have exact same problem.

Like seen in the report samba.init script can't open /dtv/SGO.env

I dont know why. Knowing a bit of shell-scripting it seems to me
all this samba (client) stuff on series D 6xxx is heavily buggy.
no, it's bug free...
For what is line 11 empty? --> error message
...
you edited the samba-init script? if yes i'll bet you did it with windows notepad...

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 4:01 pm
by hucky
arris69 wrote:
hucky wrote:I have exact same problem.

Like seen in the report samba.init script can't open /dtv/SGO.env

I dont know why. Knowing a bit of shell-scripting it seems to me
all this samba (client) stuff on series D 6xxx is heavily buggy.
no, it's bug free...

OK, may be its bugfree but doesn't work ... no difference for normal user :lol:

For what is line 11 empty? --> error message
...
you edited the samba-init script? if yes i'll bet you did it with windows notepad...
No, I'm linuxer, no windows on me!

Is there anyone who can give some useful hints for the question which was and is:

Why the samba.init script can't open /dtv/SGO.env?

The file exists. Changing to mode 777 nothing changes.

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 4:31 pm
by arris69
hucky wrote:...

No, I'm linuxer, no windows on me!

Is there anyone who can give some useful hints for the question which was and is:

Why the samba.init script can't open /dtv/SGO.env?

The file exists. Changing to mode 777 nothing changes.
you can chmod it to 000 it will be loaded too, except you damaged the samba init file....

but the only thing is i don't see here any relevant information from you. it's same then i would ask: "my car is here but it won't start, why?"

how do you installed the widget/extensions how do you try to start it, did you start it??? etc...

Re: UE40D6530 SAMBA problems

Posted: Tue Apr 24, 2012 4:56 pm
by DEUS
could you post the file from your TV here, no copy and paste of contents and maybe SGO.env ?
what happens when you issue ". /dtv/SGO.env" on shell directly?

Re: UE40D6530 SAMBA problems

Posted: Wed Apr 25, 2012 8:51 am
by hucky
:oops:SHAME AND BLAME ON ME!!! :oops:

I used "windows"-setting for line-end-code in my linux-editor.

Now the script is executed, still doesn't show me content but this
depends on wrong settings in my sambaserver (I hope so).

Thank you for your patience!

lg,
hucky