SamyGo Extension Pack modified for NFS recording

Here are software that related with Samsung C series TVs, applications, programs that will run in your TV or computer...:!:This forum is NOT FOR USER QUESTIONS or Problems.

xinvox

Re: SamyGo Extension Pack modified for NFS recording

Post by xinvox »

beatfreak wrote:there should be a .placeholder....... file in it
if you do the steps i posted before again, the command to create it would be

Code: Select all

touch /tmp/xfs/.PlaceHolderDO-NOT-REMOVE
then check if existing

Code: Select all

ls -alR /tmp/xfs
and unmount pvrimage

Code: Select all

umount /dtv/usb/sda1/SamyGO/pvrimage
then check again (placeholder file should be gone as mountpoint is empty without mounted image)


after a reboot you should see in output of cat /proc/mounts

Code: Select all

...lots of mounts...
/dev/sdc /dtv/usb/sdc xfs rw,nouuid,noquota 0 0
(recorder mount)
Hello, I cough steps and get this, after reboot, I get that line actually, the problem is that I found the flash drive to mount pvrimage

Code: Select all

/ # mkdir /tmp/xfs
/ # touch /tmp/xfs/.PlaceHolderDO-NOT-REMOVE
/ # ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              60 Jan  1 00:05 .
drwxrwxrwt    3 root     0              60 Jan  1 00:05 ..
-rw-r--r--    1 root     0               0 Jan  1 00:05 .PlaceHolderDO-NOT-REMOVE
/ # /bin/busybox mount -t xfs -o rw,loop /dtv/usb/sda1/SamyGO/pvrimage /tmp/xfs
/ # ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    4 root     0              36 Jan  1 00:03 .
drwxrwxrwt    3 root     0              60 Jan  1 00:05 ..
drwxr-xr-x    2 root     0               6 Jan  1 00:03 CONTENTS
drwxr-xr-x    2 root     0              34 Jan  1 00:03 database

/tmp/xfs/CONTENTS:
drwxr-xr-x    2 root     0               6 Jan  1 00:03 .
drwxr-xr-x    4 root     0              36 Jan  1 00:03 ..

/tmp/xfs/database:
drwxr-xr-x    2 root     0              34 Jan  1 00:03 .
drwxr-xr-x    4 root     0              36 Jan  1 00:03 ..
-rwxr-xr-x    1 root     0          536576 Jan  1 00:03 Ace.dat
-rwxr-xr-x    1 root     0          262144 Jan  1 00:03 Ace.log
/ # 

Code: Select all

/ # cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/sam tmpfs rw 0 0
none /dtv tmpfs rw 0 0
none /dsm tmpfs rw 0 0
none /core tmpfs rw 0 0
none /tmp tmpfs rw 0 0
/dev/stl0/14 /mtd_rwarea rfs rw,codepage=utf8,vfat,fcache(blks)=128 0 0
/dev/stl0/19 /mtd_rocommon squashfs ro 0 0
/dev/stl0/17 /mtd_exe rfs ro,codepage=cp949,vfat,fcache(blks)=128 0 0
/dev/stl0/18 /mtd_appdata squashfs ro 0 0
/dev/stl0/13 /mtd_contents rfs rw,codepage=utf8,vfat,fcache(blks)=128 0 0
/dev/stl0/20 /mtd_swu rfs rw,codepage=cp949,vfat,fcache(blks)=128 0 0
/dev/stl0/21 /mtd_rwcommon rfs rw,codepage=utf8,vfat,fcache(blks)=128 0 0
none /proc/bus/usb usbfs rw 0 0
devpts /dev/pts devpts rw 0 0
/dev/sda1 /dtv/usb/sda1 vfat rw,sync,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed 0 0
192.168.1.10:/volume1/Anime /dtv/usb/sda1/Anime nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
/dev/stl0/14 /etc/passwd rfs rw,codepage=utf8,vfat,fcache(blks)=128 0 0
192.168.1.10:/volume1/Cine /dtv/usb/sda1/Cine nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
/dev/stl0/14 /etc/profile rfs rw,codepage=utf8,vfat,fcache(blks)=128 0 0
192.168.1.10:/volume1/Deportes /dtv/usb/sda1/Deportes nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Descargas /dtv/usb/sda1/Descargas nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Grabaciones /dtv/usb/sda1/Grabaciones nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Series /dtv/usb/sda1/Series nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/video /dtv/usb/sda1/Videos nfs rw,vers=3,rsize=131072,wsize=131072,hard,intr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
/dev/sdb1 /dtv/usb/sdb1 xfs rw,nouuid,noquota 0 0
192.168.1.10:/volume1/Anime /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Anime nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
/dev/sdc /dtv/usb/sdc vfat rw,sync,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed 0 0
192.168.1.10:/volume1/Cine /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Cine nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Deportes /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Deportes nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Descargas /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Descargas nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Grabaciones /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Grabaciones nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/Series /dtv/usb/sdc/nfs/192.168.1.10/_volume1_Series nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
192.168.1.10:/volume1/video /dtv/usb/sdc/nfs/192.168.1.10/_volume1_video nfs rw,vers=3,rsize=131072,wsize=131072,soft,nointr,nolock,proto=tcp,timeo=70,retrans=3,sec=sys,addr=192.168.1.10 0 0
/dev/sdd /dtv/usb/sdd xfs rw,nouuid,noquota 0 0
/ # 

Code: Select all

