nfsroot-cleanup: make /var/lib/nfs/rpc_pipefs path configurable

/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.
master
Marc Grimme 2009-07-23 12:19:54 +02:00 committed by Harald Hoyer
parent f016dccc89
commit 2fe2945869
1 changed files with 7 additions and 3 deletions

View 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