Mounting an NFS share on a USB device to bypass DLNA


From SamyGO
Revision as of 14:56, 12 October 2009 by Dynamic1969 (talk | contribs)
Jump to: navigation, search

By marcelr, major input from arris69 and a bunch of others from the avsforum.

What you need

  • A working NFS server on your network
  • telnet access to your TV
  • Possibly a USB pendrive (if you're lucky, you don't need this)

What you do

  • set up your NFS server to export at least one directory to your TV. Since your TV will probably only play music, movies etc. exporting read-only will do. A typical line in your exports file (/etc/exports on most unices) will look like this:
/full-path-to-directory-to-export aaa.bbb.ccc.ddd/32(ro)          # tv will mount read-only

with aaa.bbb.ccc.ddd your TV's IP-address.

Comment from dynamic1969:
The below steps assume, that you modified your exe.img with ";/mtd_rwarea/rc.local&" instead of ";/etc/telnetd_start.sh&". We will make sure both match going forward.

  • create and edit /mtd_rwarea/rc.local to startup the telnet daemon, mine looks like this:
#!/bin/sh

# do not EVER remove the next two lines: They are your only access to your TV!
mount -t devpts devpts /dev/pts
telnetd
  • make sure rc.local is executable:
chmod 755 /mtd_rwarea/rc.local

Depending on your the combination of hardware/software, two major possibilities exist for mounting NFS shares:

  • first possibility, via usb pendrive, works always: Insert a USB pendrive with at least one empty subdirectory in the root directory, e.g., /media
  • add the following lines to rc.local, or put them in a separate script which in turn is called from rc.local:
# wait for the rest of the TV boot sequence to complete, the USB stick with the
# mount point for the NFS share is mounted downstream from this script ....
sleep 30  # YMMV

# mount NFS share
mount -o nolock ppp.qqq.rrr.sss:/full-path-to-directory-to-export /dtv/usb/sda1/media -t nfs

with ppp.qqq.rrr.sss the nfs server's IP address, /dtv/usb/sda1 is the place where USB drives are mounted (at least on my TV)

  • make sure this script is executed in the background. Otherwise you may get bootloop situations.
  • second possibility, without USB pendrive, may work if you're lucky: Add the following lines to rc.local:
sleep 30  # YMMV

mkdir -p /dtv/usb/sda4                                                            
                                                                                
# mount NFS share:                                                                    
                                                                                 
mount -o nolock ppp.qqq.rrr.sss:/full-path-to-directory-to-export /dtv/usb/sda4 -t nfs
                                                                                
# append sda4 notification to log file:                                         
                                                                                
echo "[sdd]                                                                    
Vendor : Linux                                                                 
Product : Ext disk                                                             
Serial : Q80VQLFL                                                              
Devpath : 4                                                                    
Lun : 0                                                                        
MountDir : /dtv/usb/sda4                                                       
FileSystem : vfat                                                              
                                                                               
" >> /dtv/usb/log                                                              

The mounted share will show up when you hit the media.p button on the remote. The second method does NOT work on uexxB70xx (and probably others, please notify me in the forum).

Benefits of NFS vs DLNA ( below others )

  • Via this method you can use features like FWD, RWD, PAUSE etc. ( which for some wired reasons are lacking with DLNA )
  • Some Container Formats & Codecs appear as not supported via DLNA but work fine when opened via NFS

Problems

  • If you use 'Allegro' as a NFS server on Windows XP Pro, this will make subtitles can't view on your TV. ( You can use other alternatives like Cygwin with NFS server )