Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 323317 - [patch] genkernel pauses for USB even when it does not need to
Summary: [patch] genkernel pauses for USB even when it does not need to
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
Keywords: InVCS
Depends on:
Blocks: 351772
  Show dependency tree
Reported: 2010-06-09 10:17 UTC by Xake
Modified: 2011-01-16 17:01 UTC (History)
1 user (show)

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

Proposed patch for genkernel (genkernel-usb-sleep.patch,1.12 KB, patch)
2010-06-09 10:23 UTC, Xake
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xake 2010-06-09 10:17:19 UTC
If I want to be ables to use USB-storage and either does not tell genkernel to load kernel module usb-storage or have it compiled into your kernel genkernels ramdisk will make at least 2 delays at 1 s each (3 including the one commented as for USB, but that never checks if you really need it).
This is because check_slowusb checks to see if usb-storage is loaded, and if it is it sets FORCE_slowusb=1, which in turn inside of start_dev_mgr are looked for two times and if present sdelay is run.

So my question is if this is really necessary? In git this got commited when support for devfs was removed without further comment and kernelcmd doslowusb should be enought for those needing usb during boot, it is not like we force users who do not need lvm/mdraid to wait some extra seconds just because their modules are inside the ramdisk/compiled into kernel.
Comment 1 Xake 2010-06-09 10:23:10 UTC
Created attachment 234685 [details, diff]
Proposed patch for genkernel

This patch removes the use of check_slowusb and FORCE_slowusb. Instead every sdelay (i.e. scandelay) has a check for doslowusb.

Also I am unsure if the sdelay in linuxrc was needed to begin with as start_dev_mgr starts with a sdelay for DO_slowusb, and an additional one for FORCE_slowusb, should that not be enough?
Comment 2 Sebastian Pipping gentoo-dev 2011-01-05 23:06:54 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bug's nature in searches...
Comment 3 Sebastian Pipping gentoo-dev 2011-01-05 23:28:20 UTC
Jake, in parallel Fabio has prepared an alternative patch to the same problem.
Would his patch solve your problem?;a=commitdiff;h=e151596a03089e9863cbe99ff06e411d32f5a3bb
Comment 4 Fabio Erculiani (RETIRED) gentoo-dev 2011-01-05 23:40:35 UTC
Please note that:
+       if [ ! -d "${usb_storage_dir}" ]
+       then
+               return
+       fi

should be removed or the logic of check_slowusb changed in order to always set FORCE_slowusb even when DO_slowusb is set. In this way, further queries to the slowusb mechanism can safely just reference FORCE_slowusb.
Comment 5 Xake 2011-01-06 09:19:51 UTC
(In reply to comment #3)
> Would his patch solve your problem?

As long as the patch does not take the fact that you got USB-storage subsystem loaded as a hint of making lots of pauses, then I am happy. By replacing sleep with echoes I found out that my system did not need any pauses to boot, but still did lots of them and many of them was from the slowusb logic.

Good to see things happening to genkernel again!:-)
Comment 6 Sebastian Pipping gentoo-dev 2011-01-07 03:51:16 UTC
Xake, feel feel to try sys-kernel/genkernel-99999 (five nines) which includes a few bits extracted from Fabio's earlier patch.;a=commitdiff;h=5f136adc14e52f729a6d06ef7cb660d33d5038c9
Comment 7 Xake 2011-01-07 12:23:03 UTC
>>> Compiling source in /var/tmp/portage/sys-kernel/genkernel-99999/work/genkernel ...
make -j16 -l15 
a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=`/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"`" \
	 --format=manpage -D . "doc/genkernel.8.txt"
/bin/sh: a2x: command not found
make: *** [genkernel.8] Error 127
emake failed

a missing dep and where do I find a2x?
Comment 8 Sebastian Pipping gentoo-dev 2011-01-07 16:30:30 UTC
(In reply to comment #7)> /bin/sh: a2x: command not found
> make: *** [genkernel.8] Error 127
> emake failed
> a missing dep and where do I find a2x?

Yes, sorry, that's asciidoc.

+  07 Jan 2011; Sebastian Pipping <>
+  genkernel-, genkernel-9999.ebuild, genkernel-99999.ebuild:
+  Add build dep on asciidoc for live ebuilds
Comment 9 Xake 2011-01-07 18:12:04 UTC
Ok, while taking a quick look at the pause, this thing I had but not the experimental branch.;a=blob;f=defaults/linuxrc;h=adaab62cb725657ccf04063350ce5dd0147f2ed1;hb=refs/heads/experimental#l289

Why sdelay for at least once second for everyone when even the comment says it is only for USB? Maybe make it conditional for DO_slowusb or something alike?

Just some lines longer down the road we got one like this, but this time a "sleep 1" whch the comment states is a rare problem only for iSCSI users... So why does that sleep  not live in the following function:;a=blob;f=defaults/initrd.scripts;h=f9e792701bd92ceaa2514fbb25fa5e5871b55106;hb=refs/heads/experimental#l674

Right after iscsistart and before the fi?
Comment 10 Sebastian Pipping gentoo-dev 2011-01-16 00:58:28 UTC
Fabio has done a few more related commits.  Please check genkernel-99999 (fives nines) again.  I assume this is fixed for now.  Please re-open as needed.
Comment 12 Sebastian Pipping gentoo-dev 2011-01-16 14:17:09 UTC
Looks odd, agreed.

This is meant to fix it:;a=commitdiff;h=1051223a6320bf8e6a0496ffa29ad499a9777915

As always, please re-open as needed.
Comment 13 Xake 2011-01-16 17:01:01 UTC
That should do it I guess.;)