diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2011-05-29 22:39:38 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2011-05-30 11:28:58 +0200 |
commit | a6a2f048d18276c1cc042cf0e8f1636f68b26773 (patch) | |
tree | 44ff241d357fb0ddef73610f93169067c523962d | |
parent | 8c3499c914c5d4ca9d3c1d8e1f62e42e95be75de (diff) | |
download | meta-openembedded-a6a2f048d18276c1cc042cf0e8f1636f68b26773.tar.gz |
nfs-utils: import from OE rev d4f0211e2078d5033ae0dee74664de5520d8392d
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
5 files changed, 377 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-S_ISREG-missing-include.patch b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-S_ISREG-missing-include.patch new file mode 100644 index 000000000..6b2c75e7a --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-S_ISREG-missing-include.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | diff -uNr nfs-utils-1.1.2.orig//utils/exportfs/exportfs.c nfs-utils-1.1.2/utils/exportfs/exportfs.c | ||
2 | --- nfs-utils-1.1.2.orig//utils/exportfs/exportfs.c 2008-03-14 16:46:29.000000000 +0100 | ||
3 | +++ nfs-utils-1.1.2/utils/exportfs/exportfs.c 2010-05-26 10:31:23.000000000 +0200 | ||
4 | @@ -19,6 +19,7 @@ | ||
5 | #include <getopt.h> | ||
6 | #include <netdb.h> | ||
7 | #include <errno.h> | ||
8 | +#include <sys/stat.h> | ||
9 | #include "xmalloc.h" | ||
10 | #include "misc.h" | ||
11 | #include "nfslib.h" | ||
12 | diff -uNr nfs-utils-1.1.2.orig//utils/mount/mount.c nfs-utils-1.1.2/utils/mount/mount.c | ||
13 | --- nfs-utils-1.1.2.orig//utils/mount/mount.c 2008-03-14 16:46:29.000000000 +0100 | ||
14 | +++ nfs-utils-1.1.2/utils/mount/mount.c 2010-05-26 10:31:32.000000000 +0200 | ||
15 | @@ -24,6 +24,7 @@ | ||
16 | |||
17 | #include <unistd.h> | ||
18 | #include <sys/types.h> | ||
19 | +#include <sys/stat.h> | ||
20 | #include <stdio.h> | ||
21 | #include <string.h> | ||
22 | #include <errno.h> | ||
23 | diff -uNr nfs-utils-1.1.2.orig//utils/mount/network.c nfs-utils-1.1.2/utils/mount/network.c | ||
24 | --- nfs-utils-1.1.2.orig//utils/mount/network.c 2008-03-14 16:46:29.000000000 +0100 | ||
25 | +++ nfs-utils-1.1.2/utils/mount/network.c 2010-05-26 10:31:35.000000000 +0200 | ||
26 | @@ -37,6 +37,7 @@ | ||
27 | #include <rpc/pmap_prot.h> | ||
28 | #include <rpc/pmap_clnt.h> | ||
29 | #include <sys/socket.h> | ||
30 | +#include <sys/stat.h> | ||
31 | |||
32 | #include "xcommon.h" | ||
33 | #include "mount.h" | ||
diff --git a/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-tools-unset-cflags.patch b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-tools-unset-cflags.patch new file mode 100644 index 000000000..16bdebf12 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-tools-unset-cflags.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | Index: nfs-utils-1.1.2/tools/Makefile.am | ||
2 | =================================================================== | ||
3 | --- nfs-utils-1.1.2.orig/tools/Makefile.am 2008-03-14 08:46:29.000000000 -0700 | ||
4 | +++ nfs-utils-1.1.2/tools/Makefile.am 2009-03-04 01:58:50.000000000 -0800 | ||
5 | @@ -5,7 +5,10 @@ | ||
6 | if CONFIG_RPCGEN | ||
7 | OPTDIRS += rpcgen | ||
8 | endif | ||
9 | - | ||
10 | +CFLAGS=$(CFLAGS_FOR_BUILD) | ||
11 | +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
12 | +CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
13 | +LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
14 | SUBDIRS = locktest rpcdebug nlmtest $(OPTDIRS) | ||
15 | |||
16 | MAINTAINERCLEANFILES = Makefile.in | ||
17 | Index: nfs-utils-1.1.2/tools/locktest/Makefile.am | ||
18 | =================================================================== | ||
19 | --- nfs-utils-1.1.2.orig/tools/locktest/Makefile.am 2008-03-14 08:46:29.000000000 -0700 | ||
20 | +++ nfs-utils-1.1.2/tools/locktest/Makefile.am 2009-03-04 01:58:50.000000000 -0800 | ||
21 | @@ -1,12 +1,13 @@ | ||
22 | ## Process this file with automake to produce Makefile.in | ||
23 | |||
24 | CC=$(CC_FOR_BUILD) | ||
25 | +CFLAGS=$(CFLAGS_FOR_BUILD) | ||
26 | +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
27 | +CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
28 | +LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
29 | LIBTOOL = @LIBTOOL@ --tag=CC | ||
30 | |||
31 | noinst_PROGRAMS = testlk | ||
32 | testlk_SOURCES = testlk.c | ||
33 | -testlk_CFLAGS=$(CFLAGS_FOR_BUILD) | ||
34 | -testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
35 | -testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
36 | |||
37 | MAINTAINERCLEANFILES = Makefile.in | ||
38 | Index: nfs-utils-1.1.2/tools/nlmtest/Makefile.am | ||
39 | =================================================================== | ||
40 | --- nfs-utils-1.1.2.orig/tools/nlmtest/Makefile.am 2008-03-14 08:46:29.000000000 -0700 | ||
41 | +++ nfs-utils-1.1.2/tools/nlmtest/Makefile.am 2009-03-04 01:58:50.000000000 -0800 | ||
42 | @@ -1,5 +1,8 @@ | ||
43 | ## Process this file with automake to produce Makefile.in | ||
44 | - | ||
45 | +CFLAGS=$(CFLAGS_FOR_BUILD) | ||
46 | +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
47 | +CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
48 | +LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
49 | EXTRA_DIST = \ | ||
50 | README \ | ||
51 | host.h \ | ||
52 | Index: nfs-utils-1.1.2/tools/rpcgen/Makefile.am | ||
53 | =================================================================== | ||
54 | --- nfs-utils-1.1.2.orig/tools/rpcgen/Makefile.am 2008-03-14 08:46:29.000000000 -0700 | ||
55 | +++ nfs-utils-1.1.2/tools/rpcgen/Makefile.am 2009-03-04 01:58:50.000000000 -0800 | ||
56 | @@ -1,6 +1,10 @@ | ||
57 | ## Process this file with automake to produce Makefile.in | ||
58 | |||
59 | CC=$(CC_FOR_BUILD) | ||
60 | +CFLAGS=$(CFLAGS_FOR_BUILD) | ||
61 | +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
62 | +CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
63 | +LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
64 | LIBTOOL = @LIBTOOL@ --tag=CC | ||
65 | |||
66 | noinst_PROGRAMS = rpcgen | ||
67 | @@ -9,10 +13,6 @@ | ||
68 | rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \ | ||
69 | rpc_scan.h rpc_util.h | ||
70 | |||
71 | -rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD) | ||
72 | -rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD) | ||
73 | -rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
74 | - | ||
75 | MAINTAINERCLEANFILES = Makefile.in | ||
76 | |||
77 | EXTRA_DIST = rpcgen.new.1 | ||
78 | Index: nfs-utils-1.1.2/tools/rpcdebug/Makefile.am | ||
79 | =================================================================== | ||
80 | --- nfs-utils-1.1.2.orig/tools/rpcdebug/Makefile.am 2009-03-04 02:01:41.000000000 -0800 | ||
81 | +++ nfs-utils-1.1.2/tools/rpcdebug/Makefile.am 2009-03-04 02:02:42.000000000 -0800 | ||
82 | @@ -1,6 +1,10 @@ | ||
83 | ## Process this file with automake to produce Makefile.in | ||
84 | |||
85 | CC=$(CC_FOR_BUILD) | ||
86 | +CFLAGS=$(CFLAGS_FOR_BUILD) | ||
87 | +CPPFLAGS=$(CPPFLAGS_FOR_BUILD) | ||
88 | +CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
89 | +LDFLAGS=$(LDFLAGS_FOR_BUILD) | ||
90 | LIBTOOL = @LIBTOOL@ --tag=CC | ||
91 | |||
92 | man8_MANS = rpcdebug.man | ||
diff --git a/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-uclibc-compile.patch b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-uclibc-compile.patch new file mode 100644 index 000000000..f242eade4 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-uclibc-compile.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | --- a/support/nfs/svc_socket.c.org 2007-05-11 03:40:57 +0000 | ||
2 | +++ b/support/nfs/svc_socket.c 2007-10-24 15:20:05 +0000 | ||
3 | @@ -67,8 +67,13 @@ | ||
4 | memset (&addr, 0, sizeof (addr)); | ||
5 | addr.sin_family = AF_INET; | ||
6 | |||
7 | +#ifdef __UCLIBC__ | ||
8 | + rpcp = getrpcbynumber (number); | ||
9 | + ret = 0; | ||
10 | +#else | ||
11 | ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata, | ||
12 | &rpcp); | ||
13 | +#endif | ||
14 | if (ret == 0 && rpcp != NULL) | ||
15 | { | ||
16 | /* First try name. */ | ||
17 | --- a/utils/mountd/cache.c.org 2007-05-11 03:40:57 +0000 | ||
18 | +++ b/utils/mountd/cache.c 2007-10-24 15:21:53 +0000 | ||
19 | @@ -131,6 +131,7 @@ | ||
20 | pw = getpwuid(uid); | ||
21 | if (!pw) | ||
22 | rv = -1; | ||
23 | +#ifndef __UCLIBC__ | ||
24 | else { | ||
25 | rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); | ||
26 | if (rv == -1 && ngroups >= 100) { | ||
27 | @@ -142,6 +143,7 @@ | ||
28 | groups, &ngroups); | ||
29 | } | ||
30 | } | ||
31 | +#endif | ||
32 | qword_printint(f, uid); | ||
33 | qword_printint(f, time(0)+30*60); | ||
34 | if (rv >= 0) { | ||
35 | --- a/tools/rpcgen/rpc_cout.c.org 2007-05-11 03:40:57 +0000 | ||
36 | +++ b/tools/rpcgen/rpc_cout.c 2007-10-24 15:23:17 +0000 | ||
37 | @@ -647,7 +647,11 @@ | ||
38 | int freed=0; | ||
39 | |||
40 | if(flag == PUT) | ||
41 | +#ifdef __UCLIBC__ | ||
42 | + f_print(fout,"\t\t IXDR_PUT_"); | ||
43 | +#else | ||
44 | f_print(fout,"\t\t (void) IXDR_PUT_"); | ||
45 | +#endif | ||
46 | else | ||
47 | if(rel== REL_ALIAS) | ||
48 | f_print(fout,"\t\t objp->%s = IXDR_GET_",decl->name); | ||
49 | |||
diff --git a/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfsserver b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfsserver new file mode 100644 index 000000000..b4c7662ce --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfsserver | |||
@@ -0,0 +1,149 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Startup script for nfs-utils | ||
4 | # | ||
5 | # | ||
6 | # The environment variable NFS_SERVERS may be set in /etc/default/nfsd | ||
7 | # Other control variables may be overridden here too | ||
8 | test -r /etc/default/nfsd && . /etc/default/nfsd | ||
9 | # | ||
10 | # Location of executables: | ||
11 | test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd | ||
12 | test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd | ||
13 | test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd | ||
14 | # | ||
15 | # The user mode program must also exist (it just starts the kernel | ||
16 | # threads using the kernel module code). | ||
17 | test -x "$NFS_MOUNTD" || exit 0 | ||
18 | test -x "$NFS_NFSD" || exit 0 | ||
19 | # | ||
20 | # Default is 8 threads, value is settable between 1 and the truely | ||
21 | # ridiculous 99 | ||
22 | test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 | ||
23 | # | ||
24 | # The default state directory is /var/lib/nfs | ||
25 | test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs | ||
26 | # | ||
27 | #---------------------------------------------------------------------- | ||
28 | # Startup and shutdown functions. | ||
29 | # Actual startup/shutdown is at the end of this file. | ||
30 | #directories | ||
31 | create_directories(){ | ||
32 | echo -n 'creating NFS state directory: ' | ||
33 | mkdir -p "$NFS_STATEDIR" | ||
34 | ( cd "$NFS_STATEDIR" | ||
35 | umask 077 | ||
36 | mkdir -p sm sm.bak | ||
37 | test -w sm/state || { | ||
38 | rm -f sm/state | ||
39 | :>sm/state | ||
40 | } | ||
41 | umask 022 | ||
42 | for file in xtab etab smtab rmtab | ||
43 | do | ||
44 | test -w "$file" || { | ||
45 | rm -f "$file" | ||
46 | :>"$file" | ||
47 | } | ||
48 | done | ||
49 | ) | ||
50 | echo done | ||
51 | } | ||
52 | #mountd | ||
53 | start_mountd(){ | ||
54 | echo -n 'starting mountd: ' | ||
55 | start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@" | ||
56 | echo done | ||
57 | } | ||
58 | stop_mountd(){ | ||
59 | echo -n 'stopping mountd: ' | ||
60 | start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD" | ||
61 | echo done | ||
62 | } | ||
63 | # | ||
64 | #nfsd | ||
65 | start_nfsd(){ | ||
66 | echo -n "starting $1 nfsd kernel threads: " | ||
67 | start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" | ||
68 | echo done | ||
69 | } | ||
70 | delay_nfsd(){ | ||
71 | for delay in 0 1 2 3 4 5 6 7 8 9 | ||
72 | do | ||
73 | if pidof nfsd >/dev/null | ||
74 | then | ||
75 | echo -n . | ||
76 | sleep 1 | ||
77 | else | ||
78 | return 0 | ||
79 | fi | ||
80 | done | ||
81 | return 1 | ||
82 | } | ||
83 | stop_nfsd(){ | ||
84 | # WARNING: this kills any process with the executable | ||
85 | # name 'nfsd'. | ||
86 | echo -n 'stopping nfsd: ' | ||
87 | start-stop-daemon --stop --quiet --signal 1 --name nfsd | ||
88 | if delay_nfsd || { | ||
89 | echo failed | ||
90 | echo ' using signal 9: ' | ||
91 | start-stop-daemon --stop --quiet --signal 9 --name nfsd | ||
92 | delay_nfsd | ||
93 | } | ||
94 | then | ||
95 | echo done | ||
96 | # This will remove, recursively, dependencies | ||
97 | echo -n 'removing nfsd kernel module: ' | ||
98 | if modprobe -r nfsd | ||
99 | then | ||
100 | echo done | ||
101 | else | ||
102 | echo failed | ||
103 | fi | ||
104 | else | ||
105 | echo failed | ||
106 | fi | ||
107 | } | ||
108 | |||
109 | #statd | ||
110 | start_statd(){ | ||
111 | echo -n "starting statd: " | ||
112 | start-stop-daemon --start --exec "$NFS_STATD" | ||
113 | echo done | ||
114 | } | ||
115 | stop_statd(){ | ||
116 | # WARNING: this kills any process with the executable | ||
117 | # name 'statd'. | ||
118 | echo -n 'stopping statd: ' | ||
119 | start-stop-daemon --stop --quiet --signal 1 --name statd | ||
120 | echo done | ||
121 | } | ||
122 | #---------------------------------------------------------------------- | ||
123 | # | ||
124 | # supported options: | ||
125 | # start | ||
126 | # stop | ||
127 | # reload: reloads the exports file | ||
128 | # restart: stops and starts mountd | ||
129 | #FIXME: need to create the /var/lib/nfs/... directories | ||
130 | case "$1" in | ||
131 | start) create_directories | ||
132 | start_nfsd "$NFS_SERVERS" | ||
133 | start_mountd | ||
134 | start_statd | ||
135 | test -r /etc/exports && exportfs -a;; | ||
136 | stop) exportfs -ua | ||
137 | stop_statd | ||
138 | stop_mountd | ||
139 | stop_nfsd;; | ||
140 | reload) test -r /etc/exports && exportfs -r;; | ||
141 | restart)exportfs -ua | ||
142 | stop_mountd | ||
143 | stop_statd | ||
144 | # restart does not restart the kernel threads, | ||
145 | # only the user mode processes | ||
146 | start_mountd | ||
147 | start_statd | ||
148 | test -r /etc/exports && exportfs -a;; | ||
149 | esac | ||
diff --git a/meta-oe/recipes-support/nfs-utils/nfs-utils_1.1.2.bb b/meta-oe/recipes-support/nfs-utils/nfs-utils_1.1.2.bb new file mode 100644 index 000000000..9510b3069 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils_1.1.2.bb | |||
@@ -0,0 +1,54 @@ | |||
1 | DESCRIPTION = "userspace utilities for kernel nfs" | ||
2 | PRIORITY = "optional" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
6 | |||
7 | PR = "r9" | ||
8 | |||
9 | DEPENDS = "util-linux tcp-wrappers libevent" | ||
10 | |||
11 | SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.gz \ | ||
12 | file://nfs-utils-tools-unset-cflags.patch \ | ||
13 | file://nfs-utils-uclibc-compile.patch \ | ||
14 | file://nfs-utils-S_ISREG-missing-include.patch \ | ||
15 | file://nfsserver \ | ||
16 | " | ||
17 | |||
18 | S = "${WORKDIR}/nfs-utils-${PV}/" | ||
19 | |||
20 | PARALLEL_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 | RDEPENDS_${PN} = "portmap" | ||
25 | RRECOMMENDS_${PN} = "kernel-module-nfsd" | ||
26 | |||
27 | INITSCRIPT_NAME = "nfsserver" | ||
28 | # The server has no dependencies at the user run levels, so just put | ||
29 | # it in at the default levels. It must be terminated before the network | ||
30 | # in the shutdown levels, but that works fine. | ||
31 | INITSCRIPT_PARAMS = "defaults" | ||
32 | |||
33 | inherit autotools update-rc.d | ||
34 | |||
35 | EXTRA_OECONF = "--with-statduser=nobody \ | ||
36 | --enable-nfsv3 \ | ||
37 | --disable-nfsv4 \ | ||
38 | --disable-gss \ | ||
39 | --with-statedir=/var/lib/nfs" | ||
40 | |||
41 | INHIBIT_AUTO_STAGE = "1" | ||
42 | |||
43 | do_install_append() { | ||
44 | install -d ${D}${sysconfdir}/init.d | ||
45 | install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver | ||
46 | |||
47 | rm ${D}${sbindir}/rpcdebug | ||
48 | } | ||
49 | |||
50 | PACKAGES =+ "nfs-utils-client" | ||
51 | FILES_nfs-utils-client = "${base_sbindir}/*mount.nfs*" | ||
52 | |||
53 | SRC_URI[md5sum] = "76ee9274c2b867839427eba91b327f03" | ||
54 | SRC_URI[sha256sum] = "1d09b1c133e4eed9d2df07ead4eba813e6993875c39e66d7b4081287029d4033" | ||