From e2e6f6fe07049f33cb6348780fa975162752e421 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 12 Dec 2013 13:38:32 +0100 Subject: initial commit of Enea Linux 3.1 Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau --- .../nfs-utils/files/Set_nobody_user_group.patch | 18 +++ .../nfs-utils/files/fix-ac-prereq.patch | 13 ++ .../nfs-utils/libnfsidmap_0.25.bb | 26 ++++ .../nfs-utils/nfs-utils/nfs-mountd.service | 11 ++ .../nfs-utils/nfs-utils/nfs-server.service | 18 +++ .../nfs-utils/nfs-utils/nfs-statd.service | 12 ++ .../nfs-utils/nfs-utils-1.0.6-uclibc.patch | 27 ++++ .../nfs-utils-1.2.3-sm-notify-res_init.patch | 36 +++++ .../nfs-utils/nfs-utils/nfs-utils.conf | 35 +++++ .../nfs-utils/nfs-utils/nfsserver | 164 +++++++++++++++++++++ .../nfs-utils/nfs-utils_1.2.8.bb | 92 ++++++++++++ 11 files changed, 452 insertions(+) create mode 100644 meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch create mode 100644 meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch create mode 100644 meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb (limited to 'meta/recipes-connectivity/nfs-utils') diff --git a/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch b/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch new file mode 100644 index 0000000000..4633da919e --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/files/Set_nobody_user_group.patch @@ -0,0 +1,18 @@ +Set nobody user and group + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Roy.Li +--- a/idmapd.conf ++++ b/idmapd.conf +@@ -17,8 +17,8 @@ + + [Mapping] + +-#Nobody-User = nobody +-#Nobody-Group = nobody ++Nobody-User = nobody ++Nobody-Group = nogroup + + [Translation] + diff --git a/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch b/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch new file mode 100644 index 0000000000..d81c7c5f32 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/files/fix-ac-prereq.patch @@ -0,0 +1,13 @@ +Upstream-Status: Inappropriate [configuration] + +--- a/configure.in ++++ b/configure.in +@@ -1,7 +1,7 @@ + # -*- Autoconf -*- + # Process this file with autoconf to produce a configure script. + +-AC_PREREQ([2.68]) ++AC_PREREQ([2.65]) + AC_INIT([libnfsidmap],[0.25],[linux-nfs@vger.kernel.org]) + AC_CONFIG_SRCDIR([nfsidmap.h]) + AC_CONFIG_MACRO_DIR([m4]) diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb new file mode 100644 index 0000000000..77c4a001e8 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb @@ -0,0 +1,26 @@ +SUMMARY = "NFS id mapping library" +DESCRIPTION = "NFS id mapping library" +HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/" +SECTION = "libs" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37" +PR = "r0" + +SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \ + file://fix-ac-prereq.patch \ + file://Set_nobody_user_group.patch \ + " + +SRC_URI[md5sum] = "2ac4893c92716add1a1447ae01df77ab" +SRC_URI[sha256sum] = "656d245d84400e1030f8f40a5a27da76370690c4a932baf249110f047fe7efcf" + +inherit autotools + +EXTRA_OECONF = "--disable-ldap" + +do_install_append () { + install -d ${D}${sysconfdir}/ + install -m 0644 ${WORKDIR}/${BPN}-${PV}/idmapd.conf ${D}${sysconfdir}/idmapd.conf +} + diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service new file mode 100644 index 0000000000..613ddc003a --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service @@ -0,0 +1,11 @@ +[Unit] +Description=NFS Mount Daemon +After=rpcbind.service nfs-server.service +Requires=rpcbind.service nfs-server.service + +[Service] +EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf +ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service new file mode 100644 index 0000000000..147d7a7b5f --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service @@ -0,0 +1,18 @@ +[Unit] +Description=NFS Server +Requires=rpcbind.service nfs-mountd.service +After=rpcbind.service + +[Service] +Type=oneshot +EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf +ExecStartPre=@SBINDIR@/exportfs -r +ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT +ExecStop=@SBINDIR@/rpc.nfsd 0 +ExecStopPost=@SBINDIR@/exportfs -f +ExecReload=@SBINDIR@/exportfs -r +StandardError=syslog +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service new file mode 100644 index 0000000000..746dacf056 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service @@ -0,0 +1,12 @@ +[Unit] +Description=NFS file locking service +After=rpcbind.service +Requires=rpcbind.service +Before=remote-fs-pre.target + +[Service] +EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf +ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS + +[Install] +WantedBy=multi-user.target 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 0000000000..c3442380e1 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch @@ -0,0 +1,27 @@ +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] + +Index: nfs-utils-1.2.6/support/nfs/svc_socket.c +=================================================================== +--- nfs-utils-1.2.6.orig/support/nfs/svc_socket.c 2012-05-14 07:40:52.000000000 -0700 ++++ nfs-utils-1.2.6/support/nfs/svc_socket.c 2012-10-28 02:42:50.179222457 -0700 +@@ -40,8 +40,9 @@ + char rpcdata[1024], servdata[1024]; + struct rpcent rpcbuf, *rpcp; + struct servent servbuf, *servp = NULL; +- int ret; ++ int ret = 0; + ++#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */ + ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata, + &rpcp); + if (ret == 0 && rpcp != NULL) { +@@ -60,6 +61,7 @@ + } + } + } ++#endif /* __UCLIBC__ */ + + if (ret == 0 && servp != NULL) + return ntohs(servp->s_port); diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch new file mode 100644 index 0000000000..d8f8181670 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch @@ -0,0 +1,36 @@ +Fixes errors like +sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later +This error will occur anytime sm-notify is run before the network if fully up, +which is happening more and more with parallel startup systems. +The res_init() call is simple, safe, quick, and a patch to use it should be +able to go upstream. Presumably the whole reason sm-notify tries several +times is to wait for possible changes to the network configuration, but without +calling res_init() it will never be aware of those changes + +Backported drom Fedora + +Upstream-Status: Pending +Signed-off-by: Khem Raj + + +diff -up nfs-utils-1.2.3/utils/statd/sm-notify.c.orig nfs-utils-1.2.3/utils/statd/sm-notify.c +--- nfs-utils-1.2.3/utils/statd/sm-notify.c.orig 2010-09-28 08:24:16.000000000 -0400 ++++ nfs-utils-1.2.3/utils/statd/sm-notify.c 2010-10-15 16:44:43.487119601 -0400 +@@ -28,6 +28,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include "sockaddr.h" + #include "xlog.h" +@@ -84,6 +87,7 @@ smn_lookup(const char *name) + }; + int error; + ++ res_init(); + error = getaddrinfo(name, NULL, &hint, &ai); + if (error != 0) { + xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error)); diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf new file mode 100644 index 0000000000..a1007a7fbf --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf @@ -0,0 +1,35 @@ +# Parameters to be passed to nfs-utils (clients & server) service files. +# + +# Options to pass to rpc.nfsd. +NFSD_OPTS="" + +# Number of servers to start up; the default is 8 servers. +NFSD_COUNT="" + +# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". +PROCNFSD_MOUNTPOINT="" + +# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". +PROCNFSD_MOUNTOPTS="" + +# Options for rpc.mountd. +# If you have a port-based firewall, you might want to set up +# a fixed port here using the --port option. +MOUNTD_OPTS="" + +# Parameters to be passed to nfs-common (nfs clients & server) init script. +# + +# If you do not set values for the NEED_ options, they will be attempted +# autodetected; this should be sufficient for most people. Valid alternatives +# for the NEED_ options are "yes" and "no". + +# Do you want to start the statd daemon? It is not needed for NFSv4. +NEED_STATD="" + +# Options to pass to rpc.statd. +# N.B. statd normally runs on both client and server, and run-time +# options should be specified accordingly. +# STATD_OPTS="-p 32765 -o 32766" +STATD_OPTS="" 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 0000000000..1ac6fec023 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver @@ -0,0 +1,164 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: nfs-kernel-server +# Required-Start: $remote_fs $portmap hwclock +# Required-Stop: $remote_fs $portmap hwclock +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Kernel NFS server support +# Description: NFS is a popular protocol for file sharing across +# TCP/IP networks. This service provides NFS server +# functionality, which is configured via the +# /etc/exports file. +### END INIT INFO +# +# Startup script for nfs-utils +# +# Source function library. +. /etc/init.d/functions +# +# 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" != "" && 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 + 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;; +status) + status /usr/sbin/rpc.mountd + RETVAL=$? + status nfsd + rval=$? + [ $RETVAL -eq 0 ] && exit $rval + exit $RETVAL;; +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;; +*) echo "Usage: $0 {start|stop|status|reload|restart}" + exit 1;; +esac diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb new file mode 100644 index 0000000000..e3e8136c27 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb @@ -0,0 +1,92 @@ +SUMMARY = "userspace utilities for kernel nfs" +DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \ +NFS server and related tools." +HOMEPAGE = "http://nfs.sourceforge.net/" +SECTION = "console/network" + +LICENSE = "MIT & GPLv2+ & BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84" + +# util-linux for libblkid +DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3" +RDEPENDS_${PN} = "rpcbind" +RRECOMMENDS_${PN} = "kernel-module-nfsd" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.bz2 \ + file://nfs-utils-1.0.6-uclibc.patch \ + file://nfs-utils-1.2.3-sm-notify-res_init.patch \ + file://nfsserver \ + file://nfs-utils.conf \ + file://nfs-server.service \ + file://nfs-mountd.service \ + file://nfs-statd.service " + +SRC_URI[md5sum] = "6e7d97de51e428a0b8698c16ca23db77" +SRC_URI[sha256sum] = "1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6" + +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. + +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 systemd + +SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service nfs-statd.service" +SYSTEMD_AUTO_ENABLE = "disable" + +# --enable-uuid is need for cross-compiling +EXTRA_OECONF = "--with-statduser=nobody \ + --enable-mountconfig \ + --enable-libmount-mount \ + --disable-nfsv41 \ + --enable-uuid \ + --disable-gss \ + --disable-tirpc \ + --disable-nfsdcltrack \ + --with-statdpath=/var/lib/nfs/statd \ + " + +PACKAGECONFIG ??= "tcp-wrappers" +PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" + +INHIBIT_AUTO_STAGE = "1" + +PACKAGES =+ "${PN}-client ${PN}-stats" +FILES_${PN}-client = "${base_sbindir}/*mount.nfs*" +FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat" +RDEPENDS_${PN}-stats = "python" + +# Make clean needed because the package comes with +# precompiled 64-bit objects that break the build +do_compile_prepend() { + make clean +} + +do_install_append () { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${localstatedir}/lib/nfs/statd + install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver + + install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/ + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${systemd_unitdir}/system/*.service + + # kernel code as of 3.8 hard-codes this path as a default + install -d ${D}/var/lib/nfs/v4recovery + + # the following are built by CC_FOR_BUILD + rm -f ${D}${sbindir}/rpcdebug + rm -f ${D}${sbindir}/rpcgen + rm -f ${D}${sbindir}/locktest +} -- cgit v1.2.3-54-g00ecf