[uClibc]nfs-utils working w/ some minor hacks.
Phil Hopely
phil at ayrnetworks.com
Wed Aug 21 17:54:00 UTC 2002
Hi folks,
I thought I might share this - I was able to get nfs-utils 0.3.3-5 to
work for big endian mips in a uclibc build world.
We have not extensively tested this yet, but seems to work in my limited
futzing so far.
I recognize this is not really the best way to deal with issues here -
having a 'variable number of argument' mips syscall implementation is
the way to go. I hope to come back to that as time permits (alas, I
spent a bunch of time to figure out that my main problem was that you
cannot use a ramfs filesystem as a nfs export, sigh :)...
One other issue of note - and this may be a build faux paus on our part
- is that rpc.mountd has libnsl.so.1 in it's library dependency list.
If I create a symlink from libnsl.so.1 to libc.so.0 in the target
filesystem, things appear to work just fine -- are we doing something
wrong in our build?
So our current kludge/fix is this:
RCS file: /cvs/public/nfs-utils/support/nfs/nfsctl.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 nfsctl.c
19a20,27
> #if (defined(__UCLIBC__) && defined(__mips__))
> ;
> /* if compiling for mips UCLIBC, do not use the definition of nfsctl
below -
> * this is intended to be a temporary wordaround of the lack of a generic
> * syscall implementation in uclibc for mips...
> * if this is any other variant, use this definition */
>
> #else
24a33
> #endif
... and to uclibc/libc/sysdeps/linux/mips, we added the file _sysmips.c
(& updated the makefile) which contains:
/* Use new style sysmips for mips */
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#ifndef __NR_nfsctl
#define __NR_nfsctl __NR_nfsservctl
#endif
_syscall2 (int, sysmips, int, op, int, arg);
/* define nfsctl as a 3 argument syscall for nfs-utils -
* talks to the nfsd module.
* FIXME: implement a variable-number of argument syscall
* and get rid of this here & the crud logic in nfs-utils
* at support/nfs/nfsctl.c */
_syscall3 (int, nfsctl, int, cmd, void *, argp, void *, resp);
... the sysmips function is a little-used syscall that can explicitly
flush cache and instruct the kernel to do other wonderous mips-specific
operations that one of our developers is fond of doing - so you can
likely omit that -- but we find it useful.
enjoy,
Phil
More information about the uClibc
mailing list