summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-01 18:09:11 (GMT)
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-01 18:09:57 (GMT)
commitd62ee7eaf2ba025c3f64b2d4e10dc7cec4637612 (patch)
treef36fe3008f36ff75cbdd31b630f8f13f1f205ebb /meta/recipes-connectivity/nfs-utils
parentcaab7fc509bf27706ff3248689f6afd04225cfda (diff)
downloadpoky-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.gz
packages: Separate out most of the remaining packages into recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils')
-rw-r--r--meta/recipes-connectivity/nfs-utils/libnfsidmap_0.23.bb13
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch18
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver161
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.2.bb51
4 files changed, 243 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.23.bb b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.23.bb
new file mode 100644
index 0000000..c6b02fe
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.23.bb
@@ -0,0 +1,13 @@
1DESCRIPTION = "nfs idmapping library"
2HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
3SECTION = "libs"
4
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
7PR = "r0"
8
9SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz"
10
11inherit autotools
12
13EXTRA_OECONF = "--disable-ldap"
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch
new file mode 100644
index 0000000..336dc0e
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch
@@ -0,0 +1,18 @@
1--- ./support/nfs/svc_socket.c.orig 2004-12-12 06:43:52.000000000 +0000
2+++ ./support/nfs/svc_socket.c 2004-12-12 06:50:04.000000000 +0000
3@@ -66,6 +66,7 @@
4 memset ((char *) &addr, sizeof (addr));
5 addr.sin_family = AF_INET;
6
7+#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
8 ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata,
9 &rpcp);
10 if (ret == 0 && rpcp != NULL)
11@@ -99,6 +100,7 @@
12 }
13 }
14 else
15+#endif
16 {
17 if (bindresvport (sock, &addr))
18 {
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
new file mode 100644
index 0000000..9d02e85
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -0,0 +1,161 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: nfs-kernel-server
4# Required-Start: $remote_fs $portmap hwclock
5# Required-Stop: $remote_fs $portmap hwclock
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Kernel NFS server support
9# Description: NFS is a popular protocol for file sharing across
10# TCP/IP networks. This service provides NFS server
11# functionality, which is configured via the
12# /etc/exports file.
13### END INIT INFO
14#
15# Startup script for nfs-utils
16#
17#
18# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
19# Other control variables may be overridden here too
20test -r /etc/default/nfsd && . /etc/default/nfsd
21#
22# Location of executables:
23test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/mountd
24test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/nfsd
25test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/statd
26#
27# The user mode program must also exist (it just starts the kernel
28# threads using the kernel module code).
29test -x "$NFS_MOUNTD" || exit 0
30test -x "$NFS_NFSD" || exit 0
31#
32# Default is 8 threads, value is settable between 1 and the truely
33# ridiculous 99
34test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
35#
36# The default state directory is /var/lib/nfs
37test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
38#
39#----------------------------------------------------------------------
40# Startup and shutdown functions.
41# Actual startup/shutdown is at the end of this file.
42#directories
43create_directories(){
44 echo -n 'creating NFS state directory: '
45 mkdir -p "$NFS_STATEDIR"
46 ( cd "$NFS_STATEDIR"
47 umask 077
48 mkdir -p sm sm.bak
49 test -w sm/state || {
50 rm -f sm/state
51 :>sm/state
52 }
53 umask 022
54 for file in xtab etab smtab rmtab
55 do
56 test -w "$file" || {
57 rm -f "$file"
58 :>"$file"
59 }
60 done
61 )
62 echo done
63}
64#mountd
65start_mountd(){
66 echo -n 'starting mountd: '
67 start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
68 echo done
69}
70stop_mountd(){
71 echo -n 'stopping mountd: '
72 start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
73 echo done
74}
75#
76#nfsd
77start_nfsd(){
78 echo -n "starting $1 nfsd kernel threads: "
79 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
80 echo done
81}
82delay_nfsd(){
83 for delay in 0 1 2 3 4 5 6 7 8 9
84 do
85 if pidof nfsd >/dev/null
86 then
87 echo -n .
88 sleep 1
89 else
90 return 0
91 fi
92 done
93 return 1
94}
95stop_nfsd(){
96 # WARNING: this kills any process with the executable
97 # name 'nfsd'.
98 echo -n 'stopping nfsd: '
99 start-stop-daemon --stop --quiet --signal 1 --name nfsd
100 if delay_nfsd || {
101 echo failed
102 echo ' using signal 9: '
103 start-stop-daemon --stop --quiet --signal 9 --name nfsd
104 delay_nfsd
105 }
106 then
107 echo done
108 # This will remove, recursively, dependencies
109 echo -n 'removing nfsd kernel module: '
110 if modprobe -r nfsd
111 then
112 echo done
113 else
114 echo failed
115 fi
116 else
117 echo failed
118 fi
119}
120
121#statd
122start_statd(){
123 echo -n "starting statd: "
124 start-stop-daemon --start --exec "$NFS_STATD"
125 echo done
126}
127stop_statd(){
128 # WARNING: this kills any process with the executable
129 # name 'statd'.
130 echo -n 'stopping statd: '
131 start-stop-daemon --stop --quiet --signal 1 --name statd
132 echo done
133}
134#----------------------------------------------------------------------
135#
136# supported options:
137# start
138# stop
139# reload: reloads the exports file
140# restart: stops and starts mountd
141#FIXME: need to create the /var/lib/nfs/... directories
142case "$1" in
143start) create_directories
144 start_nfsd "$NFS_SERVERS"
145 start_mountd
146 start_statd
147 test -r /etc/exports && exportfs -a;;
148stop) exportfs -ua
149 stop_statd
150 stop_mountd
151 stop_nfsd;;
152reload) test -r /etc/exports && exportfs -r;;
153restart)exportfs -ua
154 stop_mountd
155 stop_statd
156 # restart does not restart the kernel threads,
157 # only the user mode processes
158 start_mountd
159 start_statd
160 test -r /etc/exports && exportfs -a;;
161esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.2.bb
new file mode 100644
index 0000000..fafedd1
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.2.bb
@@ -0,0 +1,51 @@
1DESCRIPTION = "userspace utilities for kernel nfs"
2HOMEPAGE = "http://nfs.sourceforge.net/"
3SECTION = "console/network"
4PRIORITY = "optional"
5
6LICENSE = "GPLv2+"
7LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
8
9# util-linux for libblkid
10DEPENDS = "libcap libnfsidmap libevent util-linux tcp-wrappers"
11RDEPENDS = "portmap"
12RRECOMMENDS = "kernel-module-nfsd"
13
14PR = "r1"
15
16SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.bz2 \
17 file://nfs-utils-1.0.6-uclibc.patch \
18 file://nfsserver"
19
20PARALLEL_MAKE = ""
21
22# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
23# pull in the remainder of the dependencies.
24
25INITSCRIPT_NAME = "nfsserver"
26# The server has no dependencies at the user run levels, so just put
27# it in at the default levels. It must be terminated before the network
28# in the shutdown levels, but that works fine.
29INITSCRIPT_PARAMS = "defaults"
30
31inherit autotools update-rc.d
32
33# --enable-uuid is need for cross-compiling
34EXTRA_OECONF = "--with-statduser=nobody \
35 --enable-nfsv41 \
36 --enable-uuid \
37 --disable-gss \
38 --disable-tirpc \
39 --with-statedir=/var/lib/nfs"
40
41INHIBIT_AUTO_STAGE = "1"
42
43do_install_append () {
44 install -d ${D}${sysconfdir}/init.d
45 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
46
47 # the following are built by CC_FOR_BUILD
48 rm -f ${D}${sbindir}/rpcdebug
49 rm -f ${D}${sbindir}/rpcgen
50 rm -f ${D}${sbindir}/locktest
51}