diff options
author | Cody P Schafer <dev@codyps.com> | 2017-06-06 18:30:49 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:08:32 +0100 |
commit | 6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e (patch) | |
tree | 6b76791c01f492ddabea5b5de7bacc07a39bcd13 /scripts/runqemu-export-rootfs | |
parent | 7acb3ae1cdbf1688a373c8047ab56ef96bbe8b88 (diff) | |
download | poky-6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e.tar.gz |
runqemu-export-rootfs: don't change RPC ports
RPC ports (also known as rpc program numbers) are values:
- given to rpcbind (aka portmapper) to allow nfsv3 clients that don't
know the tcp/udp port number of nfsd and mountd to look it up the
tcp/udp port number, and to
- allow a single transport (ie: tcp/udp port) to provide multiple
sunrpc services.
OE has carried patches to nfsutils & linux for some time to support the
mountprog & nfsprog options.
In the case of runqemu-export-rootfs, we don't need to use custom rpc
program numbers because runqemu-export-rootfs tells unfsd not to
register with the portmapper, and unfsd runs the nfs and mount rpc
services on tcp/udp ports unfsd binds itself (iow: the tcp/udp ports are
not shared in the sunrpc sense).
Linux's nfs client does not query rpcbind when tcp/udp port numbers are
specified (in net/sunrpc/clnt.c, call_bind checks for the tcp/udp port
with xprt_bound() and skips the call to rpcbind if xprtsock.c's
xs_setup_udp() or xs_setup_tcp() has found a non-zero tcp/udp port).
The program numbers _are_ sent over the mount & nfs protocol (really,
over sunrpc), and checked to match at both ends. As a result, even when
rpcbind is unused, using different program numbers in unfsd vs linux
nfs client causes mounts to fail (and nfsroot mounts to timeout).
The result is that specifying custom program numbers in
runqemu-export-rootfs doesn't solve any conflicts, it simply requires
that users of runqemu-export-rootfs carry a kernel patch & adds 2 extra
parameters to the kernel command line unnecessarily.
Change runqemu-export-rootfs to use the default program numbers.
For now, I have not dropped the custom program number patches to linux,
nfs-utils, and unfsd just in case someone is using them in a
non-runqemu-export-rootfs context.
CC: Bruce Ashfield <bruce.ashfield@gmail.com>
CC: Mark Hatle <mark.hatle@windriver.com>
(From OE-Core rev: 9c91df324dfe58273f5a1d1d33dba1d34a180db7)
Signed-off-by: Cody P Schafer <dev@codyps.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-export-rootfs')
-rwxr-xr-x | scripts/runqemu-export-rootfs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs index c7992d8223..70cdcdbb13 100755 --- a/scripts/runqemu-export-rootfs +++ b/scripts/runqemu-export-rootfs | |||
@@ -77,10 +77,6 @@ if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then | |||
77 | exit 1 | 77 | exit 1 |
78 | fi | 78 | fi |
79 | 79 | ||
80 | # rpc.mountd RPC port | ||
81 | MOUNTD_RPCPORT=${MOUNTD_RPCPORT:=$[ 21111 + $NFS_INSTANCE ]} | ||
82 | # rpc.nfsd RPC port | ||
83 | NFSD_RPCPORT=${NFSD_RPCPORT:=$[ 11111 + $NFS_INSTANCE ]} | ||
84 | # NFS server port number | 80 | # NFS server port number |
85 | NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]} | 81 | NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]} |
86 | # mountd port number | 82 | # mountd port number |
@@ -88,7 +84,7 @@ MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]} | |||
88 | 84 | ||
89 | ## For debugging you would additionally add | 85 | ## For debugging you would additionally add |
90 | ## --debug all | 86 | ## --debug all |
91 | UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFSD_RPCPORT -n $NFSD_PORT -y $MOUNTD_RPCPORT -m $MOUNTD_PORT" | 87 | UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -n $NFSD_PORT -m $MOUNTD_PORT" |
92 | 88 | ||
93 | # See how we were called. | 89 | # See how we were called. |
94 | case "$1" in | 90 | case "$1" in |
@@ -130,7 +126,7 @@ case "$1" in | |||
130 | fi | 126 | fi |
131 | echo " " | 127 | echo " " |
132 | echo "On your target please remember to add the following options for NFS" | 128 | echo "On your target please remember to add the following options for NFS" |
133 | echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,mountprog=$MOUNTD_RPCPORT,nfsprog=$NFSD_RPCPORT,udp,mountport=$MOUNTD_PORT" | 129 | echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,udp,mountport=$MOUNTD_PORT" |
134 | ;; | 130 | ;; |
135 | stop) | 131 | stop) |
136 | if [ -f "$NFSPID" ]; then | 132 | if [ -f "$NFSPID" ]; then |