Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262915 - [patch] sys-kernel/genkernel-3.4.10-r2 initrd.scripts do not parse nfs mount options in nfsroot parameter
Summary: [patch] sys-kernel/genkernel-3.4.10-r2 initrd.scripts do not parse nfs mount ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2009-03-18 14:45 UTC by thomas
Modified: 2019-07-16 19:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for /usr/share/genkernel/generic/initrd.scripts (initrd.scripts.patch,1.20 KB, patch)
2009-03-18 14:47 UTC, thomas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description thomas 2009-03-18 14:45:33 UTC
The initrd.scripts from genkernel package do not parse nfs options that are appended with "," after nfs server and path for bootparameter "nfsroot".

If nfsroot is given, the scripts assume only server:path. 

But normally, one can append nfs mount options like this:
nfsroot=server:path,options

Example:
nfsroot=192.168.0.7:/pxe/frontend,ro,nolock,rsize=8192,wsize=8192,nfsvers=3,tcp,intr


Reproducible: Always

Steps to Reproduce:
1. setup PXE NFS boot
2. add NFS mount options after server and path in parameter nfsroot
3.

Actual Results:  
The scripts will try to mount "server:path,options" which will not work, because only "server:path" has to be mounted. The options should be used as nfs mount options.

Expected Results:  
The scripts should recognize and use the given nfs mount options in nfsroot parameter.
Comment 1 thomas 2009-03-18 14:47:53 UTC
Created attachment 185440 [details, diff]
Patch for /usr/share/genkernel/generic/initrd.scripts

This patch is for "normal" nfs roots. cd boot has not be touched. It will use the nfs mount options in nfsroot, if given. Otherwise, it will use the old default mount options.
Comment 2 Alexandre Nuno Milheiro 2009-08-22 23:54:38 UTC
(In reply to comment #1)
> This patch is for "normal" nfs roots. cd boot has not be touched. It will use
> the nfs mount options in nfsroot, if given. Otherwise, it will use the old
> default mount options.

Your patch worked just fine here. May be a better one would allow the mount options to supersede only related default option.

For example, I would like to just append ",rw" to mount my nfsroot readwrite instead o ro. The problem is in that case the other default options (nolock,rsize=1024,wsize=1024) are lost.

I'll try to make a patch for this some time
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2009-08-23 16:06:45 UTC
We could just have the custom mount options appended to the end of the default ones. For example, with 'nfsroot=host:export,rw', you'd get 'ro,nolock,rsize=1024,wsize=1024,rw'.

However, I'm not sure if later options override earlier ones like this.
Comment 4 Andrew Gaffney (RETIRED) gentoo-dev 2009-12-26 23:37:05 UTC
I did this slightly differently than in your patch. I moved the parsing code further up, so it works for mounting the CD via NFS. I also had it append to the default NFSOPTIONS.
Comment 5 Guido Jäkel 2010-11-30 14:38:28 UTC
I want to vote to *process* this bug and use the patch!

A "normal" kernel feature further missing is the expansion of a '%s' in the path to the hostname (if known, IP otherwise).

Comment 6 Sebastian Pipping gentoo-dev 2010-12-25 00:46:57 UTC
Removing keyword InSVN (as there seems to be dispute about it) so this bug doens't get closed by mistake.
Comment 7 Sebastian Pipping gentoo-dev 2011-01-05 22:45:30 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bugs nature in searches...
Comment 8 Thomas Deutschmann gentoo-dev Security 2019-07-16 19:00:30 UTC
Was fixed long time ago via https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=62f353b65be33b49380900d3cddf150e403cc455