summaryrefslogtreecommitdiff
path: root/opt/nfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'opt/nfs-utils')
-rw-r--r--opt/nfs-utils/.footprint97
-rw-r--r--opt/nfs-utils/.signature9
-rw-r--r--opt/nfs-utils/MAKEPKG86
-rw-r--r--opt/nfs-utils/musl-getservbyport.patch18
-rw-r--r--opt/nfs-utils/musl-includes.patch11
-rw-r--r--opt/nfs-utils/musl-rpc-compat.c26
6 files changed, 247 insertions, 0 deletions
diff --git a/opt/nfs-utils/.footprint b/opt/nfs-utils/.footprint
new file mode 100644
index 0000000..46a45cd
--- /dev/null
+++ b/opt/nfs-utils/.footprint
@@ -0,0 +1,97 @@
+drwxr-xr-x root/root etc/
+-rw-r--r-- root/root etc/exports (EMPTY)
+drwxr-xr-x root/root etc/exports.d/
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/include/
+-rw-r--r-- root/root usr/include/nfsidmap.h
+-rw-r--r-- root/root usr/include/nfsidmap_plugin.h
+drwxr-xr-x root/root usr/lib/
+-rwxr-xr-x root/root usr/lib/libnfsidmap.so.1.0.0
+lrwxrwxrwx root/root usr/lib/libnfsidmap.so -> libnfsidmap.so.1.0.0
+lrwxrwxrwx root/root usr/lib/libnfsidmap.so.1 -> libnfsidmap.so.1.0.0
+drwxr-xr-x root/root usr/lib/libnfsidmap/
+-rwxr-xr-x root/root usr/lib/libnfsidmap/nsswitch.so
+-rwxr-xr-x root/root usr/lib/libnfsidmap/regex.so
+-rwxr-xr-x root/root usr/lib/libnfsidmap/static.so
+drwxr-xr-x root/root usr/lib/pkgconfig/
+-rw-r--r-- root/root usr/lib/pkgconfig/libnfsidmap.pc
+drwxr-xr-x root/root usr/lib/udev/
+drwxr-xr-x root/root usr/lib/udev/rules.d/
+-rw-r--r-- root/root usr/lib/udev/rules.d/99-nfs.rules
+drwxr-xr-x root/root usr/libexec/
+-rwxr-xr-x root/root usr/libexec/nfsrahead
+drwxr-xr-x root/root usr/sbin/
+-rwxr-xr-x root/root usr/sbin/exportfs
+-rwxr-xr-x root/root usr/sbin/fsidd
+-rws--x--x root/root usr/sbin/mount.nfs
+-rwxr-xr-x root/root usr/sbin/mountstats
+-rwxr-xr-x root/root usr/sbin/nfsconf
+-rwxr-xr-x root/root usr/sbin/nfsdcld
+-rwxr-xr-x root/root usr/sbin/nfsdclddb
+-rwxr-xr-x root/root usr/sbin/nfsdclnts
+-rwxr-xr-x root/root usr/sbin/nfsdctl
+-rwxr-xr-x root/root usr/sbin/nfsidmap
+-rwxr-xr-x root/root usr/sbin/nfsiostat
+-rwxr-xr-x root/root usr/sbin/nfsstat
+-rwxr-xr-x root/root usr/sbin/rpc.idmapd
+-rwxr-xr-x root/root usr/sbin/rpc.mountd
+-rwxr-xr-x root/root usr/sbin/rpc.nfsd
+-rwxr-xr-x root/root usr/sbin/rpc.statd
+-rwxr-xr-x root/root usr/sbin/rpcctl
+-rwxr-xr-x root/root usr/sbin/rpcdebug
+-rwxr-xr-x root/root usr/sbin/showmount
+-rwxr-xr-x root/root usr/sbin/sm-notify
+-rwxr-xr-x root/root usr/sbin/start-statd
+lrwxrwxrwx root/root usr/sbin/mount.nfs4 -> mount.nfs
+lrwxrwxrwx root/root usr/sbin/umount.nfs -> mount.nfs
+lrwxrwxrwx root/root usr/sbin/umount.nfs4 -> mount.nfs
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man3/
+-rw-r--r-- root/root usr/share/man/man3/nfs4_uid_to_name.3.gz
+drwxr-xr-x root/root usr/share/man/man5/
+-rw-r--r-- root/root usr/share/man/man5/exports.5.gz
+-rw-r--r-- root/root usr/share/man/man5/idmapd.conf.5.gz
+-rw-r--r-- root/root usr/share/man/man5/nfs.5.gz
+-rw-r--r-- root/root usr/share/man/man5/nfs.conf.5.gz
+-rw-r--r-- root/root usr/share/man/man5/nfsmount.conf.5.gz
+-rw-r--r-- root/root usr/share/man/man5/nfsrahead.5.gz
+drwxr-xr-x root/root usr/share/man/man7/
+-rw-r--r-- root/root usr/share/man/man7/nfs.systemd.7.gz
+-rw-r--r-- root/root usr/share/man/man7/nfsd.7.gz
+drwxr-xr-x root/root usr/share/man/man8/
+-rw-r--r-- root/root usr/share/man/man8/exportfs.8.gz
+-rw-r--r-- root/root usr/share/man/man8/idmapd.8.gz
+-rw-r--r-- root/root usr/share/man/man8/mount.nfs.8.gz
+-rw-r--r-- root/root usr/share/man/man8/mountd.8.gz
+-rw-r--r-- root/root usr/share/man/man8/mountstats.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsconf.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsd.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsdcld.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsdclddb.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsdclnts.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsdctl.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsidmap.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsiostat.8.gz
+-rw-r--r-- root/root usr/share/man/man8/nfsstat.8.gz
+-rw-r--r-- root/root usr/share/man/man8/rpcctl.8.gz
+-rw-r--r-- root/root usr/share/man/man8/rpcdebug.8.gz
+-rw-r--r-- root/root usr/share/man/man8/showmount.8.gz
+-rw-r--r-- root/root usr/share/man/man8/sm-notify.8.gz
+-rw-r--r-- root/root usr/share/man/man8/statd.8.gz
+-rw-r--r-- root/root usr/share/man/man8/umount.nfs.8.gz
+lrwxrwxrwx root/root usr/share/man/man8/rpc.idmapd.8.gz -> idmapd.8.gz
+lrwxrwxrwx root/root usr/share/man/man8/rpc.mountd.8.gz -> mountd.8.gz
+lrwxrwxrwx root/root usr/share/man/man8/rpc.nfsd.8.gz -> nfsd.8.gz
+lrwxrwxrwx root/root usr/share/man/man8/rpc.sm-notify.8.gz -> sm-notify.8.gz
+lrwxrwxrwx root/root usr/share/man/man8/rpc.statd.8.gz -> statd.8.gz
+drwxr-xr-x root/root var/
+drwxr-xr-x root/root var/lib/
+drwxr-xr-x root/root var/lib/nfs/
+-rw-r--r-- root/root var/lib/nfs/etab (EMPTY)
+-rw-r--r-- root/root var/lib/nfs/rmtab (EMPTY)
+-rw------- nobody/root var/lib/nfs/state (EMPTY)
+drwxr-xr-x root/root var/lib/nfs/rpc_pipefs/
+drwx------ nobody/root var/lib/nfs/sm.bak/
+drwx------ nobody/root var/lib/nfs/sm/
+drwxr-xr-x root/root var/lib/nfs/v4recovery/
diff --git a/opt/nfs-utils/.signature b/opt/nfs-utils/.signature
new file mode 100644
index 0000000..f27f357
--- /dev/null
+++ b/opt/nfs-utils/.signature
@@ -0,0 +1,9 @@
+RWTZ9IduCSQ/mIr+y+U4aMaxR6WDUpO3pRhvvdahrqSldBNS3SQbVGGa5vcAgP6YPsij/vOmADtekDvQS73EdQPJV5epjsDx0w4=
+
+SHA256 (MAKEPKG) = 92c17e8ba6bafb6174608ad06ea41ae4e51b173b462cce20579ecbec697f8481
+SHA256 (.footprint) = 7f155a4b5eeeef2ad46ac573471f33a3d6d16cbd0dea9062371f961744a3bca6
+SHA256 (nfs-utils-3.1.1.tar.xz) = 7dbc05eb8b32828b322872b759a62cb3979cb4118f344dd8616813d1390e84e0
+SHA256 (musl-rpc-compat.c) = 82e80caa07bb84e2928f55e47bcb256a794218f19866d493e8002e4b3d539d19
+SHA256 (musl-getservbyport.patch) = c163225b01417ac8e70ec21bf6c5fb8ceeaecb0e0938f01883d1410f5f776f6b
+SHA256 (musl-includes.patch) = d8477a6b7f67167dd36176ee2665640eca7f24ae743581ed7098e0e8051f1ac3
+SHA256 (nfs-utils#3.1.1-2.pkg.tar.gz) = c9167f7f6c78a0217a0b832b580be1eb0ff8535b511e01652ecc6223af1275a3
diff --git a/opt/nfs-utils/MAKEPKG b/opt/nfs-utils/MAKEPKG
new file mode 100644
index 0000000..94875e2
--- /dev/null
+++ b/opt/nfs-utils/MAKEPKG
@@ -0,0 +1,86 @@
+#!/bin/mkpkg
+# description: NFS userspace server and client tools
+# url: https://www.kernel.org/pub/linux/utils/nfs-utils/
+name=nfs-utils
+version=3.1.1
+release=2
+depends=(libtirpc keyutils libevent libcap2 util-linux sqlite libxml2)
+makedeps=(rpcsvc-proto bsd-headers libnl)
+source=(https://www.kernel.org/pub/linux/utils/nfs-utils/$version/$name-$version.tar.xz
+ musl-rpc-compat.c
+ musl-getservbyport.patch
+ musl-includes.patch)
+
+sha256sums=(
+ "7dbc05eb8b32828b322872b759a62cb3979cb4118f344dd8616813d1390e84e0"
+ "82e80caa07bb84e2928f55e47bcb256a794218f19866d493e8002e4b3d539d19"
+ "c163225b01417ac8e70ec21bf6c5fb8ceeaecb0e0938f01883d1410f5f776f6b"
+ "d8477a6b7f67167dd36176ee2665640eca7f24ae743581ed7098e0e8051f1ac3"
+)
+
+patch() {
+ cd $name-$version
+
+ patch -p1 < $SRC/musl-getservbyport.patch
+ patch -p1 < $SRC/musl-includes.patch
+
+ sed -i '1i #include <string.h>' support/nfs/fh_key_file.c
+ sed -i '/#include <sys\/types.h>/a #include <stddef.h>' support/nfs/getport.c
+
+ cp $SRC/musl-rpc-compat.c support/nsm/
+}
+
+build() {
+ cd $name-$version
+
+ # Build compat stubs so configure finds getrpcbynumber
+ cc $CFLAGS -c support/nsm/musl-rpc-compat.c -o musl-rpc-compat.o
+ ar rcs libmusl-rpc-compat.a musl-rpc-compat.o
+
+ # lld strictness
+ export LDFLAGS="$LDFLAGS -Wl,--undefined-version"
+ export LIBS="-L$PWD -lmusl-rpc-compat -lsqlite3 -levent_core"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --sbindir=/usr/sbin \
+ --disable-gss \
+ --disable-junction \
+ --without-systemd \
+ --without-tcp-wrappers
+
+ # clang treats K&R empty parens as errors with -Werror=strict-prototypes
+ find . -name Makefile -exec sed -i 's/-Werror[^ ]*//g' {} +
+
+ make
+ make DESTDIR=$PKG install
+
+ # Guard: only shuffle if something actually landed in /sbin
+ if [ -d "$PKG/sbin" ] && [ "$(ls -A $PKG/sbin 2>/dev/null)" ]; then
+ mv $PKG/sbin/* $PKG/usr/sbin/
+ rmdir $PKG/sbin
+ elif [ -d "$PKG/sbin" ]; then
+ rmdir $PKG/sbin
+ fi
+
+ install -dm755 $PKG/etc/exports.d
+ install -dm755 $PKG/var/lib/nfs/rpc_pipefs
+ install -dm755 $PKG/var/lib/nfs/v4recovery
+
+ # Default empty exports file
+ install -m644 /dev/null $PKG/etc/exports
+
+ # Remove man pages for disabled features
+ rm -f $PKG/usr/share/man/man8/rpc.gssd.8
+ rm -f $PKG/usr/share/man/man8/rpc.svcgssd.8
+ rm -f $PKG/usr/share/man/man8/blkmapd.8
+
+ find $PKG \( -name '*.la' -o -name '*.a' \) -delete
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+# vim: filetype=sh
diff --git a/opt/nfs-utils/musl-getservbyport.patch b/opt/nfs-utils/musl-getservbyport.patch
new file mode 100644
index 0000000..6a491d4
--- /dev/null
+++ b/opt/nfs-utils/musl-getservbyport.patch
@@ -0,0 +1,18 @@
+Musl will always return something with getservbyport so we cannot skip
+ports that returns non-null.
+
+diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
+index fd576d9..d72a0bf 100644
+--- a/utils/statd/rmtcall.c
++++ b/utils/statd/rmtcall.c
+@@ -93,8 +93,10 @@
+ __func__);
+ break;
+ }
++#if defined(__GLIBC__)
+ se = getservbyport(sin.sin_port, "udp");
+ if (se == NULL)
++#endif
+ break;
+
+ if (retries == MAX_BRP_RETRIES) {
diff --git a/opt/nfs-utils/musl-includes.patch b/opt/nfs-utils/musl-includes.patch
new file mode 100644
index 0000000..4c22033
--- /dev/null
+++ b/opt/nfs-utils/musl-includes.patch
@@ -0,0 +1,11 @@
+missing include for basename(3)
+--- a/utils/nfsdctl/nfsdctl.c
++++ b/utils/nfsdctl/nfsdctl.c
+@@ -19,6 +19,7 @@
+ #include <string.h>
+ #include <sched.h>
+ #include <sys/queue.h>
++#include <libgen.h>
+ #include <limits.h>
+
+ #include <netlink/genl/family.h>
diff --git a/opt/nfs-utils/musl-rpc-compat.c b/opt/nfs-utils/musl-rpc-compat.c
new file mode 100644
index 0000000..08dd3e4
--- /dev/null
+++ b/opt/nfs-utils/musl-rpc-compat.c
@@ -0,0 +1,26 @@
+/*
+ * musl-rpc-compat.c - stubs for glibc NSS RPC functions missing in musl
+ *
+ * getrpcbynumber() and getrpcbyname() look up RPC service entries
+ * from /etc/rpc. musl does not implement these. The functions are
+ * only used for logging/display purposes in rpcbind, so returning
+ * NULL (not found) is safe.
+ */
+
+#include <stddef.h>
+
+struct rpcent {
+ char *r_name;
+ char **r_aliases;
+ int r_number;
+};
+
+struct rpcent *getrpcbynumber(int number) {
+ (void)number;
+ return NULL;
+}
+
+struct rpcent *getrpcbyname(const char *name) {
+ (void)name;
+ return NULL;
+}