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.
    example:
    Code:
    ~ # mount -t nfs 192.168.1.103/resource /var/mnt/nfs/
    mount: Mounting 192.168.1.103/dreambox on /var/mnt/nfs failed: Invalid argument
    ~ #
    and for smfs:
    Code:
    ~ # mount -t smbfs -o username=xxxx,password=**** //192.168.1.100/resource /var/mnt/smbfs/
    mount: Mounting //192.168.1.100/resource on /var/mnt/smbfs failed: Invalid argument
    ~ #
    It is at all posible on busybox ?
    thanks
     
  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:

    Code:
       #!/bin/sh
       #
       # mount an nfs filesystem
       #
       if [ $# -ne 2 ] ; then
          echo "usage:  mountnfs host:/filesystem /tmp/dir"
          exit 0;
       fi
       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
    ../src/router/others
    to add a directory /tmp/nfs, which I use as a mount point. The mounted filesystem includes a directory
    .../mips/bin
    Hence on the wrt54g there will be a
    /tmp/nfs/mips/bin
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice