Page 2 of 3

Re: Pvr over Nfs

Posted: Sun Aug 25, 2013 11:37 am
by ocean
Is it maybe possible to send the remote key for "exit" after the usb-devices are announced?
Does anybody know how to send a remote in one of our scripts?

Re: Pvr over Nfs

Posted: Tue Aug 27, 2013 5:30 am
by juusso
or patch exedsp to don't show new device connected message?

Re: Pvr over Nfs

Posted: Tue Aug 27, 2013 7:24 am
by ocean
@juuso: Then I need a little "how-to-patch-exedsp"-workshop :?

Re: Pvr over Nfs

Posted: Tue Aug 27, 2013 7:32 am
by juusso
ocean wrote:@juuso: Then I need a little "how-to-patch-exedsp"-workshop :?
yah, me too :?

Briefly:
1. Take IDA and disasemble exeDSP code
2. Find required function
3. Patch it to do nothing instead of showing "new usb device connected" message.
4. Use memjack to inject code to exeDSP in first script of SamyGO Extensions
5. Done.

Someone could help us (maybe need another topic for it?, like you said - workshop...) :roll:

Re: Pvr over Nfs

Posted: Tue Aug 27, 2013 7:43 am
by ocean

Re: Pvr over Nfs

Posted: Tue Oct 01, 2013 6:14 pm
by many15
Thank you very much for you answer, ocean!
I have setted up NFS Share on Windows 7 following this tutorial > http://www.sysprobs.com/configure-set-n ... vmware-esx
Can you tell me please what i must do, step by step to record on NFS.
ES Series. SamyGo installed. Rooted.
Thanks in advance!

Re: Pvr over Nfs

Posted: Tue Oct 01, 2013 6:49 pm
by ocean
First of all you need to read wiki how to work with the init-scripts on your tv... nobody will give you an exact step by step tutorial to get it run.
For the script you see here you need to change 03_03_nfsshare.init on your tv. For recordshare you change that position in script to your share you configured with your tutorial above...

Re: Pvr over Nfs

Posted: Tue Nov 05, 2013 9:40 pm
by ocean
Little update for all the guys that want to do more than 1 Movie-Share...
with this you're able to mount up to 5 shares and 1 recordshare...

