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
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"
# 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} \
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!"