nfs-utils: systemd fixes
PATCH 1/6 nfs-utils: systemd fixes
- Start daemons by default like the initscripts do, but only if /etc/exports exists.
- Inform systemd.bbclass about nfs-utils-client package.
--- meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service | 1 + meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service | 1 + meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service +1 -0
@@ -2,6 +2,7 @@ Description=NFS Mount Daemon After=rpcbind.service nfs-server.service Requires=rpcbind.service nfs-server.service +ConditionPathExists=@SYSCONFDIR@/exports [Service] EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service +1 -0
@@ -2,6 +2,7 @@ Description=NFS Server Requires=rpcbind.service nfs-mountd.service After=rpcbind.service +ConditionPathExists=@SYSCONFDIR@/exports [Service] Type=oneshot
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb +1 -1
@@ -48,9 +48,9 @@ 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" -SYSTEMD_AUTO_ENABLE = "disable" # --enable-uuid is need for cross-compiling EXTRA_OECONF = "--with-statduser=rpcuser \
Signature · 1 line
2.7.4
PATCH 2/6 nfs-utils: create package nfs-utils-mount
Contains just enough to mount and unmount nfs volumes, i.e. the same as nfs-utils-client before commit 39bb7e3 ("nfs-utils:
separate package as Debain style").
Drop nfs-utils-client's dependency on bash. It contains two shell scripts, /etc/init.d/nfscommon and /usr/sbin/start-statd, both using /bin/sh.
--- meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb +6 -3
@@ -9,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84" # util-linux for libblkid DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc" -RDEPENDS_${PN}-client = "rpcbind bash" RDEPENDS_${PN} = "${PN}-client bash" RRECOMMENDS_${PN} = "kernel-module-nfsd"
@@ -71,7 +70,7 @@ PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wr PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -PACKAGES =+ "${PN}-client ${PN}-stats" +PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats" CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ ${localstatedir}/lib/nfs/rmtab \
@@ -79,7 +78,7 @@ CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ ${localstatedir}/lib/nfs/statd/state \ ${sysconfdir}/nfsmount.conf" -FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \ +FILES_${PN}-client = "${sbindir}/*statd \ ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ ${sbindir}/showmount ${sbindir}/nfsstat \ ${localstatedir}/lib/nfs \
@@ -87,6 +86,10 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \ ${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"
Signature · 1 line
2.7.4
PATCH 3/6 keyutils: new recipe (version 1.5.9)
In reply to Andreas OberritterUsed by nfs-utils for nfsidmap, if available.
--- .../nfs-utils/keyutils_1.5.9.bb | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meta/recipes-connectivity/nfs-utils/keyutils_1.5.9.bb
meta/recipes-connectivity/nfs-utils/keyutils_1.5.9.bb new file +32 -0
@@ -0,0 +1,32 @@ +SUMMARY = "Linux Key Management Utilities" +HOMEPAGE = "https://people.redhat.com/~dhowells/keyutils/" +LICENSE = "GPLv2+ & LGPLv2.1+" +LICENSE_${PN} = "GPLv2+" +LICENSE_lib${PN} = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://LICENCE.GPL;md5=5f6e72824f5da505c1f4a7197f004b45 \ + file://LICENCE.LGPL;md5=7d1cacaa3ea752b72ea5e525df54a21f" + +SRC_URI = "https://people.redhat.com/~dhowells/keyutils/${BP}.tar.bz2" +SRC_URI[md5sum] = "7f8ac985c45086b5fbcd12cecd23cf07" +SRC_URI[sha256sum] = "4da2c5552c688b65ab14d4fd40fbdf720c8b396d8ece643e040cf6e707e083ae" + +EXTRA_OEMAKE = " \ + DESTDIR=${D} \ + ETCDIR=${sysconfdir} \ + BINDIR=${bindir} \ + SBINDIR=${sbindir} \ + SHAREDIR=${datadir}/${BPN} \ + MANDIR=${mandir} \ + INCLUDEDIR=${includedir} \ + LIBDIR=${base_libdir} \ + USRLIBDIR=${libdir} \ + BUILDFOR= \ +" + +do_install() { + oe_runmake install +} + +PACKAGES =+ "lib${PN}" + +FILES_lib${PN} = "${base_libdir}/lib*${SOLIBS}"
Signature · 1 line
2.7.4
Re: [PATCH 3/6] keyutils: new recipe (version 1.5.9)
Quoted 2 lines · Andreas Oberritter
Used by nfs-utils for nfsidmap, if available.
This breaks under musl:
| key.dns_resolver.c: In function 'afsdb_hosts_to_addrs':
| key.dns_resolver.c:374:21: error: 'UINT_MAX' undeclared (first use in this function)
| unsigned int ttl = UINT_MAX, rr_ttl; | ^~~~~~~~ | key.dns_resolver.c:374:21: note: each undeclared identifier is reported
only once for each function it appears in
| key.dns_resolver.c: In function 'dns_query_afsdb':
| key.dns_resolver.c:456:22: error: 'ULONG_MAX' undeclared (first use in this function)
| unsigned long ttl = ULONG_MAX;
| ^~~~~~~~~
Ross
Re: [PATCH 3/6] keyutils: new recipe (version 1.5.9)
Quoted 15 lines · Ross
On 30 November 2016 at 22:43, Andreas Oberritter <[email protected] <mailto:[email protected]>> wrote:
Used by nfs-utils for nfsidmap, if available.
This breaks under musl:
|
key.dns_resolver.c: In function 'afsdb_hosts_to_addrs':
| key.dns_resolver.c:374:21: error: 'UINT_MAX' undeclared (first use in this function)| unsigned int ttl = UINT_MAX, rr_ttl; | ^~~~~~~~ | key.dns_resolver.c:374:21: note: each undeclared identifier is
Quoted 6 lines
reported only once for each function it appears in
|key.dns_resolver.c: In function 'dns_query_afsdb':
| key.dns_resolver.c:456:22: error: 'ULONG_MAX' undeclared (first use in this function)
| unsigned long ttl =ULONG_MAX;
| ^~~~~~~~~
Apparently there's a recipe in meta-ivi which already has a fix. I'm going to merge both recipes and resubmit.
Regards,
Andreas
Re: [PATCH 3/6] keyutils: new recipe (version 1.5.9)
Quoted 3 lines · Andreas Oberritter
Apparently there's a recipe in meta-ivi which already has a fix. I'm going to merge both recipes and resubmit.
Thanks Andreas, feel free to just send v2 for just this patch, as the rest are sitting in my staging branch already.
Ross
PATCH v2 1/1 keyutils: new recipe (version 1.5.9)
Used by nfs-utils for nfsidmap, if available. Includes a backported patch for musl and a description text from meta-ivi.
--- .../0001-Include-limits.h-for-UINT_MAX.patch | 30 ++++++++++++++++++ meta/recipes-support/keyutils/keyutils_1.5.9.bb | 37 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 meta/recipes-support/keyutils/keyutils/0001-Include-limits.h-for-UINT_MAX.patch create mode 100644 meta/recipes-support/keyutils/keyutils_1.5.9.bb
meta/recipes-support/keyutils/keyutils/0001-Include-limits.h-for-UINT_MAX.patch new file +30 -0
@@ -0,0 +1,30 @@ +Upstream-Status: Backport [git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git master] + +From ab818a7f5818177a3da09fce6aa064ef648da372 Mon Sep 17 00:00:00 2001 +From: Felix Janda <[email protected]> +Date: Sat, 4 Apr 2015 00:13:21 +0200 +Subject: [PATCH] Include <limits.h> for UINT_MAX + +Fixes building with musl libc. + +Signed-off-by: Felix Janda <[email protected]> +Signed-off-by: David Howells <[email protected]> +--- + key.dns_resolver.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/key.dns_resolver.c b/key.dns_resolver.c +index c2a9fe5..9c9d458 100644 +--- a/key.dns_resolver.c ++++ b/key.dns_resolver.c +@@ -42,6 +42,7 @@ + #include <netinet/in.h> + #include <arpa/nameser.h> + #include <arpa/inet.h> ++#include <limits.h> + #include <resolv.h> + #include <getopt.h> + #include <sys/types.h> +-- +1.9.1 +
meta/recipes-support/keyutils/keyutils_1.5.9.bb new file +37 -0
@@ -0,0 +1,37 @@ +SUMMARY = "Linux Key Management Utilities" +DESCRIPTION = "Keyutils is a set of utilities for managing the key retention \ +facility in the kernel, which can be used by filesystems, block devices and \ +more to gain and retain the authorization and encryption keys required to \ +perform secure operations." +HOMEPAGE = "https://people.redhat.com/~dhowells/keyutils/" +LICENSE = "GPLv2+ & LGPLv2.1+" +LICENSE_${PN} = "GPLv2+" +LICENSE_lib${PN} = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://LICENCE.GPL;md5=5f6e72824f5da505c1f4a7197f004b45 \ + file://LICENCE.LGPL;md5=7d1cacaa3ea752b72ea5e525df54a21f" + +SRC_URI = "https://people.redhat.com/~dhowells/keyutils/${BP}.tar.bz2 \ + file://0001-Include-limits.h-for-UINT_MAX.patch" +SRC_URI[md5sum] = "7f8ac985c45086b5fbcd12cecd23cf07" +SRC_URI[sha256sum] = "4da2c5552c688b65ab14d4fd40fbdf720c8b396d8ece643e040cf6e707e083ae" + +EXTRA_OEMAKE = " \ + DESTDIR=${D} \ + ETCDIR=${sysconfdir} \ + BINDIR=${bindir} \ + SBINDIR=${sbindir} \ + SHAREDIR=${datadir}/${BPN} \ + MANDIR=${mandir} \ + INCLUDEDIR=${includedir} \ + LIBDIR=${base_libdir} \ + USRLIBDIR=${libdir} \ + BUILDFOR= \ +" + +do_install() { + oe_runmake install +} + +PACKAGES =+ "lib${PN}" + +FILES_lib${PN} = "${base_libdir}/lib*${SOLIBS}"
Signature · 1 line
2.7.4
PATCH 4/6 nfs-utils: add packageconfig options: blkid, ipv6, libmount, nfsv4, nfsv41 and tirpc
In reply to Andreas Oberritter--- meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb +8 -7
@@ -7,8 +7,7 @@ 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" +DEPENDS = "libcap" RDEPENDS_${PN} = "${PN}-client bash" RRECOMMENDS_${PN} = "kernel-module-nfsd"
@@ -54,21 +53,23 @@ SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service" # --enable-uuid is need for cross-compiling EXTRA_OECONF = "--with-statduser=rpcuser \ --enable-mountconfig \ - --enable-libmount-mount \ - --disable-nfsv41 \ - --enable-uuid \ --disable-gss \ --disable-nfsdcltrack \ --with-statdpath=/var/lib/nfs/statd \ " -PACKAGECONFIG ??= "tcp-wrappers \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \ +PACKAGECONFIG ??= "blkid libmount nfsv4 tcp-wrappers \ + ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6 tirpc', '', 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," +PACKAGECONFIG[tirpc] = "--enable-tirpc,--disable-tirpc,libtirpc" +PACKAGECONFIG[blkid] = "--enable-uuid,--disable-uuid,util-linux" +PACKAGECONFIG[libmount] = "--enable-libmount-mount,--disable-libmount-mount,util-linux" +PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,libevent libnfsidmap keyutils sqlite3" +PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,lvm2" PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
Signature · 1 line
2.7.4
PATCH 5/6 nfs-utils: don't try to load kernel module
In reply to Andreas OberritterThis conflicts with KERNEL_MODULE_AUTOLOAD += "nfsd".
--- meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb | 2 -- 1 file changed, 2 deletions(-)
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb +0 -2
@@ -126,8 +126,6 @@ do_install_append () { -e 's,@SYSCONFDIR@,${sysconfdir},g' \ ${D}${systemd_unitdir}/system/*.service if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${sysconfdir}/modules-load.d - echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf 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
Signature · 1 line
2.7.4
PATCH 6/6 nfs-utils: sync systemd unit files with nfs-utils.git
In reply to Andreas Oberritternfs-server failed to start after installation from a package feed.
--- .../nfs-utils/nfs-utils/nfs-mountd.service | 7 +++++-- .../nfs-utils/nfs-utils/nfs-server.service | 11 ++++++++--- .../nfs-utils/nfs-utils/nfs-statd.service | 9 +++++---- 3 files changed, 18 insertions(+), 9 deletions(-)
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service +5 -2
@@ -1,7 +1,10 @@ [Unit] Description=NFS Mount Daemon -After=rpcbind.service nfs-server.service -Requires=rpcbind.service nfs-server.service +DefaultDependencies=no +Requires=proc-fs-nfsd.mount +After=proc-fs-nfsd.mount +After=network.target local-fs.target +BindsTo=nfs-server.service ConditionPathExists=@SYSCONFDIR@/exports [Service]
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service +8 -3
@@ -1,7 +1,11 @@ [Unit] -Description=NFS Server -Requires=rpcbind.service nfs-mountd.service -After=rpcbind.service +Description=NFS server and services +DefaultDependencies=no +Requires=network.target proc-fs-nfsd.mount +Requires=nfs-mountd.service +Wants=rpcbind.service +After=local-fs.target +After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service ConditionPathExists=@SYSCONFDIR@/exports [Service]
@@ -10,6 +14,7 @@ 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 -au ExecStopPost=@SBINDIR@/exportfs -f ExecReload=@SBINDIR@/exportfs -r StandardError=syslog
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service +5 -4
@@ -1,8 +1,9 @@ [Unit] -Description=NFS file locking service -After=rpcbind.service -Requires=rpcbind.service -Before=remote-fs-pre.target +Description=NFS status monitor for NFSv2/3 locking. +DefaultDependencies=no +Conflicts=umount.target +Requires=nss-lookup.target rpcbind.service +After=network.target nss-lookup.target rpcbind.service [Service] EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
Signature · 1 line
2.7.4