nfs4: rpc.idmapd does not accept parameters anymore
authorHarald Hoyer <harald@redhat.com>
Mon, 15 Feb 2010 09:43:51 +0000 (10:43 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 15 Feb 2010 09:43:51 +0000 (10:43 +0100)
modify /etc/idmapd.conf instead

modules.d/95nfs/install
modules.d/95nfs/nfsroot
modules.d/95nfs/parse-nfsroot.sh

index 004099c..43976f9 100755 (executable)
@@ -7,6 +7,8 @@ dracut_install rpc.statd mount.nfs mount.nfs4 umount
 dracut_install /etc/services 
 dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
 dracut_install rpc.idmapd /etc/idmapd.conf
+dracut_install sed
+
 if ldd $(which rpc.idmapd) |grep -q lib64; then
     LIBDIR="/lib64"
 else
@@ -28,7 +30,7 @@ nsslibs=${nsslibs##|}
 dracut_install $(for i in $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null); do echo $i;done | egrep "$nsslibs")
 
 inst_hook cmdline 90 "$moddir/parse-nfsroot.sh"
-inst_hook pre-pivot 70 "$moddir/nfsroot-cleanup.sh"
+inst_hook pre-pivot 99 "$moddir/nfsroot-cleanup.sh"
 inst "$moddir/nfsroot" "/sbin/nfsroot"
 mkdir -p "$initdir/var/lib/nfs/rpc_pipefs"
 mkdir -p "$initdir/var/lib/rpcbind"
index 39d5b0c..fb7d5f4 100755 (executable)
@@ -93,13 +93,7 @@ if [ "$nfs" = "nfs4" ]; then
     # rpc.lockd isn't needed
     [ -z "$(pidof rpc.statd)" ] && rpc.statd
 
-    # XXX really needed? Do we need non-root users before we start it in
-    # XXX the real root image?
-    if nfsdomain=$(getarg rd_NFS_DOMAIN); then
-        [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd -d $nfsdomain
-    else
-        [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
-    fi
+    [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
 
     # XXX Should we loop here?
     mount -t nfs4 -o$options${nfslock+,$nfslock} \
index bcf3465..910dd26 100755 (executable)
@@ -69,6 +69,17 @@ case "${netroot%%:*}" in
 esac
 
 # Check required arguments
+
+if nfsdomain=$(getarg rd_NFS_DOMAIN); then
+    if [ -f /etc/idmapd.conf ]; then
+       sed -i -e \
+           "s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \
+           /etc/idmapd.conf
+    fi
+    # and even again after the sed, in case it was not yet specified
+    echo "Domain = $nfsdomain" >> /etc/idmapd.conf
+fi
+
 nfsroot_to_var $netroot
 [ "$path" = "error" ] && die "Argument nfsroot must contain a valid path!"