Accessing the NFS server from Android : RPC: Unknown protocol issue

1,601 views
Skip to first unread message

krish24

unread,
Jan 19, 2010, 10:34:15 AM1/19/10
to android-porting
Hi All,

I am running a client application in target which receives the read/
write request from Modem side. To serve the read/write request for
files, application access the NFS file system(Local NFS). The client
uses the RPC node to receive the Modem read/write request. It access
the NFS file system on Host side through the SUNRPC.

Issue: When we run the application on target , we receive “127.0.0.1:
RPC: Unknown protocol”.
Here the Client application is calling the “clnt_create” which gets
the handle on a remote host where the local server is located. The
one of the parameter of “clnt_create” is “protocol” and the value of
which is “UDP”.

I tested the same application at Kernel Level rootfs and it works
fine. There is “protocol” file present in Kernel rootfs /etc folder.
This protocol file contains the list of protocols and the protocol
numbers understood by the IP layer.

I copied the protocol file in Android rootfs /etc folder but
application still gives the same warning.

Where i should define the protocols in Android?
Is that warning coming because of protocol file not recognized by
Android or something else needs to be done for setting the NFS on
Android?

Will appreciate your reply and suggestions.

Thanks,
krish


David Turner

unread,
Jan 19, 2010, 7:03:07 PM1/19/10
to android...@googlegroups.com
/etc/services is not supported in Android. Instead the C library provides a hard-coded list.
See bionic/libc/netbsd/net/services.h for the current list, and bionic/libc/tools/genserv.py for a Python script to update it.

Hope this helps.

David Turner

unread,
Jan 19, 2010, 7:04:24 PM1/19/10
to android...@googlegroups.com
And /etc/protocols is not supported either. See bionic/libc/bionic/stubs.c for the getprotobyname() implementation.

Kishor

unread,
Jan 20, 2010, 10:35:55 AM1/20/10
to android...@googlegroups.com
Hi David,
 
Thanks for your reply.
 
I have compiled the client application statically with arm-linux-gcc tool chain. The executable is linked to glibc statically. 
So here when i run the application, glibc part should search the protocol file in /etc folder?
Does the android not allowing this? Is there any  alternative?
The reason behind compiling application statically is that bionic doesn't support all required function/library. Also for accessing the NFS server the required services(NFS UTILS, PORTMAP) are compiled statically and running fine on target.
 
 
Thanks,
krish
--

Kishor

unread,
Jan 28, 2010, 12:33:45 PM1/28/10
to android...@googlegroups.com
 
Hi all,
 
I am struck up with same issue. Please help me on resolving this issue.
 
Issue is described in below mail chain.
 
Thanks in advance,
Krish
--

David Turner

unread,
Jan 28, 2010, 6:48:33 PM1/28/10
to android...@googlegroups.com
Well, the system is probably simply missing /etc/protocol and/or /etc/services since that's what GLibc does.
Did you try copying a version from your Linux machine to a system image to see if this solves the issue ?

Kishor

unread,
Jan 30, 2010, 2:04:55 AM1/30/10
to android...@googlegroups.com
 
Hi David,
 
Yes, I  copied the Protocols, Services and Hosts files to the target's android image "/etc" folder directly.
But it gives the same warning(RPC:Unknown protocol).
is there  any permissions or security issue?
 
krish

Kishor

unread,
Feb 3, 2010, 1:51:06 AM2/3/10
to android...@googlegroups.com
Hi All,
 
Does anybody has any idea or suggestion on this issue?? 
I am badly struck up with this.

 krish
Reply all
Reply to author
Forward
0 new messages