samba share mount.

Here for general support for E series TVs, request and problem solve area.

leandrocaldas
Posts: 10
Joined: Fri Feb 03, 2017 6:32 pm

Re: samba share mount.

Post by leandrocaldas » Sat Feb 18, 2017 6:55 pm

juusso wrote:
Sat Feb 18, 2017 6:48 pm
Then change samba settings on your router and add one more share named movies, where you expose /torrent/movies. Something like that :)
To do this is easy, no problem , the problem is because my tv are showing me all shared folders, because this I have a big delay.

by default script mount a share folder in /dtv/usb/sdj

User avatar
juusso
SamyGO Moderator
Posts: 10124
Joined: Sun Mar 07, 2010 6:20 pm

Re: samba share mount.

Post by juusso » Sat Feb 18, 2017 6:57 pm

you`ll mount your newly created samba share "movies" on TV by script, just have there only one share listed: SHARES="movies"
No other directories will be listed nor checked, only childdirectories inside "movies".
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

leandrocaldas
Posts: 10
Joined: Fri Feb 03, 2017 6:32 pm

Re: samba share mount.

Post by leandrocaldas » Sat Feb 18, 2017 7:03 pm

juusso wrote:
Sat Feb 18, 2017 6:57 pm
you mount movies on TV by script, just have there only one share listed: SHARES="movies"
this is the problem! all folders are there, the big problem is PS3 folder.

Code: Select all

root@tv:/dtv/usb/sdj/midias/192.168.1.2 # ls -l
total 0
drwxrwxrwx    1 root     0                0 May 11  2016 torrent
drwxrwxrwx    3 root     0                0 Nov 28  2016 PS3
drwxrwxrwx    1 root     0                0 Feb 10  2017 midias
check my script,
SpoilerShow
#!/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="guest"
PASSWD="none"
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/midias
SERVER="192.168.1.2"
# SERVER="10.0.0.1" # if you want a fixed server
SHARES="torrent"
FR_NAME="Leandro"
# 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

User avatar
juusso
SamyGO Moderator
Posts: 10124
Joined: Sun Mar 07, 2010 6:20 pm

Re: samba share mount.

Post by juusso » Sat Feb 18, 2017 7:05 pm

Are all folders (movies, ps3 etc) inside torrents folder?
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

leandrocaldas
Posts: 10
Joined: Fri Feb 03, 2017 6:32 pm

Re: samba share mount.

Post by leandrocaldas » Sat Feb 18, 2017 7:08 pm

juusso wrote:
Sat Feb 18, 2017 7:05 pm
Are all folders (movies, ps3 etc) inside torrents folder?
no, in root folder 192.168.1.2/PS3 or 192.168.1.2/torrent or 192.168.1.2/midias are in total 3 folders. movies are on 192.168.1.2/torrent/movies

smb.conf

Code: Select all

[global]
wins support = no
unix charset = UTF-8
dos charset = UTF-8
display charset = UTF-8
security = share

# set workgroup, own share etc...
include = /mtd_rwarea/smb.conf
workgroup = Workgroup
netbios name = samsung
server string = Leandro

load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
guest account = root
guest ok = yes
guest only = yes
null passwords = yes
smb passwd file = /dtv/pp

[Samsung TV]
  comment = USB Drives on TV
  path = /dtv/usb
  public = yes
  writable = yes

User avatar
juusso
SamyGO Moderator
Posts: 10124
Joined: Sun Mar 07, 2010 6:20 pm

Re: samba share mount.

Post by juusso » Sat Feb 18, 2017 7:21 pm

What is smb.conf on router?
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

leandrocaldas
Posts: 10
Joined: Fri Feb 03, 2017 6:32 pm

Re: samba share mount.

Post by leandrocaldas » Sat Feb 18, 2017 7:29 pm

juusso wrote:
Sat Feb 18, 2017 7:21 pm
What is smb.conf on router?
I have only GUI interface and I configured 3 folders PS3 Midias and Torrent. It is a Normal/simple configurations I can´t access router using my telnet or SSH.

User avatar
juusso
SamyGO Moderator
Posts: 10124
Joined: Sun Mar 07, 2010 6:20 pm

Re: samba share mount.

Post by juusso » Sat Feb 18, 2017 7:52 pm

Perhaps solution of your problem is easy by modifying existing script, but to get rid of testing and reporting tons of logs, you can try this:

1. Create /torrents/movies as single samba share "movies" on server`s GUI, be sure your new share is accessible as \\192.168.1.2\movies
2. Then try this from TV`s console:

Code: Select all

mkdir /dtv/usb/sdj/movies
/bin/busybox mount -o user=guest,password=none -t cifs //192.168.1.2/movies /dtv/usb/sdj/movies
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

leandrocaldas
Posts: 10
Joined: Fri Feb 03, 2017 6:32 pm

Re: samba share mount.

Post by leandrocaldas » Sat Feb 18, 2017 8:02 pm

juusso wrote:
Sat Feb 18, 2017 7:52 pm
Perhaps solution of your problem is easy by modifying existing script, but to get rid of testing and reporting tons of logs, you can try this:

1. Create /torrents/movies as single samba share "movies" on server`s GUI, be sure your new share is accessible as \\192.168.1.2\movies
2. Then try this from TV`s console:

Code: Select all

mkdir /dtv/usb/sdj/movies
/bin/busybox mount -o user=guest,password=none -t cifs //192.168.1.2/movies /dtv/usb/sdj/movies
perfect.. worked!!! but where can I change in script to do this automatic?

User avatar
juusso
SamyGO Moderator
Posts: 10124
Joined: Sun Mar 07, 2010 6:20 pm

Re: samba share mount.

Post by juusso » Sat Feb 18, 2017 8:49 pm

And if you leave SHARES="movies" in init script? What do you get after reboot?
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

Post Reply

Return to “[E] Support”