]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
better handling of mount moving rpc_pipefs
authorHarald Hoyer <harald@redhat.com>
Wed, 27 May 2009 12:21:52 +0000 (14:21 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 27 May 2009 12:21:52 +0000 (14:21 +0200)
modules.d/40nfsroot/nfsroot-cleanup.sh

index 4e0d7ad43b52521e88d8fd331a107c888a8b6e3a..b8f3a2f2ddc94c3934fdc8562283cfe06c8b8a24 100644 (file)
@@ -6,11 +6,14 @@ pid=$(pidof rpc.statd)
 pid=$(pidof rpcbind)
 [ -n "$pid" ] && kill $pid
 
-mkdir -p 
+if grep -q rpc_pipefs /proc/mounts; 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
 
-if [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ]; then
-    mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/var/lib/nfs/rpc_pipefs
-else
-    umount /var/lib/nfs/rpc_pipefs
+    if [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ]; then
+       mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/var/lib/nfs/rpc_pipefs
+    else
+       umount /var/lib/nfs/rpc_pipefs
+    fi
 fi