Mount everything, Homebrew with sshfs.

This first Homebrew is a Proof of concept for mounting any filesytem network,
even through the internet.

It is not possible to add functionalities to the proprietary WDTV software interface.
The sources of this software are not distributed by Western. Nevertheless, the whole environment around the interface software is open source. We will therefore modify the scripts called by the OSD. When you select the “Local Server” and “NFS” functions,
the OSD uses the /bin/find_nfs_server.sh, then /bin/find_nfs_share_folder.sh scripts.
Modifying these scripts to return other information than the NFS servers, will allow us
to add new servers and protocols / filesystems to the OSD interface. Once all the parameters are recovered by the OSD, everything is sent to the mount command.

Now let me introduce Busybox. Busybox is a toolkit containing many Linux programs. This is a quick and effective way to get a working system. Busybox can be used in two ways: By calling the command wanted behind Busybox, or by creating a symbolic link.
The mount command is a symbolic link to the BusyBox binary.
By replacing the symbolic link mount by a script, it is possible to intercept the parameters passed by the OSD to the mount command, manipulate or override these settings, and finally call the busybox mount command with the modified settings.

This Homebrew integrates all the binaries needed to run sshfs. You don’t need to recompile all the binaries and libraries. The processor architecture is the same as the other WDTV versions, so you can re-use all binaries that do not use a specific hardware.

The /bin/find_nfs_server.sh and /bin/find_nfs_share_folder.sh scripts have been modified to read the file /conf/server and add the resulting contents to the OSD.

The symbolic link mount has been replaced to run sshfs if the server name is given in the /conf/server file. If this is not the case, the busybox mount command is called seamlessly.
Authentification is based on a rsa_id key and must be placed in /conf.
The /etc/ssh/ssh_config file automatically adds new servers in the /conf/known_hosts without prompting.

Files added to the Homebrew from the compilation 1.05.14_G base are available here. There is no need to recompile all sources : just add files in the PALACE_1.05.14_G/build/root folder then the execute the make firmware command to rebuild the firmware.

The complete firmware including sshfs and phpShell is available here.

If something goes wrong, the /tmp/mount file includes the sshfs command executed by the mount script. You can try to execute the command manually.

Warning: Changing the mount command is very dangerous. If it does not work,
your WDTV will be bricked.
Test your mount script by creating a clone of the /bin folder on a USB key. Then mount this file instead of the original /bin folder using
the mount -o bind /media/USB/nameofyourkey/bin /bin command.

By using these scripts as an operating model, you can adapt them to mount any local or network file system on any IP, yet controlled by the OSD interface.

Thanks go to Elrick for the mount script tip.

3 réflexions au sujet de « Mount everything, Homebrew with sshfs. »

  1. Hello Guimli and thank you!

    I am not yet familiar with Linux Programming.
    Just a few configurations from time to time on a web server and PC.
    But I confess to you that I rowing very much for the result. ;-)

    I believe that you are a champion in the work that you do.
    Your firmeware will help many people, already six months ago, I contacted Wester Digital to ask for improve their products. But without results!
    Wester Digital announced the WD TV Live Streaming can read the files with suffix .m3u, .pls, but it does not read!
    Even worse, the previous model WD TV Live Plus was more stable than the new WD TV Live Streaming!
    The WD TV Live Plus is very popular with the alternative firmeware WDLXTV of at B-Rad, although in mode FTP transfer was very slow.
    I hope that your firmewre will be appreciated too!

    “Excuse me somewhat of embezzling the technical side of this topic.”

    Best regards!

    Philippe

  2. Hello!
    Bonjour!

    1) I wonder how it would be possible to mount an FTP access to the WD TV Live Streaming Media Player, aka Gen3, Modele: WDBGXT0000NBK ? …

    2) But also, start a streaming video from a link on a usb stick? …

    In advance thank you for helping me find a solution,
    Best regards!

    Philippe

    • Hello

      1) This article explains exactly how to mount a FTP on the WDTV. Just replace the words by SSHFS by CurlFTPFS (add curlftpfs binaries and edit the scripts mount).
      I prepare a firmware approaching the WDLXTV. I will try to add in the FTP.

      2) I do not know how to read a streaming link with the WDTV. I would look but not before a few weeks.

Leave a Reply