Page 1 of 2

ntfs-3g for T-VALDEUC

Posted: Sun Jan 19, 2014 6:50 pm
by beatfreak
moving here from viewtopic.php?f=21&t=4985&start=20#p54390

until i can find a proper ntfs-3g binary that is compiled for using external fuse (which is already included in SamyGO-Extensions) i'll try to compile it on my own
i have to say that all i have compiled before in my life is viewtopic.php?f=12&t=7033#p53371
sources are from
http://tuxera.com/opensource/ntfs-3g_nt ... 3.1.13.tgz
at the moment i am here:

Code: Select all

b3nz0l@BlackjackLNX:~/Downloads/scct/src/ntfs3g> ./configure --with-fuse=external --disable-ntfsprogs --prefix=/home/b3nz0l/Downloads/scct/out1 --exec-prefix=/home/b3nz0l/Downloads/scct/out2 --host=armv7fl-montavista-linux-gnueabi CC=/home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-suse-linux-gnu
checking host system type... armv7fl-montavista-linux-gnueabi
checking target system type... armv7fl-montavista-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for armv7fl-montavista-linux-gnueabi-strip... no
checking for strip... strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for armv7fl-montavista-linux-gnueabi-gcc... /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc accepts -g... yes
checking for /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc... gcc3
checking whether ln -s works... yes
checking whether /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc... /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/armv7fl-montavista-linux-gnueabi/bin/ld
checking if the linker (/home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/armv7fl-montavista-linux-gnueabi/bin/ld) is GNU ld... yes
checking for /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/armv7fl-montavista-linux-gnueabi/bin/ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for armv7fl-montavista-linux-gnueabi-g++... no
checking for armv7fl-montavista-linux-gnueabi-c++... no
checking for armv7fl-montavista-linux-gnueabi-gpp... no
checking for armv7fl-montavista-linux-gnueabi-aCC... no
checking for armv7fl-montavista-linux-gnueabi-CC... no
checking for armv7fl-montavista-linux-gnueabi-cxx... no
checking for armv7fl-montavista-linux-gnueabi-cc++... no
checking for armv7fl-montavista-linux-gnueabi-cl.exe... no
checking for armv7fl-montavista-linux-gnueabi-FCC... no
checking for armv7fl-montavista-linux-gnueabi-KCC... no
checking for armv7fl-montavista-linux-gnueabi-RCC... no
checking for armv7fl-montavista-linux-gnueabi-xlC_r... no
checking for armv7fl-montavista-linux-gnueabi-xlC... no
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking for armv7fl-montavista-linux-gnueabi-g77... no
checking for armv7fl-montavista-linux-gnueabi-xlf... no
checking for armv7fl-montavista-linux-gnueabi-f77... no
checking for armv7fl-montavista-linux-gnueabi-frt... no
checking for armv7fl-montavista-linux-gnueabi-pgf77... no
checking for armv7fl-montavista-linux-gnueabi-cf77... no
checking for armv7fl-montavista-linux-gnueabi-fort77... no
checking for armv7fl-montavista-linux-gnueabi-fl32... no
checking for armv7fl-montavista-linux-gnueabi-af77... no
checking for armv7fl-montavista-linux-gnueabi-xlf90... no
checking for armv7fl-montavista-linux-gnueabi-f90... no
checking for armv7fl-montavista-linux-gnueabi-pgf90... no
checking for armv7fl-montavista-linux-gnueabi-pghpf... no
checking for armv7fl-montavista-linux-gnueabi-epcf90... no
checking for armv7fl-montavista-linux-gnueabi-gfortran... no
checking for armv7fl-montavista-linux-gnueabi-g95... no
checking for armv7fl-montavista-linux-gnueabi-xlf95... no
checking for armv7fl-montavista-linux-gnueabi-f95... no
checking for armv7fl-montavista-linux-gnueabi-fort... no
checking for armv7fl-montavista-linux-gnueabi-ifort... no
checking for armv7fl-montavista-linux-gnueabi-ifc... no
checking for armv7fl-montavista-linux-gnueabi-efc... no
checking for armv7fl-montavista-linux-gnueabi-pgf95... no
checking for armv7fl-montavista-linux-gnueabi-lf95... no
checking for armv7fl-montavista-linux-gnueabi-ftn... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 1572864
checking command to parse nm output from /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc object... ok
checking for objdir... .libs
checking for armv7fl-montavista-linux-gnueabi-ar... no
checking for ar... ar
configure: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org.
checking for armv7fl-montavista-linux-gnueabi-ranlib... no
checking for ranlib... ranlib
checking for armv7fl-montavista-linux-gnueabi-strip... strip
checking if /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc option to produce PIC... -fPIC
checking if /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc PIC flag -fPIC works... yes
checking if /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc static flag -static works... yes
checking if /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc supports -c -o file.o... yes
checking whether the /home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/bin/arm_v7_vfp_le-gcc linker (/home/b3nz0l/Downloads/scct/dcct/arm_v7_vfp_le/armv7fl-montavista-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
checking for a BSD-compatible install... /usr/bin/install -c
checking for armv7fl-montavista-linux-gnueabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for mv... /usr/bin/mv
checking for rm... /usr/bin/rm
checking for sed... /usr/bin/sed
checking for ldconfig... /sbin/ldconfig
checking Windows OS... no
checking fuse compatibility... external
checking for FUSE_MODULE... no
configure: error: FUSE >= 2.6.0 was not found. Either older FUSE is still present, or FUSE is not fully installed (e.g. fuse, libfuse, libfuse2, libfuse-dev, etc packages). Source code: http://fuse.sf.net
b3nz0l@BlackjackLNX:~/Downloads/scct/src/ntfs3g>
and don't know how to tell configure that it won't find fuse here...
or do i need to tell configure that i don't want to compile fuse here?

Re: ntfs-3g for T-VALDEUC

Posted: Sun Jan 19, 2014 9:07 pm
by juusso
./configure --with-fuse=external

but better you compiled and included that fuse libs to toolchain... possible w/o this you don't get ntfs 3g properly compiled.

Re: ntfs-3g for T-VALDEUC

Posted: Sun Jan 19, 2014 9:43 pm
by beatfreak
ok, lets continue here,

with the binary you compiled and new dd images of partitions on a vmdk created with winxp

Code: Select all

# cd /dtv
# ll
-r--r--r--    1 root     0               0 Jan  1  1970 PART_FLAG_0
-rw-r--r--    1 root     0             894 Jan  1  1970 SGO.env
drwxr-xr-x    2 root     0              80 Jan  1  1970 YWE
-rw-r--r--    1 root     0             248 Jan 19 12:04 camd.log
-rw-r--r--    1 root     0               4 Jan 19 12:04 dropbear.pid
crw-rw-rw-    1 root     0         10, 229 Jan 19 12:04 fuse
-rw-r--r--    1 root     0              10 Jan  1  1970 info
-rw-r--r--    1 root     0               0 Jan  1  1970 locked
drwxr-xr-x    2 root     0            4096 Jan 19 20:05 mnt
-rwxr-xr-x    1 root     0             581 Jan 19 16:21 nmount.sh
drwxr-xr-x    2 root     0              40 Jan 19 16:20 ntfs
-rw-r--r--    1 root     0            1351 Jan 19 12:04 oscam.log
-rw-r--r--    1 root     0               4 Jan 19 12:04 oscam.pid
-rw-r--r--    1 root     0               0 Jan  1  1970 pcm_in
-rw-r--r--    1 root     0               0 Jan  1  1970 pcm_out
-rw-r--r--    1 root     0            2211 Jan 19 12:04 rcSGO_out
srwxr-xr-x    1 root     0               0 Jan  1  1970 socket
drwxr-xr-x    6 root     0             140 Jan 19 20:11 usb
-rw-r--r--    1 root     0               0 Jan  1  1970 video_in
-rw-r--r--    1 root     0               0 Jan  1  1970 video_out
-rw-r--r--    1 root     0          512000 Jan 19 12:04 vusb
# ll mnt
-rw-r--r--    1 root     0        67110960 Jan 18 13:59 PVRIMG2.img
-rw-r--r--    1 root     0             307 May  3  2013 ctm.cmd
-r-xr-xr-x    1 root     0               0 Apr 18  2013 full_bg_rev.bmp
-rw-r--r--    1 root     0       131572224 Jan 19 20:56 ntest1.img
-rw-r--r--    1 root     0       131604480 Jan 19 20:57 ntest2.img
-rw-r--r--    1 root     0        67108864 Jan 19 18:33 ntfsimg
-rwxr-xr-x    1 root     0       1572864000 Jan 16 21:38 pvrimage2
-rw-r--r--    1 root     0          790791 Jan 16 22:35 smygo.rar
-rw-r--r--    1 root     0       1610612736 Jan 18 17:25 testimg
-rw-r--r--    1 root     0               6 Jan 16 22:04 timefile
# md ntest1
# ll          
-r--r--r--    1 root     0               0 Jan  1  1970 PART_FLAG_0
-rw-r--r--    1 root     0             894 Jan  1  1970 SGO.env
drwxr-xr-x    2 root     0              80 Jan  1  1970 YWE
-rw-r--r--    1 root     0             248 Jan 19 12:04 camd.log
-rw-r--r--    1 root     0               4 Jan 19 12:04 dropbear.pid
crw-rw-rw-    1 root     0         10, 229 Jan 19 12:04 fuse
-rw-r--r--    1 root     0              10 Jan  1  1970 info
-rw-r--r--    1 root     0               0 Jan  1  1970 locked
drwxr-xr-x    2 root     0            4096 Jan 19 20:05 mnt
-rwxr-xr-x    1 root     0             581 Jan 19 16:21 nmount.sh
drwxr-xr-x    2 root     0              40 Jan 19 21:12 ntest1
drwxr-xr-x    2 root     0              40 Jan 19 16:20 ntfs
-rw-r--r--    1 root     0            1351 Jan 19 12:04 oscam.log
-rw-r--r--    1 root     0               4 Jan 19 12:04 oscam.pid
-rw-r--r--    1 root     0               0 Jan  1  1970 pcm_in
-rw-r--r--    1 root     0               0 Jan  1  1970 pcm_out
-rw-r--r--    1 root     0            2211 Jan 19 12:04 rcSGO_out
srwxr-xr-x    1 root     0               0 Jan  1  1970 socket
drwxr-xr-x    6 root     0             140 Jan 19 20:11 usb
-rw-r--r--    1 root     0               0 Jan  1  1970 video_in
-rw-r--r--    1 root     0               0 Jan  1  1970 video_out
-rw-r--r--    1 root     0          512000 Jan 19 12:04 vusb
# md ntest2
# ntfs-3g /dtv/mnt/ntest1.img /dtv/ntest1
Failed to create '/dev/fuse': Read-only file system
fuse: warning: library too old, some operations may not not work
# ntfs-3g /dtv/mnt/ntest2.img /dtv/ntest2
Failed to create '/dev/fuse': Read-only file system
fuse: warning: library too old, some operations may not not work
# ll ntest1
drwxrwxrwx    1 root     0               0 Jan 19 19:48 System Volume Information
drwxrwxrwx    1 root     0               0 Jan 19 19:49 nozip
# ll ntest2
drwxrwxrwx    1 root     0               0 Jan 19 19:49 System Volume Information
drwxrwxrwx    1 root     0               0 Jan 19 19:49 zip
# umount ntest1
# umount ntest2
# ll ntest2
# ll ntest1
# ntfs-3g /dtv/mnt/ntest1.img /dtv/ntest1
Failed to create '/dev/fuse': Read-only file system
fuse: warning: library too old, some operations may not not work
# ntfs-3g /dtv/mnt/ntest2.img /dtv/ntest2
Failed to create '/dev/fuse': Read-only file system
fuse: warning: library too old, some operations may not not work
# cp /mtd_wiselink/SamyGO/img/pvrimage /dtv/ntest1/nozip/
# cp /mtd_wiselink/SamyGO/img/pvrimage /dtv/ntest2/zip/
# 
# ls -alR ntest1
ntest1:
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 .
drwxrwxrwt    8 root     0             540 Jan 19 21:13 ..
drwxrwxrwx    1 root     0               0 Jan 19 19:48 System Volume Information
drwxrwxrwx    1 root     0             152 Jan 19 21:15 nozip

ntest1/System Volume Information:
drwxrwxrwx    1 root     0               0 Jan 19 19:48 .
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 ..
-rwxrwxrwx    2 root     0               0 Jan 19 19:48 MountPointManagerRemoteDatabase

ntest1/nozip:
drwxrwxrwx    1 root     0             152 Jan 19 21:15 .
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 ..
-rwxrwxrwx    1 root     0       1572864000 Jan 19 21:22 pvrimage
# ls -alR ntest2
ntest2:
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 .
drwxrwxrwt    8 root     0             540 Jan 19 21:13 ..
drwxrwxrwx    1 root     0               0 Jan 19 19:49 System Volume Information
drwxrwxrwx    1 root     0             152 Jan 19 21:23 zip

ntest2/System Volume Information:
drwxrwxrwx    1 root     0               0 Jan 19 19:49 .
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 ..
-rwxrwxrwx    2 root     0               0 Jan 19 19:49 MountPointManagerRemoteDatabase

ntest2/zip:
drwxrwxrwx    1 root     0             152 Jan 19 21:23 .
drwxrwxrwx    1 root     0            4096 Jan 19 19:49 ..
-rwxrwxrwx    1 root     0       1572864000 Jan 19 21:31 pvrimage
# 
ntest1 has compression activated for the whole partition and ntest2 only for folder "zip"

i'll see if pvrimage fits into 64 or 32 MB image :)

then a few modifications to remis71 vusb script the xfs image will finally fit into /mtd_rwcommon

Re: ntfs-3g for T-VALDEUC

Posted: Sun Jan 19, 2014 10:11 pm
by juusso
you don't use ntfs, why then the ntfs-3d is needed at all?

Re: ntfs-3g for T-VALDEUC

Posted: Mon Jan 20, 2014 7:06 pm
by beatfreak
i am using a partition image file with ntfs and compression enabled, i need ntfs-3g to have it mounted rw as i want to place pvrimage there, this way 1,5GB pvrimage fits into 64MB ntfs-image which fits into ~200MB (free space) rwcommon

successful tested, updating it to viewtopic.php?f=12&t=1332&p=52940#p52940

Re: ntfs-3g for T-VALDEUC

Posted: Mon Feb 10, 2014 11:36 pm
by Cichas
BTW:
1) You can store the pvrimage on NFS (or Samba if you prefer slow playback start) - it will waste space there but it should not be problem.
Something like:

