From: Andrew Gaffney Date: Sat, 26 Dec 2009 23:36:11 +0000 (-0600) Subject: Properly apply NFS mount options for Gentoo bug #262915 X-Git-Tag: v3.4.10.908~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=62f353b65be33b49380900d3cddf150e403cc455;p=genkernel.git Properly apply NFS mount options for Gentoo bug #262915 --- diff --git a/ChangeLog b/ChangeLog index 293f8ad..27eb652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 26 Dec 2009; Andrew Gaffney + defaults/initrd.defaults, defaults/initrd.scripts: + Properly apply NFS mount options for Gentoo bug #262915 + 26 Dec 2009; Andrew Gaffney arch/alpha/kernel-config, arch/ia64/kernel-config, arch/ppc/kernel-config, arch/x86_64/kernel-config: diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index db5cb25..14a403f 100755 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -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' diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 5f611aa..df4a7dd 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -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"