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 /meta-oe | |
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>
Diffstat (limited to 'meta-oe')
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 0000000000..6b2c75e7a8 --- /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 @@ +diff -uNr nfs-utils-1.1.2.orig//utils/exportfs/exportfs.c nfs-utils-1.1.2/utils/exportfs/exportfs.c +--- nfs-utils-1.1.2.orig//utils/exportfs/exportfs.c 2008-03-14 16:46:29.000000000 +0100 ++++ nfs-utils-1.1.2/utils/exportfs/exportfs.c 2010-05-26 10:31:23.000000000 +0200 +@@ -19,6 +19,7 @@ + #include <getopt.h> + #include <netdb.h> + #include <errno.h> ++#include <sys/stat.h> + #include "xmalloc.h" + #include "misc.h" + #include "nfslib.h" +diff -uNr nfs-utils-1.1.2.orig//utils/mount/mount.c nfs-utils-1.1.2/utils/mount/mount.c +--- nfs-utils-1.1.2.orig//utils/mount/mount.c 2008-03-14 16:46:29.000000000 +0100 ++++ nfs-utils-1.1.2/utils/mount/mount.c 2010-05-26 10:31:32.000000000 +0200 +@@ -24,6 +24,7 @@ + + #include <unistd.h> + #include <sys/types.h> ++#include <sys/stat.h> + #include <stdio.h> + #include <string.h> + #include <errno.h> +diff -uNr nfs-utils-1.1.2.orig//utils/mount/network.c nfs-utils-1.1.2/utils/mount/network.c +--- nfs-utils-1.1.2.orig//utils/mount/network.c 2008-03-14 16:46:29.000000000 +0100 ++++ nfs-utils-1.1.2/utils/mount/network.c 2010-05-26 10:31:35.000000000 +0200 +@@ -37,6 +37,7 @@ + #include <rpc/pmap_prot.h> + #include <rpc/pmap_clnt.h> + #include <sys/socket.h> ++#include <sys/stat.h> + + #include "xcommon.h" + #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 0000000000..16bdebf12e --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-tools-unset-cflags.patch @@ -0,0 +1,92 @@ +Index: nfs-utils-1.1.2/tools/Makefile.am +=================================================================== +--- nfs-utils-1.1.2.orig/tools/Makefile.am 2008-03-14 08:46:29.000000000 -0700 ++++ nfs-utils-1.1.2/tools/Makefile.am 2009-03-04 01:58:50.000000000 -0800 +@@ -5,7 +5,10 @@ + if CONFIG_RPCGEN + OPTDIRS += rpcgen + endif +- ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++CXXFLAGS=$(CXXFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + SUBDIRS = locktest rpcdebug nlmtest $(OPTDIRS) + + MAINTAINERCLEANFILES = Makefile.in +Index: nfs-utils-1.1.2/tools/locktest/Makefile.am +=================================================================== +--- nfs-utils-1.1.2.orig/tools/locktest/Makefile.am 2008-03-14 08:46:29.000000000 -0700 ++++ nfs-utils-1.1.2/tools/locktest/Makefile.am 2009-03-04 01:58:50.000000000 -0800 +@@ -1,12 +1,13 @@ + ## Process this file with automake to produce Makefile.in + + CC=$(CC_FOR_BUILD) ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++CXXFLAGS=$(CXXFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = testlk + testlk_SOURCES = testlk.c +-testlk_CFLAGS=$(CFLAGS_FOR_BUILD) +-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) +-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD) + + MAINTAINERCLEANFILES = Makefile.in +Index: nfs-utils-1.1.2/tools/nlmtest/Makefile.am +=================================================================== +--- nfs-utils-1.1.2.orig/tools/nlmtest/Makefile.am 2008-03-14 08:46:29.000000000 -0700 ++++ nfs-utils-1.1.2/tools/nlmtest/Makefile.am 2009-03-04 01:58:50.000000000 -0800 +@@ -1,5 +1,8 @@ + ## Process this file with automake to produce Makefile.in +- ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++CXXFLAGS=$(CXXFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + EXTRA_DIST = \ + README \ + host.h \ +Index: nfs-utils-1.1.2/tools/rpcgen/Makefile.am +=================================================================== +--- nfs-utils-1.1.2.orig/tools/rpcgen/Makefile.am 2008-03-14 08:46:29.000000000 -0700 ++++ nfs-utils-1.1.2/tools/rpcgen/Makefile.am 2009-03-04 01:58:50.000000000 -0800 +@@ -1,6 +1,10 @@ + ## Process this file with automake to produce Makefile.in + + CC=$(CC_FOR_BUILD) ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++CXXFLAGS=$(CXXFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + noinst_PROGRAMS = rpcgen +@@ -9,10 +13,6 @@ + rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \ + rpc_scan.h rpc_util.h + +-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD) +-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD) +-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD) +- + MAINTAINERCLEANFILES = Makefile.in + + EXTRA_DIST = rpcgen.new.1 +Index: nfs-utils-1.1.2/tools/rpcdebug/Makefile.am +=================================================================== +--- nfs-utils-1.1.2.orig/tools/rpcdebug/Makefile.am 2009-03-04 02:01:41.000000000 -0800 ++++ nfs-utils-1.1.2/tools/rpcdebug/Makefile.am 2009-03-04 02:02:42.000000000 -0800 +@@ -1,6 +1,10 @@ + ## Process this file with automake to produce Makefile.in + + CC=$(CC_FOR_BUILD) ++CFLAGS=$(CFLAGS_FOR_BUILD) ++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) ++CXXFLAGS=$(CXXFLAGS_FOR_BUILD) ++LDFLAGS=$(LDFLAGS_FOR_BUILD) + LIBTOOL = @LIBTOOL@ --tag=CC + + 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 0000000000..f242eade45 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfs-utils-uclibc-compile.patch @@ -0,0 +1,49 @@ +--- a/support/nfs/svc_socket.c.org 2007-05-11 03:40:57 +0000 ++++ b/support/nfs/svc_socket.c 2007-10-24 15:20:05 +0000 +@@ -67,8 +67,13 @@ + memset (&addr, 0, sizeof (addr)); + addr.sin_family = AF_INET; + ++#ifdef __UCLIBC__ ++ rpcp = getrpcbynumber (number); ++ ret = 0; ++#else + ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata, + &rpcp); ++#endif + if (ret == 0 && rpcp != NULL) + { + /* First try name. */ +--- a/utils/mountd/cache.c.org 2007-05-11 03:40:57 +0000 ++++ b/utils/mountd/cache.c 2007-10-24 15:21:53 +0000 +@@ -131,6 +131,7 @@ + pw = getpwuid(uid); + if (!pw) + rv = -1; ++#ifndef __UCLIBC__ + else { + rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); + if (rv == -1 && ngroups >= 100) { +@@ -142,6 +143,7 @@ + groups, &ngroups); + } + } ++#endif + qword_printint(f, uid); + qword_printint(f, time(0)+30*60); + if (rv >= 0) { +--- a/tools/rpcgen/rpc_cout.c.org 2007-05-11 03:40:57 +0000 ++++ b/tools/rpcgen/rpc_cout.c 2007-10-24 15:23:17 +0000 +@@ -647,7 +647,11 @@ + int freed=0; + + if(flag == PUT) ++#ifdef __UCLIBC__ ++ f_print(fout,"\t\t IXDR_PUT_"); ++#else + f_print(fout,"\t\t (void) IXDR_PUT_"); ++#endif + else + if(rel== REL_ALIAS) + f_print(fout,"\t\t objp->%s = IXDR_GET_",decl->name); + 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 0000000000..b4c7662ce0 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils-1.1.2/nfsserver @@ -0,0 +1,149 @@ +#!/bin/sh +# +# Startup script for nfs-utils +# +# +# The environment variable NFS_SERVERS may be set in /etc/default/nfsd +# Other control variables may be overridden here too +test -r /etc/default/nfsd && . /etc/default/nfsd +# +# Location of executables: +test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd +test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd +test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd +# +# The user mode program must also exist (it just starts the kernel +# threads using the kernel module code). +test -x "$NFS_MOUNTD" || exit 0 +test -x "$NFS_NFSD" || exit 0 +# +# Default is 8 threads, value is settable between 1 and the truely +# ridiculous 99 +test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 +# +# The default state directory is /var/lib/nfs +test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs +# +#---------------------------------------------------------------------- +# Startup and shutdown functions. +# Actual startup/shutdown is at the end of this file. +#directories +create_directories(){ + echo -n 'creating NFS state directory: ' + mkdir -p "$NFS_STATEDIR" + ( cd "$NFS_STATEDIR" + umask 077 + mkdir -p sm sm.bak + test -w sm/state || { + rm -f sm/state + :>sm/state + } + umask 022 + for file in xtab etab smtab rmtab + do + test -w "$file" || { + rm -f "$file" + :>"$file" + } + done + ) + echo done +} +#mountd +start_mountd(){ + echo -n 'starting mountd: ' + start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@" + echo done +} +stop_mountd(){ + echo -n 'stopping mountd: ' + start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD" + echo done +} +# +#nfsd +start_nfsd(){ + echo -n "starting $1 nfsd kernel threads: " + start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" + echo done +} +delay_nfsd(){ + for delay in 0 1 2 3 4 5 6 7 8 9 + do + if pidof nfsd >/dev/null + then + echo -n . + sleep 1 + else + return 0 + fi + done + return 1 +} +stop_nfsd(){ + # WARNING: this kills any process with the executable + # name 'nfsd'. + echo -n 'stopping nfsd: ' + start-stop-daemon --stop --quiet --signal 1 --name nfsd + if delay_nfsd || { + echo failed + echo ' using signal 9: ' + start-stop-daemon --stop --quiet --signal 9 --name nfsd + delay_nfsd + } + then + echo done + # This will remove, recursively, dependencies + echo -n 'removing nfsd kernel module: ' + if modprobe -r nfsd + then + echo done + else + echo failed + fi + else + echo failed + fi +} + +#statd +start_statd(){ + echo -n "starting statd: " + start-stop-daemon --start --exec "$NFS_STATD" + echo done +} +stop_statd(){ + # WARNING: this kills any process with the executable + # name 'statd'. + echo -n 'stopping statd: ' + start-stop-daemon --stop --quiet --signal 1 --name statd + echo done +} +#---------------------------------------------------------------------- +# +# supported options: +# start +# stop +# reload: reloads the exports file +# restart: stops and starts mountd +#FIXME: need to create the /var/lib/nfs/... directories +case "$1" in +start) create_directories + start_nfsd "$NFS_SERVERS" + start_mountd + start_statd + test -r /etc/exports && exportfs -a;; +stop) exportfs -ua + stop_statd + stop_mountd + stop_nfsd;; +reload) test -r /etc/exports && exportfs -r;; +restart)exportfs -ua + stop_mountd + stop_statd + # restart does not restart the kernel threads, + # only the user mode processes + start_mountd + start_statd + test -r /etc/exports && exportfs -a;; +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 0000000000..9510b30694 --- /dev/null +++ b/meta-oe/recipes-support/nfs-utils/nfs-utils_1.1.2.bb @@ -0,0 +1,54 @@ +DESCRIPTION = "userspace utilities for kernel nfs" +PRIORITY = "optional" +SECTION = "console/network" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +PR = "r9" + +DEPENDS = "util-linux tcp-wrappers libevent" + +SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.gz \ + file://nfs-utils-tools-unset-cflags.patch \ + file://nfs-utils-uclibc-compile.patch \ + file://nfs-utils-S_ISREG-missing-include.patch \ + file://nfsserver \ + " + +S = "${WORKDIR}/nfs-utils-${PV}/" + +PARALLEL_MAKE = "" + +# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will +# pull in the remainder of the dependencies. +RDEPENDS_${PN} = "portmap" +RRECOMMENDS_${PN} = "kernel-module-nfsd" + +INITSCRIPT_NAME = "nfsserver" +# The server has no dependencies at the user run levels, so just put +# it in at the default levels. It must be terminated before the network +# in the shutdown levels, but that works fine. +INITSCRIPT_PARAMS = "defaults" + +inherit autotools update-rc.d + +EXTRA_OECONF = "--with-statduser=nobody \ + --enable-nfsv3 \ + --disable-nfsv4 \ + --disable-gss \ + --with-statedir=/var/lib/nfs" + +INHIBIT_AUTO_STAGE = "1" + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver + + rm ${D}${sbindir}/rpcdebug +} + +PACKAGES =+ "nfs-utils-client" +FILES_nfs-utils-client = "${base_sbindir}/*mount.nfs*" + +SRC_URI[md5sum] = "76ee9274c2b867839427eba91b327f03" +SRC_URI[sha256sum] = "1d09b1c133e4eed9d2df07ead4eba813e6993875c39e66d7b4081287029d4033" |