Code: Select all

mkdir -p /tmp/xfs
mount -t nfs -o tcp,soft,nolock 10.0.0.2:/RECORDING /tmp/xfs
mkfs.xfs -f -d file,name=/tmp/xfs/pvrimage,size=1536m
insmod dummy_hcd.ko
insmod g_file_storage.ko file=/tmp/xfs/pvrimage
mount -o bind /tmp/xfs /dtv/usb/sdb
2) If I am right then using xfs (supported by device already!) for storing fake empty 1,5G pvrimage will take only ~20MB which is less then in your case.

Re: ntfs-3g for T-VALDEUC

Posted: Tue Feb 11, 2014 5:58 pm
by beatfreak
1) this was like i had it before (see viewtopic.php?f=12&t=1332&hilit=remis71&start=80#p52940) and as it is a Win based server i used native ntfs compression there

2) as xfs is not a compressed filesystem i doubt that a 1,5GB "sparse" file will only occupy ~20MB but i'd love to be proven wrong ;)

with ntfs-3g there are nor more special requirements to nfs-server in combination with compressed image
and xfs image is ready and mounted before network is available at boot time...

Re: ntfs-3g for T-VALDEUC

Posted: Tue Feb 11, 2014 11:47 pm
by mmhorda
2 beatfreak