umount /dtv/usb/sda1/SamyGO/pvrimage
umount: cannot umount /dtv/usb/sda1/SamyGO/pvrimage: Invalid argument
/ # /bin/umount /dtv/usb/sda1/SamyGO/pvrimage
umount: cannot umount /dtv/usb/sda1/SamyGO/pvrimage: Invalid argument
/ # cd /dtv/usb/sda1/SamyGO
/dtv/usb/sda1/SamyGO # ls -a -l
drwxr-xr-x   11 root     0            4096 Nov 25  2012 .
drwxr-xr-x   15 root     0            4096 Jan  1 00:00 ..
-rwxr-xr-x    1 root     0           12292 Nov 29  2012 .DS_Store
-rwxr-xr-x    1 root     0               0 Nov 25  2012 .PlaceHolderDO-NOT-REMOVE
-rwxr-xr-x    1 root     0            4096 Dec  1  2012 ._.DS_Store
drwxr-xr-x    2 root     0            4096 Dec  1  2012 bin
-rwxr-xr-x    1 root     0               0 Oct  1  2011 clmeta.dat
drwxr-xr-x    4 root     0            4096 Dec  1  2012 doc
drwxr-xr-x   11 root     0            4096 Dec  1  2012 etc
drwxr-xr-x    3 root     0            4096 Dec  1  2012 lib
drwxr-xr-x    5 root     0            4096 Dec  1  2012 mc
drwxr-xr-x    3 root     0            4096 Dec  1  2012 opt
drwxr-xr-x    6 root     0            4096 Dec  1  2012 phpsysinfo
-rwxr-xr-x    1 root     0       1572864000 Jan  1 00:08 pvrimage
-rwxr-xr-x    1 root     0            3779 Mar 28  2011 rcSGO
-rwxr-xr-x    1 root     0             388 Jan  1 00:00 samygo.log
drwxr-xr-x    2 root     0            4096 Dec  1  2012 sbin
drwxr-xr-x    2 root     0            4096 Dec  1  2012 usr
User avatar
beatfreak
SamyGO Project Donor
Posts: 591
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: SamyGo Extension Pack modified for NFS recording

Post by beatfreak »

your placeholder file has gone the wrong location... and i told the wrong command to unmount :oops:
plug your pendrive to your pc and remove your pvrimage and .placeholder... from SamyGO folder
(there are directorys in your pvrimage that do not belong there, should be on nfs share...)


in this example i created a new xfs image on my nfs share and then copied it to pendrive...

Code: Select all

beatfreak@hisPC:~> ssh root@10.10.10.6
root@10.10.10.6's password: 
# cd /dtv/usb/sdb/nfs/10.10.10.10/_samrec/
# mkfs.xfs -f -d file,name=pvrimage,size=1536m
meta-data=pvrimage               isize=256    agcount=4, agsize=98304 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=393216, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
existing superblock read failed: Inappropriate ioctl for device
# md /tmp/xfs
# /bin/busybox mount -t xfs -o rw,loop /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0               6 Jan  1 00:01 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# touch /tmp/xfs/.PlaceHolderDO-NOT-REMOVE
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              38 Jan  1 00:05 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
-rw-r--r--    1 root     0               0 Jan  1 00:05 .PlaceHolderDO-NOT-REMOVE
# /bin/busybox umount /tmp/xfs                                      
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              40 Jan  1 00:02 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# /bin/busybox mount -t xfs -o rw,loop /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              38 Jan  1 00:05 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
-rw-r--r--    1 root     0               0 Jan  1 00:05 .PlaceHolderDO-NOT-REMOVE
# /bin/busybox umount /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              40 Jan  1 00:02 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# cp /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /dtv/usb/sda1/SamyGO/
#
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.
xinvox

Re: SamyGo Extension Pack modified for NFS recording

Post by xinvox »

beatfreak wrote:your placeholder file has gone the wrong location... and i told the wrong command to unmount :oops:
plug your pendrive to your pc and remove your pvrimage and .placeholder... from SamyGO folder
(there are directorys in your pvrimage that do not belong there, should be on nfs share...)


in this example i created a new xfs image on my nfs share and then copied it to pendrive...

Code: Select all

beatfreak@hisPC:~> ssh root@10.10.10.6
root@10.10.10.6's password: 
# cd /dtv/usb/sdb/nfs/10.10.10.10/_samrec/
# mkfs.xfs -f -d file,name=pvrimage,size=1536m
meta-data=pvrimage               isize=256    agcount=4, agsize=98304 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=393216, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
existing superblock read failed: Inappropriate ioctl for device
# md /tmp/xfs
# /bin/busybox mount -t xfs -o rw,loop /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0               6 Jan  1 00:01 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# touch /tmp/xfs/.PlaceHolderDO-NOT-REMOVE
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              38 Jan  1 00:05 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
-rw-r--r--    1 root     0               0 Jan  1 00:05 .PlaceHolderDO-NOT-REMOVE
# /bin/busybox umount /tmp/xfs                                      
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              40 Jan  1 00:02 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# /bin/busybox mount -t xfs -o rw,loop /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              38 Jan  1 00:05 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
-rw-r--r--    1 root     0               0 Jan  1 00:05 .PlaceHolderDO-NOT-REMOVE
# /bin/busybox umount /tmp/xfs
# ls -alR /tmp/xfs
/tmp/xfs:
drwxr-xr-x    2 root     0              40 Jan  1 00:02 .
drwxrwxrwt    3 root     0              60 Jan  1 00:02 ..
# cp /dtv/usb/sdb/nfs/10.10.10.10/_samrec/pvrimage /dtv/usb/sda1/SamyGO/
#

Hi, well finally I have the recording by nfs running, today when I saw your post it's clear the problem I had, I thought that /. PlaceHolderDO-NOT-REMOVE, had to create it in the USB device, rather than the NFS share for the recording, I'm a little clumsy with linux, thanks to you I work recording, and have learned to handle me a little better, thank you very much for your time and your help, now try the decryption will try to see if I do best, greetings
User avatar
beatfreak
SamyGO Project Donor
Posts: 591
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: SamyGo Extension Pack modified for NFS recording

Post by beatfreak »

Now a general question from me...

