]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
nfs: install modprobe config file
authorDave Young <dyoung@redhat.com>
Wed, 11 Jul 2012 05:08:18 +0000 (13:08 +0800)
committerHarald Hoyer <harald@redhat.com>
Wed, 11 Jul 2012 06:45:34 +0000 (08:45 +0200)
install nfs modprobe config file

For nfs4, in case nfs.ko is not loaded mount.nfs4 will try to load
nfs4.ko instead of nfs.ko. Fedora nfs-utils creates a lib/modprobe.d/nfs.conf
in which there's below alias:
alias nfs4 nfs

Dracut also need this file to auto load nfs kernel module.

Tested booting to a fedora 17 nfsroot share.

Signed-off-by: Dave Young <dyoung@redhat.com>
modules.d/95nfs/module-setup.sh
modules.d/95nfs/parse-nfsroot.sh

index b170de5fcca390c5ea6aa75c58ffea0bda4d1263..0c0772567fa2b13083d92de2bb322e215ce0dae0 100755 (executable)
@@ -35,6 +35,12 @@ install() {
         mount.nfs4 umount rpc.idmapd sed /etc/netconfig
     dracut_install /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
 
+    if [ -f /lib/modprobe.d/nfs.conf ]; then
+        dracut_install /lib/modprobe.d/nfs.conf
+    else
+        echo "alias nfs4 nfs" > $initdir/etc/modprobe.d/nfs.conf
+    fi
+
     inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
 
     _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
index 4e69edc005b36f8448e045eec0e523594fb821fa..769d233e22abf6ef4aefd6eecdc5fc2cef06718b 100755 (executable)
@@ -88,13 +88,6 @@ nfsroot_to_var $netroot
 # Set fstype, might help somewhere
 fstype=${nfs#/dev/}
 
-# NFS actually supported? Some more uglyness here: nfs3 or nfs4 might not
-# be in the module...
-if ! incol2 /proc/filesystems $fstype ; then
-    modprobe nfs
-    incol2 /proc/filesystems $fstype || die "nfsroot type $fstype requested but kernel/initrd does not support nfs"
-fi
-
 # Rewrite root so we don't have to parse this uglyness later on again
 netroot="$fstype:$server:$path:$options"