I have it succesfully working without pvrimage for 1.5gb but on ES model. somehow I never bothered to check it on C because it was already working.
you can check if it works.

rename your original 03_03_nfsmount.init to 03_03_nfsmount.init.dis and 02_04_vusb.init to 02_04_vusb.init.dis and 80_80_record_to_nwshare.init to 80_80_record_to_nwshare.init.dis

and copy this to the new created 03_03_nfsmount.init

Code: Select all


#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
#       by Ser Lev Arris <arris@ZsoltTech.Com>
#
#       donated for the SamyGo Project
#       http://samygo.sourceforge.net/
#       depending on some other coders of the samygo-forum and also on
#       Version: SamyGO svn $Id: 03_03_nfsmount.init 1069 2013-07-08 16:47:24Z arris69 $

#############-Some Variables-####################
V_USB="sdj"           # Aka name usb-device with 1 partition
R_USB="sdk"           # Aka name record-device
USB_NAME="SamyGO Virt. USB 1"          # symbolic name of usb-device
REC_NAME="SamyGO Virt. USB 2"          # symbolic name of record-device
###############################################

sed -i -e "s,MountPlaceholder,/dtv/usb/${V_USB}," /dtv/SGO.env
sed -i -e "s,MountPlaceholder,/dtv/usb/${R_USB}," /dtv/SGO.env

