and there is also a neccesary size for the recording point arround 1,5 GB and has to be XFS (these restrictions are removed by widget)
there is nothing like iscsi or usbremote that can be mounted as a recording store. Basicaly there is no limit for the VirtualUSB exept aviable space? can it be 20MB? or should i expect any problems with a file big like this?
Got a file 16 MB size with an 1.6 GB xfs partition that works with g_file_storage and is possible to record on
dd if=/dev/zero of=XFSIMAGE bs=1M count=18 #This will be the container for the PVR Image Needs to be 18MB for formating
mkfs.xfs XFSIMAGE #Format with a FS that Supports Sparsefile
dd if=/dev/zero of=PVRIMAGE bs=1M count=1 seek=1536 #Create a Sparsefile (12 MB after formatting)
dd if=/dev/zero of=PVRIMAGE bs=1 count=1 seek=1536000000 #Create a Sparsefile smallest size (11 MB after formatting)
mkfs.xfs PVRIMAGE -L PVRIMAGE #Formats it with XFS for recording
modprobe g_file_storage file=PVRIMAGE #load as VUSB
here is a mod of remi71 init script which works on my TV with the record to NW share from remi71 would some of the Devs leave a comment about possible trouble from my point its only that it will consume 17MB space
02_04_vusb.vpvrimage.init
Code: Select all
#!/bin/sh
. /dtv/SGO.env
case $1 in 
	start)
	[ -e $SYSROOT/etc/init.d/02_04_vusb.init ] && exit 1
	[ ! -e $SYSROOT/etc/init.d/03_03_nfsmount.init ] && exit 1
	[ ! -e $SYSROOT/etc/init.d/80_80_record_to_nwshare.init ] && exit 1
	mkfs.vfat -C /dtv/vusb 500
	insmod $MOD_DIR/kernel/drivers/usb/gadget/dummy_hcd.ko || \
	insmod $MOD_DIR/kernel/drivers/mstar/usb/gadget/dummy_hcd.ko
	XFSIMAGE=""$SYSROOT"/xfsimage"
	XFSMOUNT="/dtv/xfsmount"
	PVRIMAGE=""$XFSMOUNT"/pvrimage"
	PVRMOUNT=""$XFSMOUNT"/pvrmount"
	GFILESTORAGE="/dtv/vusb"
	[ ! -d $XFSMOUNT ] && mkdir $XFSMOUNT
	[ ! -f $XFSIMAGE ] && dd if=/dev/zero of=$XFSIMAGE bs=1M count=17 status=noxfer 2>/dev/null
	mkfs.xfs -qf $XFSIMAGE
	cat /proc/mounts | grep -q "$XFSMOUNT" || /bin/busybox mount -o loop $XFSIMAGE $XFSMOUNT
	if [ ! -f $PVRIMAGE ]; then
		dd if=/dev/zero of="$PVRIMAGE" bs=1M count=1 seek=1536 status=noxfer 2>/dev/null
		mkfs.xfs "$PVRIMAGE"
		mkdir -p "$PVRMOUNT"
		/bin/busybox mount -o loop "$PVRIMAGE" "$PVRMOUNT"
		touch ""$PVRMOUNT"/.PlaceHolderDO-NOT-REMOVE"
		/bin/busybox umount "$PVRMOUNT"
	fi
	[ -e $PVRIMAGE ] && GFILESTORAGE="$GFILESTORAGE,$PVRIMAGE"
	
	insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko file="$GFILESTORAGE" || \
	insmod $MOD_DIR/kernel/drivers/mstar/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
	# some troubles if we mess around with dummy_hcd, so not remove on stop
	# rmmod dummy_hcd
	;;
	status)
	cat /sys/block/sd?/device/model
	;;
	*)
	echo "Usage: $0 {start|stop|status}" 1>&2
	exit 0
	;;
esac