i noticed that it takes about 30 sec. to start timeshift (from buttonpress || to actually stopped tv playback...

normal recordings start immediately and are recorded properly

opening tv recordings in media-play takes up to 1minute until the first recording is displayed and up to 3 minutes until i can select another recording to play

encryption is disabled


and one more thing: (back to xfs_img@nfs_share)
this is my plan to do the trick without the need of modified modules

*move the nfs-insmod block

Code: Select all

	insmod $MOD_DIR/kernel/net/sunrpc/sunrpc.ko
	insmod $MOD_DIR/kernel/fs/lockd/lockd.ko
	insmod $MOD_DIR/kernel/fs/nfs_common/nfs_acl.ko
	insmod $MOD_DIR/kernel/fs/nfs/nfs.ko
from 03_03_nfsmount.remi71.init appended to the start section of 02_04_vusb.remi71.init

*and then do a hard nfs mount right before checking for pvrimage file in 02_04_vusb.remi71.init
so the script would look like

Code: Select all

#!/bin/sh
#
# http://www.gnu.org/licenses/gpl-howto.html
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script.  If not, see <http://www.gnu.org/licenses/>.
#
# Copyleft by Remigio Conti 20110110 to support PVR Recording over network
#	see: http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=12&t=1332&start=0
#

. /dtv/SGO.env

case $1 in 
	start)
	mkfs.vfat -C /dtv/vusb 500
	insmod $MOD_DIR/kernel/drivers/usb/gadget/dummy_hcd.ko
	insmod $MOD_DIR/kernel/net/sunrpc/sunrpc.ko
	insmod $MOD_DIR/kernel/fs/lockd/lockd.ko
	insmod $MOD_DIR/kernel/fs/nfs_common/nfs_acl.ko
	insmod $MOD_DIR/kernel/fs/nfs/nfs.ko
	sleep 2

        IMGSERVER='10.10.10.10'
        IMGPATH='/images' 
        M_OPTS="rw,soft,tcp,nolock"
        IMGMPOINT="$SYSROOT/mnt"
        /bin/busybox mount -o "$M_OPTS" "$IMGSERVER:$IMGPATH" "$IMGMPOINT"

	GFILESTORAGE='/dtv/vusb'
	PVRIMAGE="$IMGMPOINT/pvrimage"
        sleep 2
	if [ -e $PVRIMAGE ]; then
		GFILESIZE=`du $PVRIMAGE |cut -f1`
		if [ $GFILESIZE -ge 1536000 ]; then  	
			GFILESTORAGE="$GFILESTORAGE,$PVRIMAGE"
			echo "Found pvrimage file $PVRIMAGE size=$GFILESIZE KByte, so enabling PVR Record over NFS"
		else 
			echo "Found pvrimage file $PVRIMAGE size=$GFILESIZE KByte, but size is less than required (1536000 KBYTE), so PVR Record over NFS will not be enabled"    
		fi
	else
		echo "pvrimage $PVRIMAGE NOT found, so PVR Record over NFS will not be enabled"
	fi

	insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko file="$GFILESTORAGE"
	sleep 3

	FOUND=false
	SAMYGODEVS=''
	for i in /sys/block/sd?/device/model ; do
		if [ `cat $i | grep -c "SamyGO Virt"` -gt "0" ]; then
			CURDEV="`echo $i | sed 's/^\/.*\(sd.\)\/.*/\1/g'`"
			SAMYGODEVS="$SAMYGODEVS /dev/$CURDEV"
			if [ $FOUND = false ]; then
				echo "found gadget at: $i"
				dev=$CURDEV
				echo "scsidev: $dev"
				FOUND=true
			fi
		else
			echo "real storage device at: $i"
		fi
	done
	SAMYGODEVS=`echo $SAMYGODEVS|sed 's/^[[:space:]]//'`

	sed -i -e "s,MountPlaceholder,/dtv/usb/$dev," /dtv/SGO.env
	echo "SAMYGODEVS=\"$SAMYGODEVS\"" >> /dtv/SGO.env
	;;
	stop)
	rmmod g_file_storage
	rmmod dummy_hcd
	;;
	status)
	cat /sys/block/sd?/device/model
	;;
	*)
	echo "Usage: $0 {start|stop|status}" 1>&2
	exit 0
	;;
esac


could this work or are there more dependencies for the nfs-modules?

if it works,
@remi71: would you consider to mod your script like this? (would get too complicated if we release the mod of a mod of a script...)

[EDIT:]
i recently checked my rcSGO output and noticed:

Code: Select all

insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbcopyarea.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbfillrect.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbimgblt.ko': No such file or directory
mkfs.vfat 2.11 (12 Mar 2005)
Found pvrimage file /dtv/usb/sda1/SamyGO/pvrimage size=1536000 KByte, so enabling PVR Record over NFS
real storage device at: /sys/block/sda/device/model
found gadget at: /sys/block/sdb/device/model
scsidev: sdb
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/net/sunrpc/sunrpc.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/fs/lockd/lockd.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/fs/nfs_common/nfs_acl.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/fs/nfs/nfs.ko': No such file or directory
nfs mounting works though.
I checked the downloaded files and the modules not found were not included, forgotten to add them to the archive or forgotten to remove them from the scripts?

And as we already speak about script modifications:

