From 098b39dc40e71a370ddd73e6f6707e537a012958 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 12 Dec 2019 18:47:30 +0100 Subject: nfs-utils: update to 2.4.2 Drop backports, and a musl patch that is no longer needed. (From OE-Core rev: 91ab8c4ba830136116e2e9486898e683e32513d8) Signed-off-by: Alexander Kanavin Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- ...include-order-between-config.h-and-stat.h.patch | 156 ------------------ .../nfs-utils/nfs-utils/clang-format-string.patch | 183 --------------------- .../nfs-utils/nfs-utils-musl-res_querydomain.patch | 46 ------ .../nfs-utils/nfs-utils_2.4.1.bb | 152 ----------------- .../nfs-utils/nfs-utils_2.4.2.bb | 149 +++++++++++++++++ 5 files changed, 149 insertions(+), 537 deletions(-) delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch delete 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.4.1.bb create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb (limited to 'meta/recipes-connectivity/nfs-utils') diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch deleted file mode 100644 index 7b0f93535f..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Fix-include-order-between-config.h-and-stat.h.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 2fbc62e2a13fc22b6ae4910e295a2c10fb790486 Mon Sep 17 00:00:00 2001 -From: Zoltan Karcagi -Date: Mon, 12 Aug 2019 13:27:16 -0400 -Subject: [PATCH] Fix include order between config.h and stat.h - -At least on Arch linux ARM, the definition of struct stat in stat.h depends -on __USE_FILE_OFFSET64. This symbol comes from config.h when defined, -therefore config.h must always be included before stat.h. Fix all -occurrences where the order is wrong by moving config.h to the top. - -This fixes the client side error "Stale file handle" when mounting from -a server running Arch Linux ARM. - -Signed-off-by: Zoltan Karcagi -Signed-off-by: Steve Dickson - -Upstream-Status: Backport -[http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=2fbc62e2a13fc22b6ae4910e295a2c10fb790486] - -Signed-off-by: Yi Zhao ---- - support/misc/nfsd_path.c | 5 ++++- - support/misc/xstat.c | 5 ++++- - support/nfs/conffile.c | 8 +++++++- - utils/blkmapd/device-discovery.c | 8 ++++---- - utils/idmapd/idmapd.c | 8 ++++---- - 5 files changed, 23 insertions(+), 11 deletions(-) - -diff --git a/support/misc/nfsd_path.c b/support/misc/nfsd_path.c -index 84e4802..f078a66 100644 ---- a/support/misc/nfsd_path.c -+++ b/support/misc/nfsd_path.c -@@ -1,3 +1,7 @@ -+#ifdef HAVE_CONFIG_H -+#include -+#endif -+ - #include - #include - #include -@@ -5,7 +9,6 @@ - #include - #include - --#include "config.h" - #include "conffile.h" - #include "xmalloc.h" - #include "xlog.h" -diff --git a/support/misc/xstat.c b/support/misc/xstat.c -index fa04788..4c997ee 100644 ---- a/support/misc/xstat.c -+++ b/support/misc/xstat.c -@@ -1,3 +1,7 @@ -+#ifdef HAVE_CONFIG_H -+#include -+#endif -+ - #include - #include - #include -@@ -5,7 +9,6 @@ - #include - #include - --#include "config.h" - #include "xstat.h" - - #ifdef HAVE_FSTATAT -diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c -index b6400be..6ba8a35 100644 ---- a/support/nfs/conffile.c -+++ b/support/nfs/conffile.c -@@ -500,7 +500,7 @@ conf_readfile(const char *path) - - if ((stat (path, &sb) == 0) || (errno != ENOENT)) { - char *new_conf_addr = NULL; -- size_t sz = sb.st_size; -+ off_t sz; - int fd = open (path, O_RDONLY, 0); - - if (fd == -1) { -@@ -517,6 +517,11 @@ conf_readfile(const char *path) - - /* only after we have the lock, check the file size ready to read it */ - sz = lseek(fd, 0, SEEK_END); -+ if (sz < 0) { -+ xlog_warn("conf_readfile: unable to determine file size: %s", -+ strerror(errno)); -+ goto fail; -+ } - lseek(fd, 0, SEEK_SET); - - new_conf_addr = malloc(sz+1); -@@ -2162,6 +2167,7 @@ conf_write(const char *filename, const char *section, const char *arg, - ret = 0; - - cleanup: -+ flush_outqueue(&inqueue, NULL); - flush_outqueue(&outqueue, NULL); - - if (buff) -diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c -index e811703..f5f9b10 100644 ---- a/utils/blkmapd/device-discovery.c -+++ b/utils/blkmapd/device-discovery.c -@@ -26,6 +26,10 @@ - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif /* HAVE_CONFIG_H */ -+ - #include - #include - #include -@@ -51,10 +55,6 @@ - #include - #include - --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif /* HAVE_CONFIG_H */ -- - #include "device-discovery.h" - #include "xcommon.h" - #include "nfslib.h" -diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c -index 62e37b8..267acea 100644 ---- a/utils/idmapd/idmapd.c -+++ b/utils/idmapd/idmapd.c -@@ -34,6 +34,10 @@ - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif /* HAVE_CONFIG_H */ -+ - #include - #include - #include -@@ -62,10 +66,6 @@ - #include - #include - --#ifdef HAVE_CONFIG_H --#include "config.h" --#endif /* HAVE_CONFIG_H */ -- - #include "xlog.h" - #include "conffile.h" - #include "queue.h" --- -2.7.4 - diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch deleted file mode 100644 index 1d693e4142..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-format-string.patch +++ /dev/null @@ -1,183 +0,0 @@ -Clang comes up with more printf format warnings -Correcting “format string is not a string literal” warning -requires us to declare that parameter is a printf style -format using the attribute flag - -Upstream-Status: Pending - -Signed-off-by: Khem Raj - -Index: nfs-utils-2.3.3/support/include/xcommon.h -=================================================================== ---- nfs-utils-2.3.3.orig/support/include/xcommon.h -+++ nfs-utils-2.3.3/support/include/xcommon.h -@@ -27,7 +27,7 @@ - - /* Functions in sundries.c that are used in mount.c and umount.c */ - char *canonicalize (const char *path); --void nfs_error (const char *fmt, ...); -+void nfs_error (const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); - void *xmalloc (size_t size); - void *xrealloc(void *p, size_t size); - void xfree(void *); -@@ -36,9 +36,9 @@ char *xstrndup (const char *s, int n); - char *xstrconcat2 (const char *, const char *); - char *xstrconcat3 (const char *, const char *, const char *); - char *xstrconcat4 (const char *, const char *, const char *, const char *); --void die (int errcode, const char *fmt, ...); -+void die (int errcode, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); - --extern void die(int err, const char *fmt, ...); -+extern void die(int err, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); - extern void (*at_die)(void); - - /* exit status - bits below are ORed */ -Index: nfs-utils-2.3.3/support/include/xlog.h -=================================================================== ---- nfs-utils-2.3.3.orig/support/include/xlog.h -+++ nfs-utils-2.3.3/support/include/xlog.h -@@ -43,10 +43,10 @@ void xlog_config(int fac, int on); - void xlog_sconfig(char *, int on); - void xlog_from_conffile(char *); - int xlog_enabled(int fac); --void xlog(int fac, const char *fmt, ...); --void xlog_warn(const char *fmt, ...); --void xlog_err(const char *fmt, ...); --void xlog_errno(int err, const char *fmt, ...); --void xlog_backend(int fac, const char *fmt, va_list args); -+void xlog(int fac, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); -+void xlog_warn(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); -+void xlog_err(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); -+void xlog_errno(int err, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3))); -+void xlog_backend(int fac, const char *fmt, va_list args) __attribute__((__format__ (__printf__, 2, 0))); - - #endif /* XLOG_H */ -Index: nfs-utils-2.3.3/support/nfs/xcommon.c -=================================================================== ---- nfs-utils-2.3.3.orig/support/nfs/xcommon.c -+++ nfs-utils-2.3.3/support/nfs/xcommon.c -@@ -93,7 +93,10 @@ nfs_error (const char *fmt, ...) { - - fmt2 = xstrconcat2 (fmt, "\n"); - va_start (args, fmt); -+#pragma clang diagnostic push -+#pragma clang diagnostic ignored "-Wformat-nonliteral" - vfprintf (stderr, fmt2, args); -+#pragma clang diagnostic pop - va_end (args); - free (fmt2); - } -Index: nfs-utils-2.3.3/utils/exportfs/exportfs.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/exportfs/exportfs.c -+++ nfs-utils-2.3.3/utils/exportfs/exportfs.c -@@ -644,6 +644,7 @@ out: - return result; - } - -+__attribute__((__format__ (__printf__, 2, 3))) - static char - dumpopt(char c, char *fmt, ...) - { -Index: nfs-utils-2.3.3/utils/statd/statd.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/statd/statd.c -+++ nfs-utils-2.3.3/utils/statd/statd.c -@@ -136,7 +136,7 @@ static void log_modes(void) - strcat(buf, "TI-RPC "); - #endif - -- xlog_warn(buf); -+ xlog_warn("%s", buf); - } - - /* -Index: nfs-utils-2.3.3/support/nfs/svc_create.c -=================================================================== ---- nfs-utils-2.3.3.orig/support/nfs/svc_create.c -+++ nfs-utils-2.3.3/support/nfs/svc_create.c -@@ -184,7 +184,7 @@ svc_create_sock(const struct sockaddr *s - type = SOCK_STREAM; - break; - default: -- xlog(D_GENERAL, "%s: Unrecognized bind address semantics: %u", -+ xlog(D_GENERAL, "%s: Unrecognized bind address semantics: %lu", - __func__, nconf->nc_semantics); - return -1; - } -Index: nfs-utils-2.3.3/support/nsm/rpc.c -=================================================================== ---- nfs-utils-2.3.3.orig/support/nsm/rpc.c -+++ nfs-utils-2.3.3/support/nsm/rpc.c -@@ -182,7 +182,7 @@ nsm_xmit_getport(const int sock, const s - uint32_t xid; - XDR xdr; - -- xlog(D_CALL, "Sending PMAP_GETPORT for %u, %u, udp", program, version); -+ xlog(D_CALL, "Sending PMAP_GETPORT for %lu, %lu, udp", program, version); - - nsm_init_xdrmem(msgbuf, NSM_MAXMSGSIZE, &xdr); - xid = nsm_init_rpc_header(PMAPPROG, PMAPVERS, -Index: nfs-utils-2.3.3/utils/mountd/cache.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/mountd/cache.c -+++ nfs-utils-2.3.3/utils/mountd/cache.c -@@ -968,8 +968,7 @@ lookup_export(char *dom, char *path, str - } else if (found_type == i && found->m_warned == 0) { - xlog(L_WARNING, "%s exported to both %s and %s, " - "arbitrarily choosing options from first", -- path, found->m_client->m_hostname, exp->m_client->m_hostname, -- dom); -+ path, found->m_client->m_hostname, exp->m_client->m_hostname); - found->m_warned = 1; - } - } -Index: nfs-utils-2.3.3/utils/mountd/mountd.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/mountd/mountd.c -+++ nfs-utils-2.3.3/utils/mountd/mountd.c -@@ -213,7 +213,7 @@ static void - sig_hup (int sig) - { - /* don't exit on SIGHUP */ -- xlog (L_NOTICE, "Received SIGHUP... Ignoring.\n", sig); -+ xlog (L_NOTICE, "Received SIGHUP(%d)... Ignoring.\n", sig); - return; - } - -Index: nfs-utils-2.3.3/utils/statd/rmtcall.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/statd/rmtcall.c -+++ nfs-utils-2.3.3/utils/statd/rmtcall.c -@@ -247,7 +247,7 @@ process_reply(FD_SET_TYPE *rfds) - xlog_warn("%s: service %d not registered on localhost", - __func__, NL_MY_PROG(lp)); - } else { -- xlog(D_GENERAL, "%s: Callback to %s (for %d) succeeded", -+ xlog(D_GENERAL, "%s: Callback to %s (for %s) succeeded", - __func__, NL_MY_NAME(lp), NL_MON_NAME(lp)); - } - nlist_free(¬ify, lp); -Index: nfs-utils-2.3.3/utils/statd/svc_run.c -=================================================================== ---- nfs-utils-2.3.3.orig/utils/statd/svc_run.c -+++ nfs-utils-2.3.3/utils/statd/svc_run.c -@@ -53,6 +53,7 @@ - - #include - #include -+#include - #include "statd.h" - #include "notlist.h" - -@@ -104,8 +105,8 @@ my_svc_run(int sockfd) - - tv.tv_sec = NL_WHEN(notify) - now; - tv.tv_usec = 0; -- xlog(D_GENERAL, "Waiting for reply... (timeo %d)", -- tv.tv_sec); -+ xlog(D_GENERAL, "Waiting for reply... (timeo %jd)", -+ (intmax_t)tv.tv_sec); - selret = select(FD_SETSIZE, &readfds, - (void *) 0, (void *) 0, &tv); - } else { 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 deleted file mode 100644 index 921f5edc82..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch +++ /dev/null @@ -1,46 +0,0 @@ -From caa19231196d73541445728e6813c8fa70345acb Mon Sep 17 00:00:00 2001 -From: Robert Yang -Date: Tue, 26 Jun 2018 15:59:00 +0800 -Subject: [PATCH] nfs-utils: 2.1.1 -> 2.3.1 - -Fixed: -configure: error: res_querydomain needed - -Upstream-Status: Pending [https://github.com/alpinelinux/aports/blob/master/main/nfs-utils/musl-configure_ac.patch] - -Signed-off-by: Robert Yang - ---- - configure.ac | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 50002b4..dcadb23 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -582,10 +582,10 @@ my_am_cflags="\ - -Wall \ - -Wextra \ - $rpcgen_cflags \ -- -Werror=missing-prototypes \ -- -Werror=missing-declarations \ -+ -Wmissing-prototypes \ -+ -Wmissing-declarations \ - -Werror=format=2 \ -- -Werror=undef \ -+ -Wundef \ - -Werror=missing-include-dirs \ - -Werror=strict-aliasing=2 \ - -Werror=init-self \ -@@ -614,10 +614,9 @@ AC_DEFUN([CHECK_CCSUPPORT], [ - - CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1]) - CHECK_CCSUPPORT([-Werror=int-conversion], [flg2]) --CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3]) - CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4]) - --AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"]) -+AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg4"]) - - # Make sure that $ACLOCAL_FLAGS are used during a rebuild - AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb deleted file mode 100644 index eb32bccb57..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.1.bb +++ /dev/null @@ -1,152 +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 libevent util-linux sqlite3 libtirpc" -RDEPENDS_${PN} = "${PN}-client" -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-debianize-start-statd.patch \ - file://bugfix-adjust-statd-service-name.patch \ - file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ - file://clang-format-string.patch \ - file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ - file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ - file://0001-Fix-include-order-between-config.h-and-stat.h.patch \ -" -SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" -SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" - -SRC_URI[md5sum] = "161efe469ec1b06f1c750bd87f8ba6dd" -SRC_URI[sha256sum] = "85274ada94479b1beba9f8eeffd19f477c53a6710b9998d1192c807854087736" - -# 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 \ - " - -CFLAGS += "-Wno-error=format-overflow" - -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 -} - -# Make clean needed because the package comes with -# precompiled 64-bit objects that break the build -do_compile_prepend() { - make clean -} - -# Works on systemd only -HIGH_RLIMIT_NOFILE ??= "4096" - -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' \ - -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},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 - - # 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.4.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb new file mode 100644 index 0000000000..df3070bd8b --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.2.bb @@ -0,0 +1,149 @@ +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 libevent util-linux sqlite3 libtirpc" +RDEPENDS_${PN} = "${PN}-client" +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-debianize-start-statd.patch \ + file://bugfix-adjust-statd-service-name.patch \ + file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ + file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ + file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \ + " +SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch" + +SRC_URI[md5sum] = "d427c6b3014e9a04e8498f0598b1c1b9" +SRC_URI[sha256sum] = "4464737a03d5f73ded2ffefe19d5543ed7b1d6c541985d8acaafdc8025aa1038" + +# 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 \ + " + +CFLAGS += "-Wno-error=format-overflow" + +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 +} + +# Make clean needed because the package comes with +# precompiled 64-bit objects that break the build +do_compile_prepend() { + make clean +} + +# Works on systemd only +HIGH_RLIMIT_NOFILE ??= "4096" + +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' \ + -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},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 + + # Make python tools use python 3 + sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat + +} -- cgit v1.2.3-54-g00ecf