Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232733 - [NeedPatch] sys-kernel/genkernel: implement rootwait parameter
Summary: [NeedPatch] sys-kernel/genkernel: implement rootwait parameter
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2008-07-23 09:43 UTC by skolima
Modified: 2016-05-16 06:42 UTC (History)
2 users (show)

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


Attachments
This adds a loop of up to 3 seconds to wait for the device (linuxrc_wait.patch,931 bytes, patch)
2016-05-14 03:34 UTC, John Klug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description skolima 2008-07-23 09:43:40 UTC
I have gentoo installed on a USB hard drive. Because I carry the drive around, I wanted to use UUID to identify the root partition instead of the usual /dev/sdx. This is not supported by the kernel, but genkernel-generated initrd (with --label parameter) does support this. However, this initrd on the other hand ignores the "rootwait" kernel parameter, which should make it wait until a suitable volume shows up - it tries to mount the root as soon as it can, when it still is not available.

Reproducible: Always
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2008-07-23 15:03:14 UTC
Why should the initramfs's linuxrc do anything with that parameter? That's a kernel thing, which is only effective when it's doing the mounting itself.
Comment 2 skolima 2008-07-23 15:13:05 UTC
initrd in debian/ubuntu does handle this. So does geninitrd in PLD.
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2008-07-23 15:18:57 UTC
I'll change this to an enhancement request. However, there is the 'doslowusb' parameter, which will probably do what you want.
Comment 4 skolima 2008-07-23 16:07:40 UTC
Unfortunately doslowusb does not work for me. Also, please note that the kernel has two similar parameters:

rootdelay=n (wait for n seconds then try to mount root)
rootwait (wait until root is available for mount, as long as it takes)

While the delay is certainly usable, the automatic rootwait is much nicer. Whatever is chosen for implementation, genkernel probably should keep the semantics of existing kernel parameters.
Comment 5 justXi 2009-03-31 15:12:20 UTC
I have the same problem, I think.

The kernel and initrd starts, then a message comes up, that the device (e.g. /dev/sda5) could not be found. Then I type in "/dev/sda5" and the system starts as expected. 

I tried "doslowusb" but it did not work.

I use genkernel-3.4.10-r2.
Comment 6 Sebastian Heyn 2009-06-15 06:37:58 UTC
I think you guys should check the manual, the parameter is called "scandelay=" on genkernels initrd!
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-07-03 18:45:03 UTC
1. rootwait is an existing kernel parameter, overriding that could be bad.
2. Genkernel already has:
2.1 At the bootloader prompt: scandelay=N
2.2 At the bootloader prompt: doslowusb
2.3 During build time, genkernel --slowusb

"slowusb" causes a number of extra 10 second delays (non-configurable) to be
added.
"scandelay=N" (default value 10) sets the $SDELAY value, which is used:
- Always once between loading modules and starting the device manager.
- If slowusb is set or forced, an extra pair of times on either side of the
device manager.

I do see a case where the existing delays don't provide sufficient flexibility
or time for the root device to turn up: Specifically fibre-channel cards. After
the module is loaded, it takes 15-120 seconds for the LIP discovery to finish.

The rootwait kernel parameter isn't useful here, because the kernel itself only
waits for the initrd root to come up. So I'd like to propose that we DO detect
the rootwait in the initrd as well, and wait that long until the specified root
device becomes available. While the kernel version does not support a timeout,
we should, as well as having a sane default if not timeout is specified (maybe
60 seconds).
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-07-04 05:28:18 UTC
I missed one more kernel parameter: rootdelay=N, that provides an initial delay in the probing.
Comment 9 Steve Dibb (RETIRED) gentoo-dev 2010-06-11 14:39:13 UTC
> The rootwait kernel parameter isn't useful here, because the kernel itself only
> waits for the initrd root to come up. So I'd like to propose that we DO detect
> the rootwait in the initrd as well, and wait that long until the specified root
> device becomes available. While the kernel version does not support a timeout,
> we should, as well as having a sane default if not timeout is specified (maybe
> 60 seconds).
> 

Just for the record ..

rootdelay=[secs] - Delay (in seconds) to pause before attempting to mount the root filesystem

rootwait - Wait (indefinitely) for root device to show up. Useful for devices that are detected asynchronously (e.g. USB and MMC devices).

From kernel-parameters.txt.

So, rootwait doesn't take a parameter.

And I'd really like to see support for it. :)

Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-11 17:36:10 UTC
I like the idea, but how about a patch then?
(against the git repo)
Comment 11 John Klug 2016-05-14 03:34:27 UTC
Created attachment 434238 [details, diff]
This adds a loop of up to 3 seconds to wait for the device

I see a wait for CD in linuxrc code, but no wait for disk root.

One of the comments is right.  If this were a big system with lots of disks, the delay could be long finding the disk.  I think there should be a loop, with a time limit set by genkernel.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-05-16 06:42:14 UTC
[master ba69a90] defaults/linuxrc: bug #232733: implement rootwait.
 1 file changed, 8 insertions(+)


John Klug: not a 1-1 copy of your patch, I tweaked it and made it count down to zero from an initial counter, w/ sane defaults and ability to specify the counter start per rootwait/rootdelay.