after i changed my switch (from smc wbr14g 4-port to cisco 2924 19" 24-port) i noticed that tv needs more time to obtain an ip-adress. so the nfs-mount scripts fail.
i'd like to add a loop that pings the server before going to the showmounts section...
i'll try to post a sketch of it but i'm not familiar with the scripting-style the samygo-scripts are written in...

1st problem: i have seen that you used wait=nn in the scripts to slow down things, but i don't know how to define if it should be sec or msec and in general for unix/linux the command is sleep, wait would do something different...?

Code: Select all

test_network()
{
          A=1
          while [ $A <= 30 ]
          do
                        ping $SERVER -c 1 -q
                        if [ (ping successful) ]
                              A=10
                        else
                              A=A+1
                        fi
           done
}
"quick'n'dirty" alternative:
SHARE_1='10.10.10.10:/samrec'
# SHARE_2='10.10.10.10:/dvd'
SHARE_2='10.10.10.10:/samrec'
SHARE_3='10.10.10.10:/samrec'
SHARE_4='10.10.10.10:/samrec'
SHARE_5='10.10.10.10:/samrec'
# this will result in a 5 times-retry-loop

FR_NAME="NFS Server"
M_OPTS="soft,udp,async,nolock,rsize=32768,wsize=8192"
# M_OPTS="rw,soft,udp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=8192,wsize=8192"
# M_OPTS="soft,tcp,nolock"

DEST_DIR=$MOUNT_PATH/nfs

do_mount()
{
# $(echo -e "[sdg]\nVendor : NfsMount\nProduct : $FR_NAME\n\
#Serial : Q80VQLFG\nDevpath : 7\nLun : 0\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/log)

M_POINT="$DEST_DIR/$1/$(echo -n "$2" | 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" "$1:$2" "$M_POINT"
if [ $? = 0 ]; then
echo "Share $1:$2 successfully mounted on $M_POINT"
else
echo "Error during mount of $1:$2 on $M_POINT"
fi
else
echo "Share $1:$2 is already mounted!"
fi
}

get_shares()
{
ENDARRAY=false
N=1
while [ $ENDARRAY = false ]
do
eval SHARE=\${SHARE_${N}}
if [ -z "$SHARE" ]; then
ENDARRAY=true
else
SERVER=`echo "$SHARE"|cut -d ':' -f1`
SHPATH=`echo "$SHARE"|cut -d ':' -f2`
echo -n "Check if server $SERVER is reachable..."
showmount --no-header -e $SERVER 1>/dev/null 2>&1
if [ $? = 0 ]; then
echo 'ok'
do_mount "$SERVER" "$SHPATH"
else
echo 'NOT reachable skip!'
sleep 5 #if server not reachabe wait and proceed to next share entry
fi
let N=N+1
fi
done
}
Last edited by beatfreak on Fri Apr 05, 2013 5:38 pm, edited 1 time in total.
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.
User avatar
beatfreak
SamyGO Project Donor
Posts: 591
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: SamyGo Extension Pack modified for NFS recording

Post by beatfreak »

*push*

[EDIT:]
what about this to push it?

Code: Select all

b3nz0l@SledgehammerLNX:~> ssh root@10.10.10.6
root@10.10.10.6's password: 
# cat /dtv/usb/sda1/rcSGO_out 
+ /dtv/usb/sda1/SamyGO/rcSGO /dtv/usb/sda1/SamyGO
sed: /dtv/usb/sda1/SamyGO/log: No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbcopyarea.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbfillrect.ko': No such file or directory
insmod: can't open '/dtv/usb/sda1/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8/kernel/drivers/video/cfbimgblt.ko': No such file or directory
mkfs.vfat 2.11 (12 Mar 2005)
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg successfully mounted on /dtv/usb/sda1/SamyGO/img
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg is already mounted!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg is already mounted!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg is already mounted!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg is already mounted!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg is already mounted!
Found pvrimage file /dtv/usb/sda1/SamyGO/img/pvrimage size=1536000 KByte, so enabling PVR Record over NFS
real storage device at: /sys/block/sda/device/model
found gadget at: /sys/block/sdb/device/model
scsidev: sdb
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/samrec successfully mounted on /dtv/usb/sdb/nfs/10.10.10.10/_samrec
PVR on server 10.10.10.10 is now ready in localpath /dtv/usb/sdc
# df -h /dtv/usb/sda1
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1               964.1M     50.8M    913.3M   5% /dtv/usb/sda1
# df -h /dtv/usb/sdc 
Filesystem                Size      Used Available Use% Mounted on
10.10.10.10:/pvrimg     250.0G    113.4G    136.6G  45% /dtv/usb/sda1/SamyGO/img
# 
51MB on pendrive needed for full nfs-pvr...

[EDIT]
moved SamyGO folder from sda1 to mtd_rwcommon and using run.sh on sda1 to invoke rcSGO
now whole extensions-bootup is finished at 00:00:50 (system time on TV)
with <1KB used on pendrive
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.
coyotee
Posts: 15
Joined: Wed Nov 30, 2011 6:04 am

Re: SamyGo Extension Pack modified for NFS recording

Post by coyotee »

Hello! I am using raspberry pi as NFS server. The thing works, I have only one problem and that is how can i change mount point for HDD movies folder. Its mount it on :dtv/usb/sdd, but samygo folder for videos( white usb key logo) is on dtv/usb/sdc I think. Thanks! Will explain later, beacause wright now I am not at tv....
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: SamyGo Extension Pack modified for NFS recording

Post by juusso »

Check your script... (80_80...)
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
User avatar
beatfreak
SamyGO Project Donor
Posts: 591
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: SamyGo Extension Pack modified for NFS recording

Post by beatfreak »

just to document my current setup:

rcSGO.out
SpoilerShow

Code: Select all

# cat /dtv/rcSGO_out 
+ sh -x /mtd_rwcommon/SamyGO/rcSGO /mtd_rwcommon/SamyGO
+ [ ! -e /dtv/SGO.env ]
+ alias .=source
+ [ ! -e /proc/mounts ]
+ cat /proc/version
+ sed -e s/\(.*inux version \)\(.*\) \(.*@.*\)$/\2/
+ KERN_VER=2.6.24_SELP.4.3.x-Cortex-A8
+ [ -x /etc/rc.early.local ]
+ [ -d /mtd_wiselink ]
+ NEW_HOME=/mtd_wiselink
+ [ ! -e /mtd_rwarea/passwd ]
+ mount -o bind /mtd_rwarea/passwd /etc/passwd
+ S_SCRIPT=echo Bummer >> /dev/kmsg
+ [ ! -z /mtd_rwcommon/SamyGO ]
+ [ -x /mtd_rwcommon/SamyGO/etc/rc.sysinit ]
+ SYSROOT=/mtd_rwcommon/SamyGO
+ S_SCRIPT=cd /mtd_rwcommon/SamyGO ; ./etc/rc.sysinit 2>&1 &
+ echo SYSROOT="/mtd_rwcommon/SamyGO"
+ echo MOUNT_PATH="MountPlaceholder"
+ echo export MOD_DIR=/mtd_rwcommon/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8
+ echo export TMPDIR=/dtv
+ echo export HOME=/mtd_wiselink
+ echo export SMB_CONF_PATH="/mtd_rwcommon/SamyGO/etc/samba/smb.conf"
+ echo LOGFILE="/mtd_rwcommon/SamyGO/samygo.log"
+ eval cd /mtd_rwcommon/SamyGO ; ./etc/rc.sysinit 2>&1 &
+ cd /mtd_rwcommon/SamyGO
+ ./etc/rc.sysinit
sed: /mtd_rwcommon/SamyGO/log: No such file or directory
Thu Jan 1 00:00:15 UTC 1970
mkfs.vfat 2.11 (12 Mar 2005)
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/pvrimg successfully mounted on /mtd_rwcommon/SamyGO/img
Thu Jan 1 00:00:41 UTC 1970
Found pvrimage file /mtd_rwcommon/SamyGO/img/pvrimage size=1536000 KByte, so enabling PVR Record over NFS
real storage device at: /sys/block/sda/device/model
found gadget at: /sys/block/sdb/device/model
scsidev: sdb
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/samrec successfully mounted on /dtv/usb/sdb/nfs/10.10.10.10/_samrec
PVR on server 10.10.10.10 is now ready in localpath /dtv/usb/sdc
Mon Dec 30 20:33:05 UTC 2013
# 
# cat /dtv/SGO.env 
SYSROOT="/mtd_rwcommon/SamyGO"
MOUNT_PATH="/dtv/usb/sdb"
export MOD_DIR=/mtd_rwcommon/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8
export TMPDIR=/dtv
export HOME=/mtd_wiselink
export SMB_CONF_PATH="/mtd_rwcommon/SamyGO/etc/samba/smb.conf"
LOGFILE="/mtd_rwcommon/SamyGO/samygo.log"
LD_LIBRARY_PATH="/mtd_rwcommon/SamyGO/opt/privateer/lib:/mtd_rwcommon/SamyGO/opt/privateer/usr/lib:/mtd_rwcommon/SamyGO/lib:/mtd_rwcommon/SamyGO/usr/lib:"
PATH="/mtd_rwcommon/SamyGO/opt/privateer/sbin:/mtd_rwcommon/SamyGO/opt/privateer/bin:/mtd_rwcommon/SamyGO/opt/privateer/usr/bin:/mtd_rwcommon/SamyGO/opt/privateer/usr/sbin:/mtd_rwcommon/SamyGO/sbin:/mtd_rwcommon/SamyGO/bin:/mtd_rwcommon/SamyGO/usr/bin:/mtd_rwcommon/SamyGO/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin"
export ENV="/dtv/.ashrc"
export FRAMEBUFFER="/dev/sam/fb0"
export DISTROOT="/mtd_rwcommon/SamyGO/opt/privateer"
SAMYGODEVS="/dev/sdb /dev/sdc"
# 
you see 41 seconds to network connection and (first)nfs-mount

Physical USB-Drive:

Code: Select all

# ll /dtv/usb/sda1/
drwxr-xr-x   12 root     0            4096 Jan  1  1980 SamyGOusb
drwxr-xr-x    3 root     0            4096 Jan  1  1980 T-VALDEUC
-rwxr-xr-x    1 root     0           14784 Jan  1  1980 channel_list_UE40C6500_1001.scm
-rwxr-xr-x    1 root     0            1466 Jan  1  1980 rcSGO_out
-rwxr-xr-x    1 root     0             564 Jan  1  1980 run.sh
-rwxr-xr-x    1 root     0             564 May  3  2013 run.sh~
# cat /dtv/usb/sda1/run.sh
#!/bin/sh
#echo 'OK' >> /dtv/usb/sda1/run.ok
#sh -x /dtv/usb/sda1/SamyGO/rcSGO >/dev/null 2>&1 &
sh -x /mtd_rwcommon/SamyGO/rcSGO /mtd_rwcommon/SamyGO >/dtv/rcSGO_out 2>&1 &
#$1/SamyGO/rcSGO $1/SamyGO > $1/rcSGO_out 2>&1 &
#if [ -x /mtd_rwcommon/SamyGO/rcSGO ] ; then
#       sh -x /mtd_rwcommon/SamyGO/rcSGO /mtd_rwcommon/SamyGO > /mtd_rwcommon/rcSGO_out 2>&1 &
#else
#       if [ -x $1/SamyGO/rcSGO ] ; then
#              sh -x $1/SamyGO/rcSGO $1 > $1/rcSGO_out 2>&1 &
#      else
#              echo 'nothing to do here' >> /dtv/usb/sda1/run.nok
#       fi
#fi

# 

is a bit messy, remains of testing and backups of hacking stuff and SamyGO extensions....

init.d
SpoilerShow

Code: Select all

# cp SamyGO/etc/init.d/*.init /dtv/usb/sdb/nfs/10.10.10.10/_samrec/config/
# ll /dtv/usb/sdb/nfs/10.10.10.10/_samrec/config   
-rwxr-xr-x    1 root     0             629 Dec 30 21:35 01_01_catch_crap.init
-rwxr-xr-x    1 root     0             194 Dec 30 21:35 01_04_pvr_drm_disable.init
-rwxr-xr-x    1 root     0             803 Dec 30 21:35 01_04_server_replacement.init
-rwxr-xr-x    1 root     0            1139 Dec 30 21:35 01_05_framebuffer.init
-rwxr-xr-x    1 root     0            3973 Dec 30 21:35 02_04_vusb.remi71.init
-rwxr-xr-x    1 root     0             972 Dec 30 21:35 02_09_set_time.init
-rwxr-xr-x    1 root     0             593 Dec 30 21:35 03_01_fuse.init
-rwxr-xr-x    1 root     0            3084 Dec 30 21:35 03_03_nfsmount.remi71.init
-rwxr-xr-x    1 root     0             993 Dec 30 21:35 03_03_sshd.init
-rwxr-xr-x    1 root     0             537 Dec 30 21:35 06_05_vsftp.init
-rwxr-xr-x    1 root     0            4323 Dec 30 21:35 80_80_record_to_nwshare.remi71.init
# 
# cd /dtv/usb/sdb/nfs/10.10.10.10/_samrec/config

Code: Select all

# cat 01_04_pvr_drm_disable.init 
#!/bin/sh
#
# ? Copyright 1996-2011, SamyGO
#
#
# . /dtv/SGO.env

case $1 in 
        start)
        samsung_pvr &
        ;;
        stop)
        ;;
        status)
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac

