summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb145
1 files changed, 145 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb
new file mode 100644
index 0000000000..42a4ba3dbd
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.4.3.bb
@@ -0,0 +1,145 @@
1SUMMARY = "userspace utilities for kernel nfs"
2DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
3NFS server and related tools."
4HOMEPAGE = "http://nfs.sourceforge.net/"
5SECTION = "console/network"
6
7LICENSE = "MIT & GPLv2+ & BSD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
9
10# util-linux for libblkid
11DEPENDS = "libcap libevent util-linux sqlite3 libtirpc"
12RDEPENDS_${PN} = "${PN}-client"
13RRECOMMENDS_${PN} = "kernel-module-nfsd"
14
15inherit useradd
16
17USERADD_PACKAGES = "${PN}-client"
18USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
19 --shell /bin/false --user-group rpcuser"
20
21SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
22 file://nfsserver \
23 file://nfscommon \
24 file://nfs-utils.conf \
25 file://nfs-server.service \
26 file://nfs-mountd.service \
27 file://nfs-statd.service \
28 file://proc-fs-nfsd.mount \
29 file://nfs-utils-debianize-start-statd.patch \
30 file://bugfix-adjust-statd-service-name.patch \
31 file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \
32 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
33 file://clang-warnings.patch \
34 "
35SRC_URI[md5sum] = "06020c76f531ed97f3145514901e0e7c"
36SRC_URI[sha256sum] = "af65fce5dd8370cff9ead67baac5a6cd69c376dcadfef264dc2c78c904f26599"
37
38# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
39# pull in the remainder of the dependencies.
40
41INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
42INITSCRIPT_NAME = "nfsserver"
43INITSCRIPT_PARAMS = "defaults"
44INITSCRIPT_NAME_${PN}-client = "nfscommon"
45INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
46
47inherit autotools-brokensep update-rc.d systemd pkgconfig
48
49SYSTEMD_PACKAGES = "${PN} ${PN}-client"
50SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
51SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
52
53# --enable-uuid is need for cross-compiling
54EXTRA_OECONF = "--with-statduser=rpcuser \
55 --enable-mountconfig \
56 --enable-libmount-mount \
57 --enable-uuid \
58 --disable-gss \
59 --disable-nfsdcltrack \
60 --with-statdpath=/var/lib/nfs/statd \
61 "
62
63PACKAGECONFIG ??= "tcp-wrappers \
64 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
65"
66PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
67PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
68PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
69# libdevmapper is available in meta-oe
70PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper"
71# keyutils is available in meta-security
72PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils"
73
74PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
75
76CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
77 ${localstatedir}/lib/nfs/rmtab \
78 ${localstatedir}/lib/nfs/xtab \
79 ${localstatedir}/lib/nfs/statd/state \
80 ${sysconfdir}/nfsmount.conf"
81
82FILES_${PN}-client = "${sbindir}/*statd \
83 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
84 ${sbindir}/showmount ${sbindir}/nfsstat \
85 ${localstatedir}/lib/nfs \
86 ${sysconfdir}/nfs-utils.conf \
87 ${sysconfdir}/nfsmount.conf \
88 ${sysconfdir}/init.d/nfscommon \
89 ${systemd_unitdir}/system/nfs-statd.service"
90RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
91
92FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
93
94FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
95RDEPENDS_${PN}-stats = "python3-core"
96
97FILES_${PN} += "${systemd_unitdir}"
98
99do_configure_prepend() {
100 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
101 ${S}/utils/mount/Makefile.am
102}
103
104# Make clean needed because the package comes with
105# precompiled 64-bit objects that break the build
106do_compile_prepend() {
107 make clean
108}
109
110# Works on systemd only
111HIGH_RLIMIT_NOFILE ??= "4096"
112
113do_install_append () {
114 install -d ${D}${sysconfdir}/init.d
115 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
116 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
117
118 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
119 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
120
121 install -d ${D}${systemd_unitdir}/system
122 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
123 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
124 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
125 sed -i -e 's,@SBINDIR@,${sbindir},g' \
126 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
127 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
128 ${D}${systemd_unitdir}/system/*.service
129 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
130 install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
131 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
132 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
133 fi
134
135 # kernel code as of 3.8 hard-codes this path as a default
136 install -d ${D}/var/lib/nfs/v4recovery
137
138 # chown the directories and files
139 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
140 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
141
142 # Make python tools use python 3
143 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
144
145}