summaryrefslogtreecommitdiffstats
path: root/meta/packages/nfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/nfs-utils')
-rw-r--r--meta/packages/nfs-utils/files/nfs-utils-1.0.6-uclibc.patch18
-rw-r--r--meta/packages/nfs-utils/files/nfsserver132
-rw-r--r--meta/packages/nfs-utils/nfs-utils-1.0.6/acinclude-lossage.patch142
-rw-r--r--meta/packages/nfs-utils/nfs-utils-1.0.6/forgotten-defines5
-rw-r--r--meta/packages/nfs-utils/nfs-utils-1.0.6/kernel-2.6.18+.patch13
-rw-r--r--meta/packages/nfs-utils/nfs-utils-1.0.6/rpcgen-lossage.patch11
-rw-r--r--meta/packages/nfs-utils/nfs-utils-1.0.6/stat-include.patch11
-rw-r--r--meta/packages/nfs-utils/nfs-utils_1.0.6.bb76
8 files changed, 408 insertions, 0 deletions
diff --git a/meta/packages/nfs-utils/files/nfs-utils-1.0.6-uclibc.patch b/meta/packages/nfs-utils/files/nfs-utils-1.0.6-uclibc.patch
new file mode 100644
index 0000000000..ebd3276be2
--- /dev/null
+++ b/meta/packages/nfs-utils/files/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 __bzero ((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/packages/nfs-utils/files/nfsserver b/meta/packages/nfs-utils/files/nfsserver
new file mode 100644
index 0000000000..4ff75916d0
--- /dev/null
+++ b/meta/packages/nfs-utils/files/nfsserver
@@ -0,0 +1,132 @@
1#!/bin/sh
2#
3# Startup script for nfs-utils
4#
5# The nfsd kernel module must exist along with its dependencies
6modprobe -n nfsd || exit 0
7#
8# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
9# Other control variables may be overridden here too
10test -r /etc/default/nfsd && . /etc/default/nfsd
11#
12# Location of exectuables:
13test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/mountd
14test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/nfsd
15#
16# The user mode program must also exist (it just starts the kernel
17# threads using the kernel module code).
18test -x "$NFS_MOUNTD" || exit 0
19test -x "$NFS_NFSD" || exit 0
20#
21# Default is 8 threads, value is settable between 1 and the truely
22# ridiculous 99
23test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
24#
25# The default state directory is /var/lib/nfs
26test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
27#
28#----------------------------------------------------------------------
29# Startup and shutdown functions.
30# Actual startup/shutdown is at the end of this file.
31#directories
32create_directories(){
33 echo -n 'creating NFS state directory: '
34 mkdir -p "$NFS_STATEDIR"
35 ( cd "$NFS_STATEDIR"
36 umask 077
37 mkdir -p sm sm.bak
38 test -w sm/state || {
39 rm -f sm/state
40 :>sm/state
41 }
42 umask 022
43 for file in xtab etab smtab rmtab
44 do
45 test -w "$file" || {
46 rm -f "$file"
47 :>"$file"
48 }
49 done
50 )
51 echo done
52}
53#mountd
54start_mountd(){
55 echo -n 'starting mountd: '
56 start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
57 echo done
58}
59stop_mountd(){
60 echo -n 'stopping mountd: '
61 start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
62 echo done
63}
64#
65#nfsd
66start_nfsd(){
67 echo -n "starting $1 nfsd kernel threads: "
68 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
69 echo done
70}
71delay_nfsd(){
72 for delay in 0 1 2 3 4 5 6 7 8 9
73 do
74 if pidof nfsd >/dev/null
75 then
76 echo -n .
77 sleep 1
78 else
79 return 0
80 fi
81 done
82 return 1
83}
84stop_nfsd(){
85 # WARNING: this kills any process with the executable
86 # name 'nfsd'.
87 echo -n 'stopping nfsd: '
88 start-stop-daemon --stop --quiet --signal 1 --name nfsd
89 if delay_nfsd || {
90 echo failed
91 echo ' using signal 9: '
92 start-stop-daemon --stop --quiet --signal 9 --name nfsd
93 delay_nfsd
94 }
95 then
96 echo done
97 # This will remove, recursively, dependencies
98 echo -n 'removing nfsd kernel module: '
99 if modprobe -r nfsd
100 then
101 echo done
102 else
103 echo failed
104 fi
105 else
106 echo failed
107 fi
108}
109#----------------------------------------------------------------------
110#
111# supported options:
112# start
113# stop
114# reload: reloads the exports file
115# restart: stops and starts mountd
116#FIXME: need to create the /var/lib/nfs/... directories
117case "$1" in
118start) create_directories
119 start_nfsd "$NFS_SERVERS"
120 start_mountd
121 test -r /etc/exports && exportfs -a;;
122stop) exportfs -ua
123 stop_mountd
124 stop_nfsd;;
125reload) test -r /etc/exports && exportfs -r;;
126restart)exportfs -ua
127 stop_mountd
128 # restart does not restart the kernel threads,
129 # only the user mode processes
130 start_mountd
131 test -r /etc/exports && exportfs -a;;
132esac
diff --git a/meta/packages/nfs-utils/nfs-utils-1.0.6/acinclude-lossage.patch b/meta/packages/nfs-utils/nfs-utils-1.0.6/acinclude-lossage.patch
new file mode 100644
index 0000000000..0d2d7f3824
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils-1.0.6/acinclude-lossage.patch
@@ -0,0 +1,142 @@
1--- nfs-utils-1.0.6/acinclude.m4.old 2004-11-07 12:28:58.000000000 +0000
2+++ nfs-utils-1.0.6/acinclude.m4 2000-10-11 22:49:45.000000000 +0100
3@@ -0,0 +1,139 @@
4+dnl aclocal.m4 -- custom autoconf macros for various purposes
5+dnl Updated for Autoconf v2
6+dnl
7+dnl ******** save/restore stuff **********
8+define(AC_KNFSD_SAVE,
9+ [AC_LANG_SAVE
10+ save_LDFLAGS=$LDFLAGS
11+ save_CFLAGS=$CFLAGS
12+ save_CXXFLAGS=$CXXFLAGS
13+ save_LIBS=$LIBS
14+])dnl
15+define(AC_KNFSD_RESTORE,
16+ [LDFLAGS=$save_LDFLAGS
17+ CFLAGS=$save_CFLAGS
18+ CXXFLAGS=$save_CXXFLAGS
19+ LIBS=$save_LIBS
20+ AC_LANG_RESTORE
21+])dnl
22+dnl *********** GNU libc 2 ***************
23+define(AC_GNULIBC,
24+ [AC_MSG_CHECKING(for GNU libc2)
25+ AC_CACHE_VAL(knfsd_cv_glibc2,
26+ [AC_TRY_CPP([
27+ #include <features.h>
28+ #if !defined(__GLIBC__)
29+ # error Nope
30+ #endif], knfsd_cv_glibc2=yes, knfsd_cv_glibc2=no)])
31+ AC_MSG_RESULT($knfsd_cv_glibc2)
32+ if test $knfsd_cv_glibc2 = yes; then
33+ CFLAGS="$CFLAGS -D_GNU_SOURCE"
34+ CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE"
35+ fi
36+]) dnl
37+dnl
38+dnl ************* egcs *******************
39+define(AC_PROG_EGCS,
40+ [AC_MSG_CHECKING(for egcs)
41+ AC_CACHE_VAL(knfsd_cv_prog_EGCS,
42+ [case `$CC --version 2>/dev/null` in
43+ egcs*)
44+ knfsd_cv_prog_EGCS=yes;;
45+ *)
46+ knfsd_cv_prog_EGCS=no;;
47+ esac
48+ ])
49+ AC_MSG_RESULT($knfsd_cv_prog_EGCS)
50+ test $knfsd_cv_prog_EGCS = yes && AC_DEFINE(HAVE_EGCS)
51+]) dnl
52+dnl *********** sizeof(dev_t) **************
53+dnl ** We have to kludge this rather than use AC_CHECK_SIZEOF because
54+dnl ** we have to include sys/types.h. Ugh.
55+define(AC_DEV_T_SIZE,
56+ [AC_MSG_CHECKING(size of dev_t)
57+ AC_CACHE_VAL(ac_cv_sizeof_dev_t,
58+ [AC_TRY_LINK(
59+ [#include <stdio.h>
60+ #include <sys/types.h>
61+ main()
62+ {
63+ FILE *f=fopen("conftestval", "w");
64+ if (!f) exit(1);
65+ fprintf(f, "%d\n", sizeof(dev_t));
66+ exit(0);
67+ }], ac_cv_sizeof_dev_t=`cat conftestval`, ac_cv_sizeof_dev_t=0)])
68+ AC_MSG_RESULT($ac_cv_sizeof_dev_t)
69+ AC_DEFINE(SIZEOF_DEV_T,$ac_cv_sizeof_dev_t)
70+ ])
71+dnl *********** sizeof(xxx_t) **************
72+dnl ** Overwrite the AC_CHECK_SIZEOF macro as we must include sys/types.h
73+define([AC_CHECK_SIZEOF],
74+ [changequote(<<, >>)dnl
75+ define(<<AC_TYPE_NAME>>,translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
76+ define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
77+ changequote([, ])dnl
78+ AC_MSG_CHECKING(size of $1)
79+ AC_CACHE_VAL(AC_CV_NAME,
80+ [AC_TRY_RUN(
81+ [#include <stdio.h>
82+ #include <sys/types.h>
83+ main()
84+ {
85+ FILE *f=fopen("conftestval", "w");
86+ if (!f) exit(1);
87+ fprintf(f, "%d\n", sizeof($1));
88+ exit(0);
89+ }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])
90+ AC_MSG_RESULT($AC_CV_NAME)
91+ AC_DEFINE_UNQUOTED(AC_TYPE_NAME,$AC_CV_NAME)
92+ undefine([AC_TYPE_NAME])dnl
93+ undefine([AC_CV_NAME])dnl
94+ ])
95+dnl *********** BSD vs. POSIX signal handling **************
96+define([AC_BSD_SIGNALS],
97+ [AC_MSG_CHECKING(for BSD signal semantics)
98+ AC_CACHE_VAL(knfsd_cv_bsd_signals,
99+ [AC_TRY_RUN([
100+ #include <signal.h>
101+ #include <unistd.h>
102+ #include <sys/wait.h>
103+
104+ static int counter = 0;
105+ static RETSIGTYPE handler(int num) { counter++; }
106+
107+ int main()
108+ {
109+ int s;
110+ if ((s = fork()) < 0) return 1;
111+ if (s != 0) {
112+ if (wait(&s) < 0) return 1;
113+ return WIFSIGNALED(s)? 1 : 0;
114+ }
115+
116+ signal(SIGHUP, handler);
117+ kill(getpid(), SIGHUP); kill(getpid(), SIGHUP);
118+ return (counter == 2)? 0 : 1;
119+ }
120+ ], knfsd_cv_bsd_signals=yes, knfsd_cv_bsd_signals=no)]) dnl
121+ AC_MSG_RESULT($knfsd_cv_bsd_signals)
122+ test $knfsd_cv_bsd_signals = yes && AC_DEFINE(HAVE_BSD_SIGNALS)
123+])dnl
124+dnl *********** the tcp wrapper library ***************
125+define(AC_TCP_WRAPPER,
126+ [AC_MSG_CHECKING(for the tcp wrapper library)
127+ AC_CACHE_VAL(knfsd_cv_tcp_wrapper,
128+ [old_LIBS="$LIBS"
129+ LIBS="$LIBS -lwrap $LIBNSL"
130+ AC_TRY_LINK([
131+ int deny_severity = 0;
132+ int allow_severity = 0;],
133+ [return hosts_ctl ("nfsd", "", "")],
134+ knfsd_cv_tcp_wrapper=yes, knfsd_cv_tcp_wrapper=no)
135+ LIBS="$old_LIBS"])
136+ AC_MSG_RESULT($knfsd_cv_tcp_wrapper)
137+ if test "$knfsd_cv_tcp_wrapper" = yes; then
138+ CFLAGS="$CFLAGS -DHAVE_TCP_WRAPPER"
139+ CXXFLAGS="$CXXFLAGS -DHAVE_TCP_WRAPPER"
140+ LIBWRAP="-lwrap"
141+ fi
142+]) dnl
diff --git a/meta/packages/nfs-utils/nfs-utils-1.0.6/forgotten-defines b/meta/packages/nfs-utils/nfs-utils-1.0.6/forgotten-defines
new file mode 100644
index 0000000000..a18333100d
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils-1.0.6/forgotten-defines
@@ -0,0 +1,5 @@
1
2/* This defines the location of the NFS state files
3 * Warning: these must match definitions in config.mk!
4 */
5#define NFS_STATEDIR "/var/lib/nfs"
diff --git a/meta/packages/nfs-utils/nfs-utils-1.0.6/kernel-2.6.18+.patch b/meta/packages/nfs-utils/nfs-utils-1.0.6/kernel-2.6.18+.patch
new file mode 100644
index 0000000000..219bed094b
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils-1.0.6/kernel-2.6.18+.patch
@@ -0,0 +1,13 @@
1--- nfs-utils-1.0.6/tools/getkversion/getkversion.c.orig 2007-02-22 12:33:54.000000000 +0000
2+++ nfs-utils-1.0.6/tools/getkversion/getkversion.c 2007-02-22 12:33:56.000000000 +0000
3@@ -12,6 +12,10 @@
4 int
5 main(void) /* This is for Dan Popp ;) */
6 {
7+
8+#ifdef UTS_RELEASE
9 printf("%s\n", UTS_RELEASE);
10+#endif
11+
12 return 0;
13 }
diff --git a/meta/packages/nfs-utils/nfs-utils-1.0.6/rpcgen-lossage.patch b/meta/packages/nfs-utils/nfs-utils-1.0.6/rpcgen-lossage.patch
new file mode 100644
index 0000000000..d1e1fb700d
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils-1.0.6/rpcgen-lossage.patch
@@ -0,0 +1,11 @@
1--- nfs-utils-1.0.6/config.mk.in.old 2004-11-07 12:30:05.000000000 +0000
2+++ nfs-utils-1.0.6/config.mk.in 2004-11-07 12:30:19.000000000 +0000
3@@ -52,7 +52,7 @@
4 LN_S = ln -sf
5 RANLIB = @RANLIB@
6 INDENT = indent
7-RPCGEN = $(TOP)bin/rpcgen
8+RPCGEN = rpcgen
9 GETKVER = $(TOP)tools/getkversion
10 INSTALL = install
11 MAN2PS = groff -Tps -man
diff --git a/meta/packages/nfs-utils/nfs-utils-1.0.6/stat-include.patch b/meta/packages/nfs-utils/nfs-utils-1.0.6/stat-include.patch
new file mode 100644
index 0000000000..d0ae022461
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils-1.0.6/stat-include.patch
@@ -0,0 +1,11 @@
1--- nfs-utils-1.0.6/utils/statd/statd.c~ 2003-09-11 20:24:29.000000000 -1000
2+++ nfs-utils-1.0.6/utils/statd/statd.c 2005-03-27 03:11:03.025582700 -1000
3@@ -19,6 +19,7 @@
4 #include <rpc/pmap_clnt.h>
5 #include <rpcmisc.h>
6 #include <sys/resource.h>
7+#include <sys/stat.h>
8 #include <grp.h>
9 #include "statd.h"
10 #include "version.h"
11
diff --git a/meta/packages/nfs-utils/nfs-utils_1.0.6.bb b/meta/packages/nfs-utils/nfs-utils_1.0.6.bb
new file mode 100644
index 0000000000..a941843488
--- /dev/null
+++ b/meta/packages/nfs-utils/nfs-utils_1.0.6.bb
@@ -0,0 +1,76 @@
1DESCRIPTION = "userspace utilities for kernel nfs"
2PRIORITY = "optional"
3SECTION = "console/network"
4LICENSE = "GPL"
5PR = "r9"
6
7SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.gz \
8 file://acinclude-lossage.patch;patch=1 \
9 file://rpcgen-lossage.patch;patch=1 \
10 file://stat-include.patch;patch=1 \
11 file://nfs-utils-1.0.6-uclibc.patch;patch=1 \
12 file://kernel-2.6.18+.patch;patch=1 \
13 file://nfsserver \
14 file://forgotten-defines"
15
16S = "${WORKDIR}/nfs-utils-${PV}/"
17
18PARALLEL_MAKE = ""
19
20# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
21# pull in the remainder of the dependencies.
22RDEPENDS = "portmap"
23RRECOMMENDS = "kernel-module-nfsd"
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
33EXTRA_OECONF = "--with-statduser=nobody \
34 --enable-nfsv3 \
35 --with-statedir=/var/lib/nfs"
36
37do_compile() {
38 # UGLY HACK ALERT
39 cat ${WORKDIR}/forgotten-defines >> ${S}/support/include/config.h
40 oe_runmake 'BUILD=1'
41}
42
43INHIBIT_AUTO_STAGE = "1"
44
45do_install() {
46 install -d ${D}${sysconfdir}/init.d
47 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
48
49 install -d ${D}${sbindir}
50 install -m 0755 ${S}/utils/exportfs/exportfs ${D}${sbindir}/exportfs
51 install -m 0755 ${S}/utils/lockd/lockd ${D}${sbindir}/lockd
52 install -m 0755 ${S}/utils/mountd/mountd ${D}${sbindir}/mountd
53 install -m 0755 ${S}/utils/nfsd/nfsd ${D}${sbindir}/nfsd
54 install -m 0755 ${S}/utils/nfsstat/nfsstat ${D}${sbindir}/nfsstat
55 install -m 0755 ${S}/utils/nhfsstone/nhfsgraph ${D}${sbindir}/nhfsgraph
56 install -m 0755 ${S}/utils/nhfsstone/nhfsnums ${D}${sbindir}/nhfsnums
57 install -m 0755 ${S}/utils/nhfsstone/nhfsrun ${D}${sbindir}/nhfsrun
58 install -m 0755 ${S}/utils/nhfsstone/nhfsstone ${D}${sbindir}/nhfsstone
59 install -m 0755 ${S}/utils/rquotad/rquotad ${D}${sbindir}/rquotad
60 install -m 0755 ${S}/utils/showmount/showmount ${D}${sbindir}/showmount
61 install -m 0755 ${S}/utils/statd/statd ${D}${sbindir}/statd
62
63 install -d ${D}${mandir}/man8
64 install -m 0644 ${S}/utils/exportfs/exportfs.man ${D}${mandir}/man8/exportfs.8
65 install -m 0644 ${S}/utils/lockd/lockd.man ${D}${mandir}/man8/lockd.8
66 install -m 0644 ${S}/utils/mountd/mountd.man ${D}${mandir}/man8/mountd.8
67 install -m 0644 ${S}/utils/nfsd/nfsd.man ${D}${mandir}/man8/nfsd.8
68 install -m 0644 ${S}/utils/nfsstat/nfsstat.man ${D}${mandir}/man8/nfsstat.8
69 install -m 0644 ${S}/utils/nhfsstone/nhfsgraph.man ${D}${mandir}/man8/nhfsgraph.8
70 install -m 0644 ${S}/utils/nhfsstone/nhfsnums.man ${D}${mandir}/man8/nhfsnums.8
71 install -m 0644 ${S}/utils/nhfsstone/nhfsrun.man ${D}${mandir}/man8/nhfsrun.8
72 install -m 0644 ${S}/utils/nhfsstone/nhfsstone.man ${D}${mandir}/man8/nhfsstone.8
73 install -m 0644 ${S}/utils/rquotad/rquotad.man ${D}${mandir}/man8/rquotad.8
74 install -m 0644 ${S}/utils/showmount/showmount.man ${D}${mandir}/man8/showmount.8
75 install -m 0644 ${S}/utils/statd/statd.man ${D}${mandir}/man8/statd.8
76}