]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
nfsroot-cleanup: make /var/lib/nfs/rpc_pipefs path configurable
authorMarc Grimme <grimme@atix.de>
Thu, 23 Jul 2009 10:19:54 +0000 (12:19 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 23 Jul 2009 10:19:54 +0000 (12:19 +0200)
/tmp/nfs.rpc_pipefs_path can contain the path where
/var/lib/nfs/rpc_pipefs will be moved before switch_root.

This is useful if /var is a separate partition in the real root.

modules.d/95nfs/nfsroot-cleanup.sh

index e3b3d17359b4c9169e42a23e9e992a4baa33aed7..b801d8c4bd96165096912e24246e59a1092ef681 100644 (file)
@@ -1,3 +1,7 @@
+rpcpipefspath=`cat /tmp/nfs.rpc_pipefs_path`
+
+[ -z "$rpcpipefspath" ] && rpcpipefspath=var/lib/nfs/rpc_pipefs
+
 pid=$(pidof rpc.statd)
 [ -n "$pid" ] && kill $pid
 
@@ -9,10 +13,10 @@ pid=$(pidof rpcbind)
 
 if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; then 
     # try to create the destination directory
-    [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ] || mkdir -p $NEWROOT/var/lib/nfs/rpc_pipefs 2>/dev/null
+    [ -d $NEWROOT/$rpcpipefspath ] || mkdir -p $NEWROOT/$rpcpipefspath 2>/dev/null
 
-    if [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ]; then
-       mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/var/lib/nfs/rpc_pipefs
+    if [ -d $NEWROOT/$rpcpipefspath ]; then
+       mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/$rpcpipefspath
     else
        umount /var/lib/nfs/rpc_pipefs
     fi