|
Harald Hoyer |
08211a |
From 83a420674b7c1328ffb944678619595a431ffa48 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
08211a |
From: Dave Young <dyoung@redhat.com>
|
|
Harald Hoyer |
08211a |
Date: Wed, 11 Jul 2012 13:08:18 +0800
|
|
Harald Hoyer |
08211a |
Subject: [PATCH] nfs: install modprobe config file
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
install nfs modprobe config file
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
For nfs4, in case nfs.ko is not loaded mount.nfs4 will try to load
|
|
Harald Hoyer |
08211a |
nfs4.ko instead of nfs.ko. Fedora nfs-utils creates a lib/modprobe.d/nfs.conf
|
|
Harald Hoyer |
08211a |
in which there's below alias:
|
|
Harald Hoyer |
08211a |
alias nfs4 nfs
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
Dracut also need this file to auto load nfs kernel module.
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
Tested booting to a fedora 17 nfsroot share.
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
Signed-off-by: Dave Young <dyoung@redhat.com>
|
|
Harald Hoyer |
08211a |
---
|
|
Harald Hoyer |
08211a |
modules.d/95nfs/module-setup.sh | 6 ++++++
|
|
Harald Hoyer |
08211a |
modules.d/95nfs/parse-nfsroot.sh | 7 -------
|
|
Harald Hoyer |
08211a |
2 files changed, 6 insertions(+), 7 deletions(-)
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
|
|
Harald Hoyer |
08211a |
index b170de5..0c07725 100755
|
|
Harald Hoyer |
08211a |
--- a/modules.d/95nfs/module-setup.sh
|
|
Harald Hoyer |
08211a |
+++ b/modules.d/95nfs/module-setup.sh
|
|
Harald Hoyer |
08211a |
@@ -35,6 +35,12 @@ install() {
|
|
Harald Hoyer |
08211a |
mount.nfs4 umount rpc.idmapd sed /etc/netconfig
|
|
Harald Hoyer |
08211a |
dracut_install /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
+ if [ -f /lib/modprobe.d/nfs.conf ]; then
|
|
Harald Hoyer |
08211a |
+ dracut_install /lib/modprobe.d/nfs.conf
|
|
Harald Hoyer |
08211a |
+ else
|
|
Harald Hoyer |
08211a |
+ echo "alias nfs4 nfs" > $initdir/etc/modprobe.d/nfs.conf
|
|
Harald Hoyer |
08211a |
+ fi
|
|
Harald Hoyer |
08211a |
+
|
|
Harald Hoyer |
08211a |
inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
|
Harald Hoyer |
08211a |
diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh
|
|
Harald Hoyer |
08211a |
index 4e69edc..769d233 100755
|
|
Harald Hoyer |
08211a |
--- a/modules.d/95nfs/parse-nfsroot.sh
|
|
Harald Hoyer |
08211a |
+++ b/modules.d/95nfs/parse-nfsroot.sh
|
|
Harald Hoyer |
08211a |
@@ -88,13 +88,6 @@ nfsroot_to_var $netroot
|
|
Harald Hoyer |
08211a |
# Set fstype, might help somewhere
|
|
Harald Hoyer |
08211a |
fstype=${nfs#/dev/}
|
|
Harald Hoyer |
08211a |
|
|
Harald Hoyer |
08211a |
-# NFS actually supported? Some more uglyness here: nfs3 or nfs4 might not
|
|
Harald Hoyer |
08211a |
-# be in the module...
|
|
Harald Hoyer |
08211a |
-if ! incol2 /proc/filesystems $fstype ; then
|
|
Harald Hoyer |
08211a |
- modprobe nfs
|
|
Harald Hoyer |
08211a |
- incol2 /proc/filesystems $fstype || die "nfsroot type $fstype requested but kernel/initrd does not support nfs"
|
|
Harald Hoyer |
08211a |
-fi
|
|
Harald Hoyer |
08211a |
-
|
|
Harald Hoyer |
08211a |
# Rewrite root so we don't have to parse this uglyness later on again
|
|
Harald Hoyer |
08211a |
netroot="$fstype:$server:$path:$options"
|
|
Harald Hoyer |
08211a |
|