Properly apply NFS mount options for Gentoo bug #262915
authorAndrew Gaffney <agaffney@gentoo.org>
Sat, 26 Dec 2009 23:36:11 +0000 (17:36 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sat, 26 Dec 2009 23:36:11 +0000 (17:36 -0600)
ChangeLog
defaults/initrd.defaults
defaults/initrd.scripts

index 293f8ad559acfc770670781cd86e0d8c61f86c39..27eb652d6c46b0e708b1fb131e8d84718eda7370 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  26 Dec 2009; Andrew Gaffney <agaffney@gentoo.org>
+  defaults/initrd.defaults, defaults/initrd.scripts:
+  Properly apply NFS mount options for Gentoo bug #262915
+
   26 Dec 2009; Andrew Gaffney <agaffney@gentoo.org>
   arch/alpha/kernel-config, arch/ia64/kernel-config, arch/ppc/kernel-config,
   arch/x86_64/kernel-config:
index db5cb25b6a4da180e61a74b4076303ad7c984ace..14a403ff1176578f5b48b06fa8e5efe8a3c3fbaf 100755 (executable)
@@ -75,6 +75,8 @@ CONSOLE='/dev/console'
 
 LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
 
+DEFAULT_NFSOPTIONS="ro,nolock,rsize=1024,wsize=1024"
+
 # Only sections that are in by default or those that
 # are not module groups need to be defined here...
 HWOPTS='keymap cache modules pata sata scsi usb firewire waitscan slowusb evms lvm dmraid mdadm fs net'
index 5f611aa903b1723555103de57d7d37e4011f9ba6..df4a7dd8a9f0fca1659f161ea94fcc7c6009809e 100755 (executable)
@@ -236,10 +236,19 @@ findnfsmount() {
 
                if [ "${NFSROOT}" != '' ]
                then
+                       NFSOPTIONS=${NFSROOT#*,}
+                       NFSROOT=${NFSROOT%%,*}
+                       if [ "${NFSOPTIONS}" = "${NFSROOT}" ]
+                       then
+                               NFSOPTIONS=$DEFAULT_NFSOPTIONS
+                       else
+                               NFSOPTIONS="${DEFAULT_NFSOPTIONS},${NFSOPTIONS}"
+                       fi
+
                        if [ "${CDROOT}" != '0' ]
                        then
-                               good_msg "Attempting to mount NFS CD image on ${NFSROOT}"
-                               mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}/mnt/cdrom
+                               good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}"
+                               mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom
                                if [ "$?" = '0' ]
                                then
                                        REAL_ROOT="/dev/nfs"
@@ -247,8 +256,8 @@ findnfsmount() {
                                        bad_msg "NFS Mounting failed. Is the path corrent ?"
                                fi
                        else    
-                               good_msg "Attempting to mount NFS root on ${NFSROOT}"
-                               mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}
+                               good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}"
+                               mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}
                                if [ "$?" = '0' ]
                                then
                                        REAL_ROOT="/dev/nfs"