From 3a2e74ca70ef870734858b159cd38ee2443067ed Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 26 Jun 2018 15:59:00 +0800 Subject: nfs-utils: 2.1.1 -> 2.3.1 * Removed 001-configure-Allow-to-explicitly-disable-nfsidmap.patch, the nfsidmap is enabled when --enable-nfsv4, so I added a PACKAGECONFIG[nfsv4], and default is no since keyutils is not in oe-core by default. * Removed 0001-include-stdint.h-for-UINT16_MAX-definition.patch and nfs-utils-1.2.3-sm-notify-res_init.patch since they are already in the source. * Backported two patches from git://git.alpinelinux.org/aports to fix build with musl Signed-off-by: Robert Yang --- ...gure-Allow-to-explicitly-disable-nfsidmap.patch | 40 ------ ...nclude-stdint.h-for-UINT16_MAX-definition.patch | 27 ---- .../nfs-utils-1.2.3-sm-notify-res_init.patch | 37 ----- .../nfs-utils/nfs-utils-musl-limits.patch | 133 ++++++++++++++++++ .../nfs-utils/nfs-utils-musl-res_querydomain.patch | 22 +++ .../nfs-utils/nfs-utils_2.1.1.bb | 150 --------------------- .../nfs-utils/nfs-utils_2.3.1.bb | 150 +++++++++++++++++++++ 7 files changed, 305 insertions(+), 254 deletions(-) delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch delete 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-musl-limits.patch create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch deleted file mode 100644 index 26b558c81f..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9b84cff305866abd150cf1a4c6e7e5ebf8a7eb3a Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Fri, 15 Nov 2013 23:21:35 +0100 -Subject: [PATCH] configure: Allow to explicitly disable nfsidmap - -* keyutils availability is autodetected and builds aren't reproducible - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa ---- - configure.ac | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -Index: nfs-utils-2.1.1/configure.ac -=================================================================== ---- nfs-utils-2.1.1.orig/configure.ac -+++ nfs-utils-2.1.1/configure.ac -@@ -92,6 +92,12 @@ AC_ARG_ENABLE(nfsv4, - AC_SUBST(enable_nfsv4) - AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"]) - -+AC_ARG_ENABLE(nfsidmap, -+ [AC_HELP_STRING([--enable-nfsidmap], -+ [enable support for NFSv4 idmapper @<:@default=yes@:>@])], -+ enable_nfsidmap=$enableval, -+ enable_nfsidmap=yes) -+ - AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--disable-nfsv41], - [disable support for NFSv41 @<:@default=no@:>@])], -@@ -339,7 +345,7 @@ fi - - dnl enable nfsidmap when its support by libnfsidmap - AM_CONDITIONAL(CONFIG_NFSDCLTRACK, [test "$enable_nfsdcltrack" = "yes" ]) --AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyes"]) -+AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$enable_nfsidmap$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyesyes"]) - - - if test "$knfsd_cv_glibc2" = no; then diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch deleted file mode 100644 index 235a2c76fc..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 36b48057bce76dced335d67a2894a420967811c9 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 20 May 2017 14:07:53 -0700 -Subject: [PATCH] include stdint.h for UINT16_MAX definition - -Signed-off-by: Khem Raj ---- -Upstream-Status: Pending - - support/nsm/rpc.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/support/nsm/rpc.c b/support/nsm/rpc.c -index 4e5f40e..d91c6ea 100644 ---- a/support/nsm/rpc.c -+++ b/support/nsm/rpc.c -@@ -40,6 +40,7 @@ - - #include - #include -+#include - #include - #include - #include --- -2.13.0 - 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 deleted file mode 100644 index 89a8a57260..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch +++ /dev/null @@ -1,37 +0,0 @@ -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 - - -Index: nfs-utils-2.1.1/utils/statd/sm-notify.c -=================================================================== ---- nfs-utils-2.1.1.orig/utils/statd/sm-notify.c -+++ nfs-utils-2.1.1/utils/statd/sm-notify.c -@@ -28,6 +28,9 @@ - #include - #include - #include -+#include -+#include -+#include - - #include "conffile.h" - #include "sockaddr.h" -@@ -89,6 +92,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-musl-limits.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-limits.patch new file mode 100644 index 0000000000..7a4604be41 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-limits.patch @@ -0,0 +1,133 @@ +Fixed: +| file.c: In function 'generic_make_pathname': +| file.c:48:13: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'RAND_MAX'? +| if (size > PATH_MAX) +| ^~~~~~~~ +[snip] + +Upstream-Status: Backport [https://git.alpinelinux.org/cgit/aports/tree/main/nfs-utils/limits.patch?id=f6734a77d3caee73325f8cc1f77d1b5117a75096] + +Signed-off-by: Robert Yang +--- + support/export/export.c | 1 + + support/export/xtab.c | 1 + + support/misc/file.c | 1 + + support/nfs/xcommon.c | 1 + + support/nsm/file.c | 1 + + utils/blkmapd/device-discovery.c | 1 + + utils/gssd/krb5_util.c | 1 + + utils/mountd/cache.c | 1 + + utils/mountd/mountd.c | 1 + + utils/mountd/rmtab.c | 1 + + 10 files changed, 10 insertions(+) + +diff --git a/support/export/export.c b/support/export/export.c +--- a/support/export/export.c ++++ b/support/export/export.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include "xmalloc.h" + #include "nfslib.h" + #include "exportfs.h" +diff --git a/support/export/xtab.c b/support/export/xtab.c +--- a/support/export/xtab.c ++++ b/support/export/xtab.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "nfslib.h" + #include "exportfs.h" +diff --git a/support/misc/file.c b/support/misc/file.c +--- a/support/misc/file.c ++++ b/support/misc/file.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #include "xlog.h" + #include "misc.h" +diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c +--- a/support/nfs/xcommon.c ++++ b/support/nfs/xcommon.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + + #include "xcommon.h" + #include "nls.h" /* _() */ +diff --git a/support/nsm/file.c b/support/nsm/file.c +--- a/support/nsm/file.c ++++ b/support/nsm/file.c +@@ -85,6 +85,7 @@ + #include + #include + #include ++#include + + #include "xlog.h" + #include "nsm.h" +diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c +--- a/utils/blkmapd/device-discovery.c ++++ b/utils/blkmapd/device-discovery.c +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + #include + + #ifdef HAVE_CONFIG_H +diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c +--- a/utils/gssd/krb5_util.c ++++ b/utils/gssd/krb5_util.c +@@ -120,6 +120,7 @@ + #endif + #include + #include ++#include + + #include "gssd.h" + #include "err_util.h" +diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c +--- a/utils/mountd/cache.c ++++ b/utils/mountd/cache.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include "misc.h" + #include "nfslib.h" + #include "exportfs.h" +diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c +--- a/utils/mountd/mountd.c ++++ b/utils/mountd/mountd.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include "conffile.h" + #include "xmalloc.h" +diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c +--- a/utils/mountd/rmtab.c ++++ b/utils/mountd/rmtab.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + + #include "misc.h" + #include "exportfs.h" diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch new file mode 100644 index 0000000000..7a93450b4c --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch @@ -0,0 +1,22 @@ +Fixed: +configure: error: res_querydomain needed + +Upstream-Status: Backport [https://git.alpinelinux.org/cgit/aports/tree/main/nfs-utils/musl-res_querydomain.patch?id=f6734a77d3caee73325f8cc1f77d1b5117a75096] + +Signed-off-by: Robert Yang +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -401,7 +401,7 @@ if test "$enable_gss" = yes; then + fi + + dnl libdnsidmap specific checks +-AC_CHECK_LIB([resolv], [__res_querydomain], , AC_MSG_ERROR(res_querydomain needed)) ++AC_CHECK_LIB([resolv], [res_querydomain], , AC_MSG_ERROR(res_querydomain needed)) + + AC_ARG_ENABLE([ldap], + [AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:default=detect@:>@])]) diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb deleted file mode 100644 index 79453ad20c..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb +++ /dev/null @@ -1,150 +0,0 @@ -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 libtirpc" -RDEPENDS_${PN} = "${PN}-client bash" -RRECOMMENDS_${PN} = "kernel-module-nfsd" - -inherit useradd - -USERADD_PACKAGES = "${PN}-client" -USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \ - --shell /bin/false --user-group rpcuser" - -SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ - file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \ - file://nfs-utils-1.2.3-sm-notify-res_init.patch \ - file://nfsserver \ - file://nfscommon \ - file://nfs-utils.conf \ - file://nfs-server.service \ - file://nfs-mountd.service \ - file://nfs-statd.service \ - file://proc-fs-nfsd.mount \ - file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ - file://nfs-utils-debianize-start-statd.patch \ - file://bugfix-adjust-statd-service-name.patch \ - file://0001-include-stdint.h-for-UINT16_MAX-definition.patch \ -" - -SRC_URI[md5sum] = "59dfcb2e6254b129f901f40c86086b13" -SRC_URI[sha256sum] = "0faeb54c70b84e6bd3b9b6901544b1f6add8d246f35c1683e402daf4e0c719ef" - -# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will -# pull in the remainder of the dependencies. - -INITSCRIPT_PACKAGES = "${PN} ${PN}-client" -INITSCRIPT_NAME = "nfsserver" -INITSCRIPT_PARAMS = "defaults" -INITSCRIPT_NAME_${PN}-client = "nfscommon" -INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21" - -inherit autotools-brokensep update-rc.d systemd pkgconfig - -SYSTEMD_PACKAGES = "${PN} ${PN}-client" -SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service" -SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service" - -# --enable-uuid is need for cross-compiling -EXTRA_OECONF = "--with-statduser=rpcuser \ - --enable-mountconfig \ - --enable-libmount-mount \ - --enable-uuid \ - --disable-gss \ - --disable-nfsdcltrack \ - --with-statdpath=/var/lib/nfs/statd \ - " - -PACKAGECONFIG ??= "tcp-wrappers \ - ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ -" -PACKAGECONFIG_remove_libc-musl = "tcp-wrappers" -PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" -PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -# libdevmapper is available in meta-oe -PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper" - -PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats" - -CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ - ${localstatedir}/lib/nfs/rmtab \ - ${localstatedir}/lib/nfs/xtab \ - ${localstatedir}/lib/nfs/statd/state \ - ${sysconfdir}/nfsmount.conf" - -FILES_${PN}-client = "${sbindir}/*statd \ - ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ - ${sbindir}/showmount ${sbindir}/nfsstat \ - ${localstatedir}/lib/nfs \ - ${sysconfdir}/nfs-utils.conf \ - ${sysconfdir}/nfsmount.conf \ - ${sysconfdir}/init.d/nfscommon \ - ${systemd_unitdir}/system/nfs-statd.service" -RDEPENDS_${PN}-client = "${PN}-mount rpcbind" - -FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*" - -FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat" -RDEPENDS_${PN}-stats = "python3-core" - -FILES_${PN} += "${systemd_unitdir}" - -do_configure_prepend() { - sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ - ${S}/utils/mount/Makefile.am - - sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ - ${S}/utils/osd_login/Makefile.am -} - -# 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 -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver - install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon - - install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} - install -m 0755 ${S}/utils/mount/nfsmount.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 - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/ - install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ - ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount - fi - - # kernel code as of 3.8 hard-codes this path as a default - install -d ${D}/var/lib/nfs/v4recovery - - # chown the directories and files - chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd - chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - - # the following are built by CC_FOR_BUILD - rm -f ${D}${sbindir}/rpcdebug - rm -f ${D}${sbindir}/rpcgen - rm -f ${D}${sbindir}/locktest - - # Make python tools use python 3 - sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat - -} diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb new file mode 100644 index 0000000000..52edfb6d68 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb @@ -0,0 +1,150 @@ +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 libtirpc" +RDEPENDS_${PN} = "${PN}-client bash" +RRECOMMENDS_${PN} = "kernel-module-nfsd" + +inherit useradd + +USERADD_PACKAGES = "${PN}-client" +USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \ + --shell /bin/false --user-group rpcuser" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ + file://nfsserver \ + file://nfscommon \ + file://nfs-utils.conf \ + file://nfs-server.service \ + file://nfs-mountd.service \ + file://nfs-statd.service \ + file://proc-fs-nfsd.mount \ + file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \ + file://nfs-utils-debianize-start-statd.patch \ + file://bugfix-adjust-statd-service-name.patch \ + file://nfs-utils-musl-res_querydomain.patch \ + file://nfs-utils-musl-limits.patch \ +" + +SRC_URI[md5sum] = "d77b182a9ee396aa6221ac2401ad7046" +SRC_URI[sha256sum] = "96d06b5a86b185815760d8f04c34fdface8fa8b9949ff256ac05c3ebc08335a5" + +# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will +# pull in the remainder of the dependencies. + +INITSCRIPT_PACKAGES = "${PN} ${PN}-client" +INITSCRIPT_NAME = "nfsserver" +INITSCRIPT_PARAMS = "defaults" +INITSCRIPT_NAME_${PN}-client = "nfscommon" +INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21" + +inherit autotools-brokensep update-rc.d systemd pkgconfig + +SYSTEMD_PACKAGES = "${PN} ${PN}-client" +SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service" +SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service" + +# --enable-uuid is need for cross-compiling +EXTRA_OECONF = "--with-statduser=rpcuser \ + --enable-mountconfig \ + --enable-libmount-mount \ + --enable-uuid \ + --disable-gss \ + --disable-nfsdcltrack \ + --with-statdpath=/var/lib/nfs/statd \ + " + +PACKAGECONFIG ??= "tcp-wrappers \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ +" +PACKAGECONFIG_remove_libc-musl = "tcp-wrappers" +PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," +# libdevmapper is available in meta-oe +PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper" +# keyutils is available in meta-security +PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils" + +PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats" + +CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ + ${localstatedir}/lib/nfs/rmtab \ + ${localstatedir}/lib/nfs/xtab \ + ${localstatedir}/lib/nfs/statd/state \ + ${sysconfdir}/nfsmount.conf" + +FILES_${PN}-client = "${sbindir}/*statd \ + ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ + ${sbindir}/showmount ${sbindir}/nfsstat \ + ${localstatedir}/lib/nfs \ + ${sysconfdir}/nfs-utils.conf \ + ${sysconfdir}/nfsmount.conf \ + ${sysconfdir}/init.d/nfscommon \ + ${systemd_unitdir}/system/nfs-statd.service" +RDEPENDS_${PN}-client = "${PN}-mount rpcbind" + +FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*" + +FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat" +RDEPENDS_${PN}-stats = "python3-core" + +FILES_${PN} += "${systemd_unitdir}" + +do_configure_prepend() { + sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ + ${S}/utils/mount/Makefile.am + + sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ + ${S}/utils/osd_login/Makefile.am +} + +# 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 -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver + install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon + + install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} + install -m 0755 ${S}/utils/mount/nfsmount.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 + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/ + install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ + ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount + fi + + # kernel code as of 3.8 hard-codes this path as a default + install -d ${D}/var/lib/nfs/v4recovery + + # chown the directories and files + chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd + chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state + + # the following are built by CC_FOR_BUILD + rm -f ${D}${sbindir}/rpcdebug + rm -f ${D}${sbindir}/rpcgen + rm -f ${D}${sbindir}/locktest + + # Make python tools use python 3 + sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat + +} -- cgit 1.2.3-korg