Skip to contentSkip to conversation

nfs-utils: Add rpcbind as a runtime dependency

PATCH New Maxime Hadjinlian 3 participants 6 messages Jul 11, 2015 – Jul 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 nfs-utils: Add rpcbind as a runtime dependency

rpcbind is necessary for nfs_utils to works as a server

---
 package/nfs-utils/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/nfs-utils/Config.in +1 -0
index 66f9c21..2806551 100644
@@ -6,6 +6,7 @@ config BR2_PACKAGE_NFS_UTILS
 	bool "nfs-utils"
 	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC || BR2_TOOLCHAIN_HAS_THREADS # libtirpc
 	select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_PACKAGE_RPCBIND # runtime
 	depends on BR2_USE_MMU # fork()
 	help
 	  The NFS Linux kernel server.
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/3 nfs_utils: Fix for read-only rootfs

In order to work on a read-only rootfs, nfs_utils would like to write stuff to /var/lib/nfs, since it's not a tmpfs, it won't work.

Instead of doing little dances around the filesystem, tell nfs_utils to use /run/nfs for everyone.

Modify the startup script accordingly.

---
 package/nfs-utils/S60nfs       | 14 ++------------
 package/nfs-utils/nfs-utils.mk |  3 ++-
 2 files changed, 4 insertions(+), 13 deletions(-)
package/nfs-utils/S60nfs +2 -12
index 4afee55..91410ee 100755
@@ -8,19 +8,9 @@
 [ -x /usr/sbin/rpc.mountd ] || exit 0
 [ -x /usr/sbin/exportfs ] || exit 0
 
-# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
-[ -r /etc/exports ] || \
-    { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
-    { echo "/etc/exports does not exist" ; exit 0 ; }
-    
-# The /var/lib/nfs directory is actually on a tmpfs filesystem.
-mkdir -p /var/lib/nfs/sm
-mkdir -p /var/lib/nfs/sm.bak
 mkdir -p /var/lock/subsys
-touch /var/lib/nfs/etab
-touch /var/lib/nfs/rmtab
-touch /var/lib/nfs/state
-touch /var/lib/nfs/xtab
+mkdir -p /run/nfs/sm
+touch /run/nfs/rmtab
 
 start() {
 	# Start daemons.
package/nfs-utils/nfs-utils.mk +2 -1
index cec21e8..115a133 100644
@@ -21,6 +21,7 @@ NFS_UTILS_CONF_OPTS = \
 	--disable-uuid \
 	--disable-ipv6 \
 	--without-tcp-wrappers \
+	--with-statedir=/run/nfs \
 	--with-rpcgen=internal
 
 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug
@@ -36,8 +37,8 @@ endif
 
 define NFS_UTILS_INSTALL_FIXUP
 	rm -f $(NFS_UTILS_TARGETS_)
+	touch $(TARGET_DIR)/etc/exports
 endef
-
 NFS_UTILS_POST_INSTALL_TARGET_HOOKS += NFS_UTILS_INSTALL_FIXUP
 
 define NFS_UTILS_INSTALL_INIT_SYSV
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/3 nfs_utils: Fix for read-only rootfs

Dear Maxime Hadjinlian,

Quoted 6 lines · Maxime Hadjinlian

In order to work on a read-only rootfs, nfs_utils would like to write stuff to /var/lib/nfs, since it's not a tmpfs, it won't work.

Instead of doing little dances around the filesystem, tell nfs_utils to use /run/nfs for everyone.

Quoted 7 lines

Modify the startup script accordingly.

---
 package/nfs-utils/S60nfs       | 14 ++------------
 package/nfs-utils/nfs-utils.mk |  3 ++-
 2 files changed, 4 insertions(+), 13 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 3/3 nfs-utils: Bump version

In reply to Maxime Hadjinlian

- Refresh the patches (Thanks to Thomas Petazzoni's work)
- Change source of the package to git repository (and remove the hash, sourceforce is clearly not a platform which can be trusted nowadays)
- Rework the startup script to accomodate new rpc.statd

---
 .../nfs-utils/0001-Patch-taken-from-Gentoo.patch   |  60 ++++++++++++
 ...d-AM_CONDITIONAL-in-conditional-execution.patch |  57 ------------
 .../nfs-utils/0002-Patch-taken-from-Gentoo.patch   |  84 -----------------
 ...2-Switch-legacy-index-in-favour-of-strchr.patch |  72 +++++++++++++++
 ...figure-script-find-getrpcbynumber-in-libt.patch |  46 ++++++++++
 ...3-Switch-legacy-index-in-favour-of-strchr.patch |  73 ---------------
 package/nfs-utils/0004-fix-build-with-uClibc.patch |  31 -------
 ...-of-getrpcbynumber-when-getrpcbynumber_r-.patch |  70 --------------
 ...figure-script-find-getrpcbynumber-in-libt.patch |  38 --------
 .../0007-sockaddr-h-needs-stddef-h-for-NULL.patch  |  19 ----
 package/nfs-utils/0008-tirpc-with-pkgconfig.patch  | 102 ---------------------
 package/nfs-utils/S60nfs                           |   3 +-
 package/nfs-utils/nfs-utils.hash                   |   2 -
 package/nfs-utils/nfs-utils.mk                     |   5 +-
 14 files changed, 181 insertions(+), 481 deletions(-)
 create mode 100644 package/nfs-utils/0001-Patch-taken-from-Gentoo.patch
 delete mode 100644 package/nfs-utils/0001-build-avoid-AM_CONDITIONAL-in-conditional-execution.patch
 delete mode 100644 package/nfs-utils/0002-Patch-taken-from-Gentoo.patch
 create mode 100644 package/nfs-utils/0002-Switch-legacy-index-in-favour-of-strchr.patch
 create mode 100644 package/nfs-utils/0003-Let-the-configure-script-find-getrpcbynumber-in-libt.patch
 delete mode 100644 package/nfs-utils/0003-Switch-legacy-index-in-favour-of-strchr.patch
 delete mode 100644 package/nfs-utils/0004-fix-build-with-uClibc.patch
 delete mode 100644 package/nfs-utils/0005-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
 delete mode 100644 package/nfs-utils/0006-Let-the-configure-script-find-getrpcbynumber-in-libt.patch
 delete mode 100644 package/nfs-utils/0007-sockaddr-h-needs-stddef-h-for-NULL.patch
 delete mode 100644 package/nfs-utils/0008-tirpc-with-pkgconfig.patch
 delete mode 100644 package/nfs-utils/nfs-utils.hash
package/nfs-utils/0001-Patch-taken-from-Gentoo.patch new file +60 -0
new file mode 100644
index 0000000..47bf9db
@@ -0,0 +1,60 @@
+From 5796ca01e33596d4102dd714349c908fecc331c0 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <[email protected]>
+Date: Sat, 10 Nov 2012 18:56:12 +0100
+Subject: [PATCH] Patch taken from Gentoo
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+---
+ tools/locktest/Makefile.am | 7 +++----
+ tools/rpcgen/Makefile.am   | 8 +++-----
+ 2 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
+index 3156815..efe6fcd 100644
+--- a/tools/locktest/Makefile.am
++++ b/tools/locktest/Makefile.am
+@@ -1,12 +1,11 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = testlk
+ testlk_SOURCES = testlk.c
+-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
+-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
+-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am
+index 8a9ec89..5a5b4d3 100644
+--- a/tools/rpcgen/Makefile.am
++++ b/tools/rpcgen/Makefile.am
+@@ -1,7 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = rpcgen
+ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
+@@ -9,10 +11,6 @@ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
+ 		 rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \
+ 		 rpc_scan.h rpc_util.h
+
+-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD)
+-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD)
+-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+-rpcgen_LDADD=$(LIBTIRPC)
+
+ MAINTAINERCLEANFILES = Makefile.in
+
+--
+2.1.0
+
package/nfs-utils/0001-build-avoid-AM_CONDITIONAL-in-conditional-execution.patch deleted +0 -57

57 lines not on this page · raw message

package/nfs-utils/0002-Patch-taken-from-Gentoo.patch deleted +0 -84

84 lines not on this page · raw message

package/nfs-utils/0002-Switch-legacy-index-in-favour-of-strchr.patch new file +72 -0

72 lines not on this page · raw message

package/nfs-utils/0003-Let-the-configure-script-find-getrpcbynumber-in-libt.patch new file +46 -0

46 lines not on this page · raw message

package/nfs-utils/0003-Switch-legacy-index-in-favour-of-strchr.patch deleted +0 -73

73 lines not on this page · raw message

package/nfs-utils/0004-fix-build-with-uClibc.patch deleted +0 -31
deleted file mode 100644
index 23da28f..0000000
@@ -1,31 +0,0 @@
-From ff82d4c89d6ca771dea06bbaa06ddf3fed760402 Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-Date: Sat, 10 Nov 2012 18:58:48 +0100
-Subject: [PATCH] fix build with uClibc
-
-uClibc doesn't have/need libio.h, so don't include it from sockaddr.h
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- support/include/sockaddr.h |    5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/support/include/sockaddr.h b/support/include/sockaddr.h
-index 9af2543..5eef2ec 100644
---- a/support/include/sockaddr.h
-+++ b/support/include/sockaddr.h
-@@ -20,7 +20,10 @@
- #ifndef NFS_UTILS_SOCKADDR_H
- #define NFS_UTILS_SOCKADDR_H
- 
--#include <libio.h>
-+/* uClibc doesn't have/need libio.h */
-+#ifndef __UCLIBC__
-+#include <libio.h> 
-+#endif
- #include <stdbool.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
--- 
-1.7.9.5
-
package/nfs-utils/0005-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch deleted +0 -70

70 lines not on this page · raw message

package/nfs-utils/0006-Let-the-configure-script-find-getrpcbynumber-in-libt.patch deleted +0 -38
deleted file mode 100644
index 1ca17b7..0000000
@@ -1,38 +0,0 @@
-From 7ea7814a8b87a0faa50fb9f4a486bfd7a376f3fc Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Sat, 10 Nov 2012 18:53:03 +0100
-Subject: [PATCH] Let the configure script find getrpcbynumber in libtirpc
-
-The getrpcbynumber() function may not be available in the C library,
-but only in the libtirpc library. Take this into account when checking
-for the existence of getrpcbynumber() and getrpcbynumber_r().
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- configure.ac |   10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 41216c9..1bbecfa 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -390,7 +390,15 @@ AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
-                getnameinfo getrpcbyname getifaddrs \
-                gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
-                realpath rmdir select socket strcasecmp strchr strdup \
--               strerror strrchr strtol strtoul sigprocmask getrpcbynumber getrpcbynumber_r])
-+               strerror strrchr strtol strtoul sigprocmask])
-+
-+save_CFLAGS=$CFLAGS
-+save_LIBS=$LIBS
-+CFLAGS="$CFLAGS $AM_CPPFLAGS"
-+LIBS="$LIBS $LIBTIRPC"
-+AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
-+CFLAGS=$save_CFLAGS
-+LIBS=$save_LIBS
- 
- if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
-    AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
--- 
-1.7.9.5
-
package/nfs-utils/0007-sockaddr-h-needs-stddef-h-for-NULL.patch deleted +0 -19
deleted file mode 100644
index 8fcf1dd..0000000
@@ -1,19 +0,0 @@
-[PATCH] sockaddr.h: needs stddef.h for NULL
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- support/include/sockaddr.h |    1 +
- 1 file changed, 1 insertion(+)
-
-Index: nfs-utils-1.2.6/support/include/sockaddr.h
-===================================================================
---- nfs-utils-1.2.6.orig/support/include/sockaddr.h
-+++ nfs-utils-1.2.6/support/include/sockaddr.h
-@@ -25,6 +25,7 @@
- #include <libio.h> 
- #endif
- #include <stdbool.h>
-+#include <stddef.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- 
package/nfs-utils/0008-tirpc-with-pkgconfig.patch deleted +0 -102

