TPerrier wrote:I have a problem with samba shares: how can I refresh the contents of a folder? Does it make some kind of cache? Newly added files doesn't appear in the folders even if I restart the tv and samygo. How could I trigger it to reread the contents?
Hi TPerrier,
I have Samsung LE40B651. I'm still getting familiar with the TV; but this is what I've did to refresh my samba contents.
I've created simple script to mount samba share from my storage server, stored it in/mtd_rwarea/mount-iris-tv-share.sh:
Code: Select all
#!/bin/sh
#
#
FAKE_DISK="sde"
MOUNTPOINT="/dtv/usb/${FAKE_DISK}"
IRIS_SHARE="//172.31.1.2/movies"
ID_DESC="samba-iris"
# IMPORTANT: write changes to /dtv/usb/log
log_mount() {
echo "[${FAKE_DISK}]
Vendor : world
Product : ${ID_DESC}
Serial : Q80VQLFA
Devpath : 4
Lun : 0
MountDir : $MOUNTPOINT
FileSystem : vfat
" >> /dtv/usb/log
}
# load module if not yet present in the kernel
if [ `lsmod |grep -c cifs` == 0 ]; then
insmod /mtd_rwarea/cifs.ko
fi
# only if not mounted yet
if [ `mount | grep -c ${MOUNTPOINT}` == 0 ]; then
echo "iris-mount: fresh mount of ${MOUNTPOINT}";
mkdir -p /dtv/usb/${FAKE_DISK}
mount -o user=guest -t cifs ${IRIS_SHARE} ${MOUNTPOINT}
# IMPORTANT: notify we have new device mounted
if [ $? -eq 0 ]; then log_mount; fi
else
# dirty refresh trick: remove entry from log file, wait a seconds or
# two and put it back ..
echo "iris-mount: already mounted, refreshing"
sed -i '/\['"${FAKE_DISK}"'\]/,/^$/d' /dtv/usb/log
sleep 3
log_mount;
fi
As I mentioned I'm new to the SamyGO and I just wanted something fast that works. I've noticed that something is checking /dtv/usb/log for changes. If I remove the samba entry from this log and put it back (while an actual samba share is still mounted), contents gets refreshed. I know there is a better way - e.g. media play does refresh the USB key when new stuff is copied to it - I think that's the way to go .. but in the mean time, this does work for me
To make it more 'user friendly' I've created really simple contents lib appl so I can mount it without telneting to TV.
iris-mount.c:
Code: Select all
#include <stdio.h>
#include <stdlib.h>
extern int Game_Main(const char *path, const char *udn);
int Game_Main(const char *path, const char *udn __attribute__ ((unused))) {
system ("/mtd_rwarea/mount-iris-tv-share.sh &");
return 0;
}
Makefile:
Code: Select all
CC=arm-linux-gnueabi-gcc
CFLAGS=-O2 -Wall -mglibc
LDFLAGS=-s -shared -Wl
iris-mount.so: iris-mount.o
${CC} ${LDFLAGS} iris-mount.o -o iris-mount.so
iris-mount.o: iris-mount.c
${CC} ${CFLAGS} -c iris-mount.c -o iris-mount.o
clean:
rm -f *.o *.so
..which I got inspired here reading wiki. I know, dirty .. but for the time being, it works
