* [Buildroot] [PATCH 1/1] Fix nfs server for a read only rootfs
@ 2014-09-30 1:08 Steve Calfee
0 siblings, 0 replies; only message in thread
From: Steve Calfee @ 2014-09-30 1:08 UTC (permalink / raw)
To: buildroot
I like to run from ro root filesystem. This patch puts the nfs temp stuff in a
subdirectory of tmp. The standard buildroot /var is read only, so the build
must agree with the runtime startup to use a /tmp/nfs writeable dir.
Also create the desired subsys subdirectory in /var/lock for nfs.
Signed-off-by: Steve Calfee <stevecalfee@gmail.com>
---
package/nfs-utils/S60nfs | 3 +++
package/nfs-utils/nfs-utils.mk | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/package/nfs-utils/S60nfs b/package/nfs-utils/S60nfs
index 49dab70..0497396 100755
--- a/package/nfs-utils/S60nfs
+++ b/package/nfs-utils/S60nfs
@@ -14,6 +14,8 @@
{ echo "/etc/exports does not exist" ; exit 0 ; }
# The /var/lib/nfs directory is actually on a tmpfs filesystem.
+# to reduce clutter put it in a subdir of /tmp
+mkdir -p /tmp/nfs
mkdir -p /var/lib/nfs/sm
mkdir -p /var/lib/nfs/sm.bak
touch /var/lib/nfs/etab
@@ -25,6 +27,7 @@ start() {
# Start daemons.
echo -n "Starting NFS statd: "
rpc.statd
+ mkdir -p /var/lock/subsys
touch /var/lock/subsys/nfslock
echo "done"
diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk
index 68772ef..3b54051 100644
--- a/package/nfs-utils/nfs-utils.mk
+++ b/package/nfs-utils/nfs-utils.mk
@@ -37,6 +37,10 @@ endif
define NFS_UTILS_INSTALL_FIXUP
$(INSTALL) -m 0755 package/nfs-utils/S60nfs \
$(TARGET_DIR)/etc/init.d/S60nfs
+ rm -rf $(TARGET_DIR)/var/lib/nfs
+ mkdir -p $(TARGET_DIR)/tmp/nfs
+ $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/lib
+ ln -s ../../tmp/nfs $(TARGET_DIR)/var/lib/nfs
rm -f $(NFS_UTILS_TARGETS_)
endef
--
1.8.3.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-30 1:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 1:08 [Buildroot] [PATCH 1/1] Fix nfs server for a read only rootfs Steve Calfee
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.