Code: Select all

    #!/bin/sh
    
    ######################### Some Variables ##########################
	# Aka name first usb-device with 1 partition
	 V_USB1="sdi"; V_USB2="sdj"; V_USB3="sdk"; V_USB4="sdl"; V_USB5="sdm";
	 
	 R_USB="sdr"		# Aka name record-device
    ###################################################################
	
	sed -i -e "s,MountPlaceholder,/dtv/usb/," /dtv/SGO.env

    . /dtv/SGO.env

	
	# RECORDSHARE='<ServerIP> :                 <SHAREPATH>                 :<NAME_OF_MOUNT>'
	  RECORDSHARE='192.168.2.2:/var/media/ftp/Nfs-Platte/Recorder/Schlafzimmer:Recorder'
	  
	#SHARE_X=' <ServerIP>:          <SHAREPATH>          :<NAME_OF_MOUNT>' X 1 up to 5 Shares
          SHARE_1='192.168.2.2:/var/media/ftp/Nfs-Filme/Videos:Movies'
	  SHARE_2='192.168.2.2:/var/media/ftp/Nfs-Platte/Recorder/Wohnzimmer/CONTENTS:Wohnzimmer'
	  SHARE_3='192.168.2.2:/var/media/ftp/Nfs-Platte/Fotos:Fotos'
    
    M_OPTS="soft,tcp,nolock"

    SERVERS="Don't set me!!"

	RECDIR=/dtv/usb/$R_USB
	echo "RECDIR=$RECDIR" >> /dtv/SGO.env

    do_mount()
    {
	eval DEST_DIR_${4}="\$MOUNT_PATH""\$V_USB${4}"
	eval echo "DEST_DIR_${4}=\$DEST_DIR_${4}" >> /dtv/SGO.env
    if [ -n "$3" ]; then
		#eval M_POINT${4}="\$DEST_DIR_${4}/$3" # mit Ordnernamen
		eval M_POINT${4}="\$DEST_DIR_${4}" 	# direkt im NFS-Usb
	else
		eval M_POINT${4}="\$DEST_DIR_${4}/$1/$(echo -n "$2" | sed -e "s/\//_/g")"
	fi
	
	eval mkdir -p "\$M_POINT${4}"
	eval POINT="\$M_POINT${4}"
       if [ `cat /proc/mounts | grep -c "$POINT"` -lt "1" ] ; then
          /bin/busybox mount -o "$M_OPTS" "$1:$2" "$POINT"
          if [ $? = 0 ]; then
            eval echo "Share $1:$2 successfully mounted on $POINT"
          else
            eval echo "Error during mount of $1:$2 on $POINT"
          fi
       else
          echo "Share $1:$2 is already mounted!"
       fi
    }
	
	mount_record()
    {
	if [ -n "$RECORDSHARE" ]; then

			M_POINTREC="$RECDIR"
		
		mkdir -p "$M_POINTREC"
		   if [ `cat /proc/mounts | grep -c "$M_POINTREC"` -lt "1" ] ; then
			  /bin/busybox mount -o "$M_OPTS" "$1:$2" "$M_POINTREC"
			  if [ $? = 0 ]; then
				 mount -t xfs -o loop "$RECDIR"/PVR/pvrimage" "$RECDIR"/PVR/Schlafzimmer"
				 echo "Share $1:$2 successfully mounted on $M_POINTREC"
			  else
				 echo "Error during mount of $1:$2 on $M_POINTREC"
			  fi
		   else
			  echo "Share $1:$2 is already mounted!"
		   fi
	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`
			 SHNAME=`echo "$SHARE"|cut -d ':' -f3`	 
			 
             echo -n "Check if server $SERVER is reachable..."
             showmount --no-header -e $SERVER 1>/dev/null 2>&1
             if [ $? = 0 ]; then
                echo 'ok'
				eval USB_NAME${N}="$SHNAME"
                do_mount "$SERVER" "$SHPATH" "$SHNAME" "$N"
             else
                echo 'NOT reachable skip!'
             fi
             let N=N+1
          fi
       done
	   
	   if [ -n "$RECORDSHARE" ]; then
	   
			 RECSERVER=`echo "$RECORDSHARE"|cut -d ':' -f1`
             RECSHPATH=`echo "$RECORDSHARE"|cut -d ':' -f2`
			 REC_NAME=`echo "$RECORDSHARE"|cut -d ':' -f3`
			 
			echo -n "Check if server $RECSERVER is reachable..."
             showmount --no-header -e $RECSERVER 1>/dev/null 2>&1
			 
             if [ $? = 0 ]; then
				RECAVAIL=true
                echo 'ok'
                mount_record "$RECSERVER" "$RECSHPATH"
				sleep 5
             else
                echo "$RECSERVER NOT reachable skip!"
				RECAVAIL=false
             fi
		  else
			echo "No Record-Share available!"
		fi	
    }

    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
    }

    anounce_usb()
    {
       if [ -e /dtv/usb/usblog ] ; then
          echo ""
       else
          touch /dtv/usb/usblog
       fi
       #if [ `cat /dtv/usb/usblog | grep -c "$V_USB"` -lt "1" ] ; then

        #  cp -f /dtv/usb/usblog /dtv/usb/usblog.bak
		
		####  VIRTUALUSB "Multishares"  ####
		
	   ENDARRAY=false
       N=1
       while [ $ENDARRAY = false ]
       do
          eval SHARE=\${SHARE_${N}}
          if [ -z "$SHARE" ]; then
             ENDARRAY=true
          else
			 eval POINT="\$M_POINT${N}";eval USB="\$V_USB${N}";eval NAME="\$USB_NAME${N}";
			 eval DPATH="\1${N}.1"; eval DEST_DIR="\$DEST_DIR_${N}"
			 
             if [ `cat /proc/mounts | grep -c "$POINT"` > "0" ] ; then
             echo -e "[$USB]\nVendor : Home${N}\nProduct : $NAME\nSerial : 30${N}22011\nDevpath : $DPATH\n\
Lun : 0\nScsiDevicePath : /dev/${USB}1\nMountDir : ${DEST_DIR}\nFileSystem : vfat\n" >> /dtv/usb/usblog
		  
		  else
            eval echo "Share${4} not mounted!"
          fi
		  
             let N=N+1
          fi
       done
	
		####  VIRTUALUSB "RECORDER"  ####
		eval DPATH="\1${N}.1"
		if [ -n "$RECORDSHARE" ]; then
		
		  if [ `cat /proc/mounts | grep -c "$M_POINTREC"` > "0" ] && [ $RECAVAIL = true ] ; then
             echo -e "[$R_USB]\nVendor : Home\nProduct : $REC_NAME\nSerial : 21052013\nDevpath : $DPATH\n\
Lun : 0\nScsiDevicePath : /dev/${R_USB}1\nMountDir : $RECDIR\nFileSystem : xfs\n" >> /dtv/usb/usblog

          else
             echo "Record-Share not mounted!"
          fi
        fi
#	  fi
    }


    case $1 in
       start)
       insmod $MOD_DIR/kernel/net/sunrpc/sunrpc.ko
       insmod $MOD_DIR/kernel/fs/lockd/lockd.ko
       insmod $MOD_DIR/kernel/fs/nfs/nfs.ko
       get_servers
       get_shares
       anounce_usb
       ;;
       stop)
       # may can fail if device access the mount from content library
       # for i in $(cat /proc/mounts | grep nfs | cut -d " " -f2) ; do
       # cp -f /dtv/usb/usblog.bak /dtv/usb/usblog
       for i in $(cat /proc/mounts | grep "$DEST_DIR_1" | sed 's/^\(.*\) \(.*\) nfs .*/\2/') ; do
          /bin/busybox umount $i
       done
	   for i in $(cat /proc/mounts | grep "$DEST_DIR_2" | sed 's/^\(.*\) \(.*\) nfs .*/\2/') ; do
          /bin/busybox umount $i
       done
	   
	   for i in $(cat /proc/mounts | grep "$RECDIR" | sed 's/^\(.*\) \(.*\) nfs .*/\2/') ; do
          /bin/busybox umount $i
       done
       ;;
       status)
       /bin/mount | grep "$DEST_DIR_1"
	   /bin/mount | grep "$DEST_DIR_2"
	   echo "Multishare-Status not implemented at all!!!"
	   /bin/mount | grep "$RECDIR"
       ;;
       *)
       echo "Usage: $0 {start|stop|status}" 1>&2
       exit 0
       ;;
    esac
Greetings ocean

Re: Pvr over Nfs

Posted: Wed Nov 06, 2013 7:59 pm
by 60plus
@ocean,

the skript works fine, thank you.


mfg

60plus

Re: Pvr over Nfs

Posted: Sun Dec 29, 2013 9:53 pm
by Joejoe
Hi ocean,

After I got in the F-Series Section (viewtopic.php?f=66&t=7007) still no response, I have searched through the other sections and came across your post.
I have adopted and adapted your script like this:

Code: Select all

   # RECORDSHARE='<ServerIP> :                 <SHAREPATH>                 :<NAME_OF_MOUNT>'
     RECORDSHARE='192.168.0.100:/volume1/Samsung-Aufnahme:Recorder'
     
   #SHARE_X=' <ServerIP>:          <SHAREPATH>          :<NAME_OF_MOUNT>' X 1 up to 5 Shares
     SHARE_1='192.168.0.100:/volume1/Videos/DVBLink-Aufnahmen:DVBLink-Aufnahmen'
     SHARE_2='192.168.0.100:/volume1/Videos:Videos'
     SHARE_3='192.168.0.100:/volume1/Photos:Fotos'
And so on:

Code: Select all

   mount_record()
    {
   if [ -n "$RECORDSHARE" ]; then

         M_POINTREC="$RECDIR"
      
      mkdir -p "$M_POINTREC"
         if [ `cat /proc/mounts | grep -c "$M_POINTREC"` -lt "1" ] ; then
           /bin/busybox mount -o "$M_OPTS" "$1:$2" "$M_POINTREC"
           if [ $? = 0 ]; then
             mount -t ext4 -o loop "$RECDIR"/samsung.img "$RECDIR"/PVR         #This is the line I have changed
             echo "Share $1:$2 successfully mounted on $M_POINTREC"
           else
             echo "Error during mount of $1:$2 on $M_POINTREC"
           fi
         else
           echo "Share $1:$2 is already mounted!"
         fi
   fi   
    }
The 3 USB-Devices for DVBLink-Aufnahmen, Videos and Fotos are available and I can view my movies and photos.

I try to mount a file (samsung.img) that is formatted as ext4 to the PVR folder. Its size is 10GiB. But I don't understand the context / relationship.

My TV shows a USB device with harddisk icon but when I try to use timeshift comes the message: "Memory below 1GB or no support of read-only"

Where is my problem / error?

Greetz Joe