Code: Select all

# cat 02_04_vusb.remi71.init 
#!/bin/sh
#
# http://www.gnu.org/licenses/gpl-howto.html
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script.  If not, see <http://www.gnu.org/licenses/>.
#
# Copyleft by Remigio Conti 20110110 to support PVR Recording over network
#       see: http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=12&t=1332&start=0
#

. /dtv/SGO.env
SHARE_1='10.10.10.10:/pvrimg'
SHARE_2='10.10.10.10:/pvrimg'
SHARE_3='10.10.10.10:/pvrimg'
SHARE_4='10.10.10.10:/pvrimg'
SHARE_5='10.10.10.10:/pvrimg'
SHARE_6='10.10.10.10:/pvrimg'
SHARE_7='10.10.10.10:/pvrimg'
SHARE_8='10.10.10.10:/pvrimg'
SHARE_9='10.10.10.10:/pvrimg'
FR_NAME="NFS Server"

M_OPTS="soft,udp,async,nolock,rsize=32768,wsize=8192"
IMGPATH="$SYSROOT/img"
PVRIMAGE="$IMGPATH/pvrimage"


do_mount()
{
        if [ `cat /proc/mounts | grep -c "$IMGPATH"` -lt "1" ] ; then
                /bin/busybox mount -o "$M_OPTS" "$1:$2" "$IMGPATH"
                if [ $? = 0 ]; then
                        echo "Share $1:$2 successfully mounted on $IMGPATH" 
                        echo `date`
                else
                        echo "Error during mount of $1:$2 on $IMGPATH"
                fi
        else
                echo "Share $1:$2 is already mounted!"
        fi
}

