1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can i mount network resources on WRT54GS with Alchemy?

Discussion in 'Sveasoft Firmware' started by Demsey, May 3, 2005.

  1. Demsey

    Demsey Guest

    I tried to mount nfs (it is default compiled in Alchemy)
    and smbfs (after compiling alchemy sources), but it doesn't work.
    ~ # mount -t nfs /var/mnt/nfs/
    mount: Mounting on /var/mnt/nfs failed: Invalid argument
    ~ #
    and for smfs:
    ~ # mount -t smbfs -o username=xxxx,password=**** // /var/mnt/smbfs/
    mount: Mounting // on /var/mnt/smbfs failed: Invalid argument
    ~ #
    It is at all posible on busybox ?
  2. davidsonf

    davidsonf Network Guru Member

    Re: How can i mount network resources on WRT54GS with Alchem

    At least nfs can be done. I don't know about smbfs.

    You need to reconfigure busybox to include support for nfs for the mount and umount commands, and then reconfigure uClibc to include rpc support.

    If I remember right one or both of those required some tweaking of the code to get the compiler to buy it too.

    But once that is done, it does actually work; however, it requires an accident to discover that fact. Seems as though something is a bit strange with the rpciod process. If you just do something like
    mount -t nfs x.x.x.x:/ /tmp/mnt
    the process hangs. If you then telnet in a second time, and run ps, you can see both the mount process and the rpciod process. If you do "killall -9 rpciod"... it doesn't. Instead, the rpciod process stays there, the mount process finishes up and returns, and you have a nfs mounted filesystem!

    I added a shell script named "mountnfs", which looks like this:

       # mount an nfs filesystem
       if [ $# -ne 2 ] ; then
          echo "usage:  mountnfs host:/filesystem /tmp/dir"
          exit 0;
       mount -t nfs "$1" "$2" &
       sleep 2
       killall -9 rpciod
    I put that into /usr/bin, along with a few other handy shell scripts. I then added code to the Makefile in
    to add a directory /tmp/nfs, which I use as a mount point. The mounted filesystem includes a directory
    Hence on the WRT54G there will be a
    directory. I make that easier to get at by also adding,
    in the Makefile above, a symlink
    /tmp/bin -> /tmp/nfs/mips/bin

    And then of course /tmp/bin is added to the PATH for
    root. Data files can go in /tmp/nfs and binaries in /tmp/bin.

    Along with that, I use the /tmp/.rc_startup file to configure an /etc/hosts file, /etc/resolv.conf, and a ~/.profile for root,
    and have added MicroEmacs and deleted vi!

    None of that is trivial, but is sure is fun and useful.

Share This Page