. /dtv/SGO.env

# Share_X = '<ServerIP>:<SHAREPATH>:<NAME_OF_MOUNT>'
# RECORDSHARE='<ServerIP>:<SHAREPATH>'

RECORDSHARE='192.168.1.1:/nfs/PVR'
SHARE_1='192.168.1.1:/nfs/Videos:Videos'
#SHARE_2='192.168.1.1:/nfs/Public:Public'

FR_NAME="NFS Server"
M_OPTSR="soft,tcp,nolock"
# 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,async,udp,nolock,rsize=8192,wsize=8192"
# M_OPTS="soft,tcp,nolock"


SERVERS="Don't set me!!"

DEST_DIR=$MOUNT_PATH
RECDIR=/dtv/usb/${R_USB}

do_mount()
{
	if [ -n "$3" ]; then
		M_POINT="$DEST_DIR/$3"    # with name of directory
		# M_POINT="$DEST_DIR"         # mount direct so that there only will be the hierarchy tree you have in your share
	else
		M_POINT="$DEST_DIR/$1/$(echo -n "$2" | sed -e "s/\//_/g")"
	fi
	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
}

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_OPTSR" "$1:$2" "$M_POINTREC"
				if [ $? = 0 ]; then
					echo "NFS_PATH=$M_POINTREC" >> /dtv/SGO.env
					mount -t xfs -o loop "$RECDIR"/PVR/pvrimage" "$RECDIR"/PVR/Wohnzimmer"
					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'
					do_mount "$SERVER" "$SHPATH" "$SHNAME"
				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`
      
		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     # it is even working without the sleep in my case
			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 "NFS-SERVER"  #### 
			if [ `cat /proc/mounts | grep -c "$M_POINT"` > "0" ] ; then
				echo -e "[$V_USB]\nVendor : Home\nProduct : $USB_NAME\nSerial : 30122011\nDevpath : 7\n\
				Lun : 0\nScsiDevicePath : /dev/${V_USB}1\nMountDir : $DEST_DIR\nFileSystem : vfat\n" >> /dtv/usb/usblog
			else
				echo "No Nfs-Share mounted!"
			fi

			####  VIRTUALUSB "RECORDER"  ####
			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 : 8\n\
					Lun : 1\nScsiDevicePath : /dev/${R_USB}1\nMountDir : $RECDIR\nFileSystem : xfs\n" >> /dtv/usb/usblog
				else
					echo "No Record-Share mounted!"
				fi
			fi
	fi
}


case $1 in
	start)
	# for systems with modular nfs kernel support
	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" | 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"

	/bin/mount | grep "$RECDIR"
	;;
	*)
	echo "Usage: $0 {start|stop|status}" 1>&2
	exit 0
	;;
esac


Re: ntfs-3g for T-VALDEUC

Posted: Wed Feb 12, 2014 12:51 am
by beatfreak
it still uses a xfs-loop-image placed on nfs share, i don't see how they come by the size check...

Code: Select all

mount -t xfs -o loop "$RECDIR"/PVR/pvrimage" "$RECDIR"/PVR/Wohnzimmer"
in C-Series i cannot specify the path where the TV puts my recordings, it is always (root of xfs drive)/CONTENTS/


P.S. please post scripts in code tags

Re: ntfs-3g for T-VALDEUC

Posted: Wed Feb 12, 2014 12:59 am
by Cichas
beatfreak wrote: 2) as xfs is not a compressed filesystem i doubt that a 1,5GB "sparse" file will only occupy ~20MB but i'd love to be proven wrong ;)
Just quick test which I did in 5 minutes (maybe I overlooked something fundamental but...):

Code: Select all

/mtd_rwarea/network_opt # cd /tmp
/tmp # mkfs.xfs -f -d file,name=/tmp/xfs1,size=25m
/tmp # mkdir mountpoint
/tmp # mount xfs1 mountpoint/
/tmp # df -h mountpoint/
Filesystem                Size      Used Available Use% Mounted on
/dev/loop0               20.3M      2.6M     17.8M  13% /tmp/mountpoint
/tmp # ls -la xfs1
-rw-r--r--    1 root     0        26214400 Jan  1 00:01 xfs1
/tmp # mkfs.xfs -f -d file,name=/tmp/mountpoint/pvrimage,size=1536m

/tmp # ls -la /tmp/mountpoint/pvrimage
-rw-r--r--    1 root     0       1610612736 Jan  1 00:03 /tmp/mountpoint/pvrimage
/tmp # df -h /tmp/mountpoint
Filesystem                Size      Used Available Use% Mounted on
/dev/loop0               20.3M     12.7M      7.6M  63% /tmp/mountpoint
Sill 7MB free after creating big enough fake pvrimage in 25MB xfs. :)