check_nfs()
{
        ENDARRAY=false
        N=1
        while [ $ENDARRAY = false ]
        do
                eval SHARE=\${SHARE_${N}}
                if [ -z "$SHARE" ]; then
                        ENDARRAY=true
                else
                        SERVER=`echo "$SHARE"|cut -d ':' -f1`
                        SHPATH=`echo "$SHARE"|cut -d ':' -f2`
                        echo -n "Check if server $SERVER is reachable..."
                        showmount --no-header -e $SERVER 1>/dev/null 2>&1
                        if [ $? = 0 ]; then
                                echo 'ok'
                                do_mount "$SERVER" "$SHPATH"
                        else
                                echo 'NOT reachable skip!'
#                                sleep 2
#                               echo `date`
                        fi
                        let N=N+1
                fi
        done
}

case $1 in 
        start)
        mkfs.vfat -C /dtv/vusb 500
        #echo `date`
        insmod $MOD_DIR/kernel/drivers/usb/gadget/dummy_hcd.ko
        check_nfs

        GFILESTORAGE='/dtv/vusb'
        if [ -e $PVRIMAGE ]; then
                GFILESIZE=`du $PVRIMAGE |cut -f1`
                if [ $GFILESIZE -ge 1536000 ]; then  
                        GFILESTORAGE="$GFILESTORAGE,$PVRIMAGE"
                        echo "Found pvrimage file $PVRIMAGE size=$GFILESIZE KByte, so enabling PVR Record over NFS"
                else 
                        echo "Found pvrimage file $PVRIMAGE size=$GFILESIZE KByte, but size is less than required (1536000 KBYTE), so PVR Record over NFS will not be enabled"    
                fi
        else
                echo "pvrimage $PVRIMAGE NOT found, so PVR Record over NFS will not be enabled"
        fi

        insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko file="$GFILESTORAGE"
        sleep 3

        FOUND=false
        SAMYGODEVS=''
        for i in /sys/block/sd?/device/model ; do
                if [ `cat $i | grep -c "SamyGO Virt"` -gt "0" ]; then
                        CURDEV="`echo $i | sed 's/^\/.*\(sd.\)\/.*/\1/g'`"
                        SAMYGODEVS="$SAMYGODEVS /dev/$CURDEV"
                        if [ $FOUND = false ]; then
                                echo "found gadget at: $i"
                                dev=$CURDEV
                                echo "scsidev: $dev"
                                FOUND=true
                        fi
                else
                        echo "real storage device at: $i"
                fi
        done
        SAMYGODEVS=`echo $SAMYGODEVS|sed 's/^[[:space:]]//'`

        sed -i -e "s,MountPlaceholder,/dtv/usb/$dev," /dtv/SGO.env
        echo "SAMYGODEVS=\"$SAMYGODEVS\"" >> /dtv/SGO.env
        ;;
        stop)
        rmmod g_file_storage
        rmmod dummy_hcd
        ;;
        status)
        cat /sys/block/sd?/device/model
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac

Code: Select all

# cat 03_03_nfsmount.remi71.init 
#!/bin/sh
#
# http://www.gnu.org/licenses/gpl-howto.html
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script.  If not, see <http://www.gnu.org/licenses/>.
#
# Copyleft by Remigio Conti 20110110 to allow mount from list of more than one fixed server
#       see: http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=12&t=1332&start=0
#

. /dtv/SGO.env

#
# NFS share in the form of:
#
# SHARE_n='<SERVER NAME or IP>:<SHARE>'
#
# For multiple share on the same server use multiple entry with the same server name.
#

SHARE_1='10.10.10.10:/samrec'
# SHARE_2='10.10.10.10:/dvd'

FR_NAME="NFS Server"
M_OPTS="soft,udp,async,nolock,rsize=32768,wsize=8192"
# M_OPTS="rw,soft,udp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=8192,wsize=8192"
# M_OPTS="soft,tcp,nolock"

DEST_DIR=$MOUNT_PATH/nfs

do_mount()
{
        #               $(echo -e "[sdg]\nVendor : NfsMount\nProduct : $FR_NAME\n\
        #Serial : Q80VQLFG\nDevpath : 7\nLun : 0\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/log)

        M_POINT="$DEST_DIR/$1/$(echo -n "$2" | 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" "$1:$2" "$M_POINT"
                if [ $? = 0 ]; then
                        echo "Share $1:$2 successfully mounted on $M_POINT" 
                else
                        echo "Error during mount of $1:$2 on $M_POINT"
                fi
        else
                echo "Share $1:$2 is already mounted!"
        fi
}

get_shares()
{
        ENDARRAY=false
        N=1
        while [ $ENDARRAY = false ]
        do
                eval SHARE=\${SHARE_${N}}
                if [ -z "$SHARE" ]; then
                        ENDARRAY=true
                else
                        SERVER=`echo "$SHARE"|cut -d ':' -f1`
                        SHPATH=`echo "$SHARE"|cut -d ':' -f2`
                        echo -n "Check if server $SERVER is reachable..."
                        showmount --no-header -e $SERVER 1>/dev/null 2>&1
                        if [ $? = 0 ]; then
                                echo 'ok'
                                do_mount "$SERVER" "$SHPATH"
                        else
                                echo 'NOT reachable skip!'
                                sleep 3 
                        fi
                        let N=N+1
                fi
        done
}