102 lines not on this page · raw message

package/nfs-utils/S60nfs +1 -2
index 91410ee..37e68f8 100755
@@ -15,13 +15,12 @@ touch /run/nfs/rmtab
 start() {
 	# Start daemons.
 	echo -n "Starting NFS statd: "
-	rpc.statd
+	rpc.statd -F
 	touch /var/lock/subsys/nfslock
 	echo "done"
 
 	echo -n "Starting NFS services: "
 	/usr/sbin/exportfs -r
-	rpc.statd
 	echo "done"
 
 	echo -n "Starting NFS daemon: "
package/nfs-utils/nfs-utils.hash deleted +0 -2
deleted file mode 100644
index e36c9d0..0000000
@@ -1,2 +0,0 @@
-# Locally computed:
-sha256  70267288500408495085b7c54a667c4e8cfde5882f3193da095fc7dad2da0b83  nfs-utils-1.2.6.tar.bz2
package/nfs-utils/nfs-utils.mk +2 -3
index 115a133..09f4aef 100644
@@ -4,9 +4,8 @@
 #
 ################################################################################
 
-NFS_UTILS_VERSION = 1.2.6
-NFS_UTILS_SOURCE = nfs-utils-$(NFS_UTILS_VERSION).tar.bz2
-NFS_UTILS_SITE = http://downloads.sourceforge.net/project/nfs/nfs-utils/$(NFS_UTILS_VERSION)
+NFS_UTILS_VERSION = nfs-utils-1-3-2
+NFS_UTILS_SITE = git://git.linux-nfs.org/projects/steved/nfs-utils.git
 NFS_UTILS_LICENSE = GPLv2+
 NFS_UTILS_LICENSE_FILES = COPYING
 NFS_UTILS_AUTORECONF = YES
Signature · 1 line
2.1.4
#4 lore raw

PATCH 3/3 nfs-utils: Bump version

Quoted 5 lines · Maxime Hadjinlian

- Refresh the patches (Thanks to Thomas Petazzoni's work)
- Change source of the package to git repository (and remove the hash, sourceforce is clearly not a platform which can be trusted nowadays)
- Rework the startup script to accomodate new rpc.statd

That's a bit strange formatting for the commit log.

Quoted 5 lines
---
 .../nfs-utils/0001-Patch-taken-from-Gentoo.patch   |  60 ++++++++++++
 ...d-AM_CONDITIONAL-in-conditional-execution.patch |  57 ------------

Could you explicitly mention the new and removed patches in the commit log?
Also, use git format-patch -M so we can see what has actually changed in these patches.

Quoted 25 lines
 .../nfs-utils/0002-Patch-taken-from-Gentoo.patch   |  84 -----------------
 ...2-Switch-legacy-index-in-favour-of-strchr.patch |  72 +++++++++++++++
 ...figure-script-find-getrpcbynumber-in-libt.patch |  46 ++++++++++
 ...3-Switch-legacy-index-in-favour-of-strchr.patch |  73 ---------------
 package/nfs-utils/0004-fix-build-with-uClibc.patch |  31 -------
 ...-of-getrpcbynumber-when-getrpcbynumber_r-.patch |  70 --------------
 ...figure-script-find-getrpcbynumber-in-libt.patch |  38 --------
 .../0007-sockaddr-h-needs-stddef-h-for-NULL.patch  |  19 ----
 package/nfs-utils/0008-tirpc-with-pkgconfig.patch  | 102 ---------------------
 package/nfs-utils/S60nfs                           |   3 +-
 package/nfs-utils/nfs-utils.hash                   |   2 -
 package/nfs-utils/nfs-utils.mk                     |   5 +-
 14 files changed, 181 insertions(+), 481 deletions(-)
 create mode 100644 package/nfs-utils/0001-Patch-taken-from-Gentoo.patch
 delete mode 100644 package/nfs-utils/0001-build-avoid-AM_CONDITIONAL-in-conditional-execution.patch
 delete mode 100644 package/nfs-utils/0002-Patch-taken-from-Gentoo.patch
 create mode 100644 package/nfs-utils/0002-Switch-legacy-index-in-favour-of-strchr.patch
 create mode 100644 package/nfs-utils/0003-Let-the-configure-script-find-getrpcbynumber-in-libt.patch
 delete mode 100644 package/nfs-utils/0003-Switch-legacy-index-in-favour-of-strchr.patch
 delete mode 100644 package/nfs-utils/0004-fix-build-with-uClibc.patch
 delete mode 100644 package/nfs-utils/0005-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
 delete mode 100644 package/nfs-utils/0006-Let-the-configure-script-find-getrpcbynumber-in-libt.patch
 delete mode 100644 package/nfs-utils/0007-sockaddr-h-needs-stddef-h-for-NULL.patch
 delete mode 100644 package/nfs-utils/0008-tirpc-with-pkgconfig.patch
 delete mode 100644 package/nfs-utils/nfs-utils.hash

[snip]

package/nfs-utils/S60nfs touch /run/nfs/rmtab · line 18

Quoted 10 lines
package/nfs-utils/S60nfs +1 -1
index 91410ee..37e68f8 100755
@@ -15,13 +15,12 @@ touch /run/nfs/rmtab
 start() {
 	# Start daemons.
 	echo -n "Starting NFS statd: "
-	rpc.statd
+	rpc.statd -F

Perhaps explain in the commit log what this is doing.

Quoted 22 lines
package/nfs-utils/S60nfs +0 -1
 	touch /var/lock/subsys/nfslock
 	echo "done"
 
 	echo -n "Starting NFS services: "
 	/usr/sbin/exportfs -r
-	rpc.statd
 	echo "done"
 
 	echo -n "Starting NFS daemon: "
package/nfs-utils/nfs-utils.hash deleted +0 -2
deleted file mode 100644
index e36c9d0..0000000
@@ -1,2 +0,0 @@
-# Locally computed:
-sha256  70267288500408495085b7c54a667c4e8cfde5882f3193da095fc7dad2da0b83  nfs-utils-1.2.6.tar.bz2
package/nfs-utils/nfs-utils.mk +0 -0
index 115a133..09f4aef 100644

package/nfs-utils/nfs-utils.mk line 8

Quoted 8 lines
package/nfs-utils/nfs-utils.mk +2 -3
@@ -4,9 +4,8 @@
 #
 ################################################################################
 
-NFS_UTILS_VERSION = 1.2.6
-NFS_UTILS_SOURCE = nfs-utils-$(NFS_UTILS_VERSION).tar.bz2
-NFS_UTILS_SITE = http://downloads.sourceforge.net/project/nfs/nfs-utils/$(NFS_UTILS_VERSION)
+NFS_UTILS_VERSION = nfs-utils-1-3-2
+NFS_UTILS_SITE = git://git.linux-nfs.org/projects/steved/nfs-utils.git

Anything wrong with https://www.kernel.org/pub/linux/utils/nfs-utils/1.3.2/ ?

Regards,
Arnout

Quoted 4 lines
package/nfs-utils/nfs-utils.mk +0 -0
 NFS_UTILS_LICENSE = GPLv2+
 NFS_UTILS_LICENSE_FILES = COPYING
 NFS_UTILS_AUTORECONF = YES
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 1/3 nfs-utils: Add rpcbind as a runtime dependency

In reply to Maxime Hadjinlian

Dear Maxime Hadjinlian,

Quoted 6 lines · Maxime Hadjinlian

rpcbind is necessary for nfs_utils to works as a server

---
 package/nfs-utils/Config.in | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com