case $1 in 
        start)
        # for systems with modular nfs kernel support
        #echo `date`
        #insmod $MOD_DIR/kernel/net/sunrpc/sunrpc.ko
        #insmod $MOD_DIR/kernel/fs/lockd/lockd.ko
        #insmod $MOD_DIR/kernel/fs/nfs_common/nfs_acl.ko
        #insmod $MOD_DIR/kernel/fs/nfs/nfs.ko
        get_shares
        ;;
        stop)
        # may can fail if device access the mount from content library
        # for i in $(cat /proc/mounts | grep nfs | cut -d " " -f2) ; do
        for i in $(cat /proc/mounts | grep "$DEST_DIR" | sed 's/^\(.*\) \(.*\) nfs .*/\2/') ; do
                /bin/busybox umount $i
        done
        ;;
        status)
        /bin/mount | grep "$DEST_DIR"
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac

Code: Select all

# cat 80_80_record_to_nwshare.remi71.init 
#!/bin/sh
#
# ? Copyleft 1996-2011, ZsoltTech.Com
#       by Ser Lev Arris <arris@ZsoltTech.Com>
#       based on research of:
#               andy_nl:        http://sourceforge.net/apps/phpbb/samygo/memberlist.php?mode=viewprofile&u=1728
#               gipas:          http://sourceforge.net/apps/phpbb/samygo/memberlist.php?mode=viewprofile&u=1751
#       http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=12&t=1100&start=20#p10553
#
#       donated for the SamyGo Project
#       http://samygo.sourceforge.net/
#
# http://www.gnu.org/licenses/gpl-howto.html
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# 
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script.  If not, see <http://www.gnu.org/licenses/>.
#

# 
# TODO: more sysv style, more error handling
#
# Modified by Remigio Conti 20110110
#

. /dtv/SGO.env

# Remote NFS fileserver for recording 
PVRSERVER='10.10.10.10'

# Remote NFS share for recording
PVRPATH='/samrec'

# NFS mount options. If you experince problem like slow performance, try change this.
M_OPTS="soft,udp,nolock,rsize=32768,wsize=8192"
# M_OPTS="rw,soft,udp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=32768,wsize=32768"
# M_OPTS="soft,tcp,nolock,rsize=8192,wsize=8192"
# M_OPTS="soft,tcp,nolock"

# Number of second to wait for pvrimage mount point to be ready. 
# If you experience problem like "No virtual device found ready for PVR or already mounted" message in samygo.log then try to increase this.
 WAIT=5

WriteToLog ()
{
        case $2 in
                1)
                NOW=`date +%Y%m%d-%H%M%S`
                echo "$3" "$NOW $1" >>$LOGFILE
                ;;
                2)
                echo "$3" "$1" >>$LOGFILE
                ;;
        esac
}

CheckNFSServer ()
{
        WriteToLog "Check if server $1 is reachable and NFS service available..." 1 '-n'
        showmount --no-header -e $1 1>/dev/null 2>&1
        if [ $? = 0 ]; then
                WriteToLog 'OK' 2
                return 0
        else
                echo "NFS server $1 not reachable or NFS service not available"
                WriteToLog 'not reachable or NFS service not available' 2
                return 1
        fi
}

SearchPVRImageMP ()
{
        FOUND=false
        WriteToLog 'Search for mount point of pvrimage...' 1
        sleep $WAIT
        WriteToLog "sgd $SAMYGODEVS" 1
        for DEV in `echo $SAMYGODEVS`
        do
                MPOINT=`grep -e ^$DEV /proc/mounts | cut -d " " -f 2`
                if [ -e "$MPOINT/.PlaceHolderDO-NOT-REMOVE" ] && [ $FOUND = false ]; then
                        PVRMPOINT=$MPOINT
                        FOUND=true
                        WriteToLog "pvrimage mount point is $PVRMPOINT" 1
                fi
        done

}

MountNFSShare ()
{
        WriteToLog "Mount of $2:$3 on $4... " 1 '-n'
        /bin/busybox mount -o "$1" "$2:$3" "$4" 2>>$LOGFILE

        if [ $? = 0 ]; then
                WriteToLog 'OK' 2
                CONTENTSDIR="$4/CONTENTS"
                if ! [ -d "$CONTENTSDIR" ]; then
                        echo -n "Creating directory $CONTENTSDIR for the first time..."
                        WriteToLog "Creating directory $CONTENTSDIR for the first time..." 1 '-n'
                        mkdir "$CONTENTSDIR"
                        echo "OK"
                        WriteToLog 'OK' 2
                        echo -n "Creating .PVRPfmChkLog file..."
                        WriteToLog 'Creating .PVRPfmChkLog file...' 1 '-n'
                        echo '1' > "$CONTENTSDIR/.PVRPfmChkLog"
                        echo "OK"
                        WriteToLog 'OK' 2
                fi
                echo "PVR on server $2 is now ready in localpath $4"
                WriteToLog "PVR on server $2 is now ready in localpath $4" 1
        else
                echo "Error during mount of $2:$3 on $4 see $LOGFILE for details"
        fi
}

case $1 in 
        start)
        echo >$LOGFILE
##      echo `date`
        WriteToLog 'Start Record to Network Share script (80_80_record_to_nwshare.init)' 1
        CheckNFSServer "$PVRSERVER"
        if [ $? = 0 ]; then
                SearchPVRImageMP

                if [ $FOUND = true ]; then
                        MountNFSShare "$M_OPTS" "$PVRSERVER" "$PVRPATH" "$PVRMPOINT"      
                else
                        echo 'No virtual device found ready for PVR or already mounted'
                        WriteToLog 'No virtual device found ready for PVR or already mounted' 1
                fi 
        fi
        WriteToLog 'End Record to Network Share script (80_80_record_to_nwshare.init)' 1
        echo `date`
        ;;
        stop)
        echo "pls request it on forum"
        ;;
        status)
        echo "pls request it on forum"
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac
# 

with this modificated scripts the 1,5GB xfs image file can be stored on a nfs share and no additional space on usb-drive or tv-flash is needed
NFS Server is running W7x64 and Hanewin-NFS-service

cut here
[/hr]

just tested alternate method involving a ntfs image with compression enabled to place pvrimage in /mtd_rwcommon or usb-drive smaller than 1,5GB
ntfs-3g and fuse needed for this

had to change
order of init scripts vusb after fuse
place ntfs-3g mount of ntfsimage right after start in vusb script (we should create a own script for that later, maybe with unpacking it from gzip to /dtv/, then we should call the whole thing OnionPVR :mrgreen: ) tested, zipping/unzipping takes to long to justify the (significant) amount of saved space
disable size check of pvrimage (or use a different method to get filesize)

Code: Select all

# cat /dtv/rcSGO_out
+ sh -x /mtd_rwcommon/SamyGO/rcSGO /mtd_rwcommon/SamyGO
+ [ ! -e /dtv/SGO.env ]
+ alias .=source
+ [ ! -e /proc/mounts ]
+ cat /proc/version
+ sed -e s/\(.*inux version \)\(.*\) \(.*@.*\)$/\2/
+ KERN_VER=2.6.24_SELP.4.3.x-Cortex-A8
+ [ -x /etc/rc.early.local ]
+ [ -d /mtd_wiselink ]
+ NEW_HOME=/mtd_wiselink
+ [ ! -e /mtd_rwarea/passwd ]
+ mount -o bind /mtd_rwarea/passwd /etc/passwd
+ S_SCRIPT=echo Bummer >> /dev/kmsg
+ [ ! -z /mtd_rwcommon/SamyGO ]
+ [ -x /mtd_rwcommon/SamyGO/etc/rc.sysinit ]
+ SYSROOT=/mtd_rwcommon/SamyGO
+ S_SCRIPT=cd /mtd_rwcommon/SamyGO ; ./etc/rc.sysinit 2>&1 &
+ echo SYSROOT="/mtd_rwcommon/SamyGO"
+ echo MOUNT_PATH="MountPlaceholder"
+ echo export MOD_DIR=/mtd_rwcommon/SamyGO/lib/modules/2.6.24_SELP.4.3.x-Cortex-A8
+ echo export TMPDIR=/dtv
+ echo export HOME=/mtd_wiselink
+ echo export SMB_CONF_PATH="/mtd_rwcommon/SamyGO/etc/samba/smb.conf"
+ echo LOGFILE="/mtd_rwcommon/SamyGO/samygo.log"
+ eval cd /mtd_rwcommon/SamyGO ; ./etc/rc.sysinit 2>&1 &
+ cd /mtd_rwcommon/SamyGO
+ ./etc/rc.sysinit
Thu Jan 1 00:00:18 UTC 1970
mkfs.vfat 2.11 (12 Mar 2005)
Failed to create '/dev/fuse': Read-only file system
fuse: warning: library too old, some operations may not not work
Found pvrimage file /mtd_rwcommon/SamyGO/img/fu/pvrimage size=353 KByte, but size is less than required (1536000 KBYTE), so PVR Record over NFS will be enabled anyway
real storage device at: /sys/block/sda/device/model
found gadget at: /sys/block/sdb/device/model
scsidev: sdb
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...NOT reachable skip!
Check if server 10.10.10.10 is reachable...ok
Share 10.10.10.10:/samrec successfully mounted on /dtv/usb/sdb/nfs/10.10.10.10/_samrec
PVR on server 10.10.10.10 is now ready in localpath /dtv/usb/sdc
Thu Jan 1 00:00:48 UTC 1970
# ll /dtv/usb/sdc
drwxr-xr-x    2 root     0            4096 Jan 19  2014 CONTENTS
drwxr-xr-x    2 root     0            4096 Dec  1  2012 DVD
drwxr-xr-x    2 root     0            4096 Dec 30  2013 config
drwxr-xr-x    2 root     0            4096 Dec 13  2012 database
-rw-r--r--    1 root     0       105067861 Jan 18  2014 widgetbackup.rar
#
please test for yourself :)

regarding the size check: i changed

Code: Select all

		GFILESIZE=`du $PVRIMAGE |cut -f1`
		if [ $GFILESIZE -ge 1536000 ]; then  	
to

Code: Select all

		GFILESIZE=`ls -l $PVRIMAGE | sed -e "s/ \+ / /g" | cut -d' ' -f5`
		if [ $GFILESIZE -ge 1572864000 ]; then  	
as ls prints the theoretical size of our imagefile other than du which prints the used space (and parameter du -b isn't implemented yet)

and this is my mountscript
SpoilerShow

Code: Select all

#!/bin/sh
# 03_01_ntfspvrimg.init
#
. /dtv/SGO.env

IMG_NTFS="$SYSROOT/pvrntfs.img"
NTFS_MP="$SYSROOT/img"

case $1 in 
    start)
	if [ -e $IMG_NTFS ]; then
		echo "ntfsmage $IMG_NTFS found, mounting it on $NTFS_MP"
		ntfs-3g $IMG_NTFS $NTFS_MP
	else
		echo "ntfsmage $IMG_NTFS NOT found, so we won't have a compressed pvrimage available"
	fi

	;;
    stop)
    	$SYSROOT/bin/busybox umount $NTFS_MP
	;;
    status)
	;;
    *)
    echo "Usage: $0 {start|stop}" 1>&2
    exit 0
    ;;
esac
P.S. the attached image only works with newer version of ntfs-3g, see viewtopic.php?f=21&t=4985&p=54402#p54399
You do not have the required permissions to view the files attached to this post.
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.
TeHashX
SamyGO Project Donor
Posts: 43
Joined: Wed Apr 17, 2013 8:18 am
Location: Europe

Re: SamyGo Extension Pack modified for NFS recording

Post by TeHashX »

Someone managed to make it work on E series tv?
coyotee
Posts: 15
Joined: Wed Nov 30, 2011 6:04 am

Re: SamyGo Extension Pack modified for NFS recording

Post by coyotee »

Hello! Is this forum still active?

Post Reply

Return to “[C] Software”