Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 273221 - [patch] sys-kernel/genkernel generates initramfs that fails to load usb modules
Summary: [patch] sys-kernel/genkernel generates initramfs that fails to load usb modules
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-06-08 17:12 UTC by Paul Hewlett
Modified: 2017-07-14 19:58 UTC (History)
1 user (show)

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


Attachments
Patch for /usr/share/genkernel/generic/modprobe (modprobe.diff,537 bytes, patch)
2009-06-08 17:15 UTC, Paul Hewlett
Details | Diff
Add capability to customise initramfs (genkernel.diff,488 bytes, patch)
2009-06-09 08:19 UTC, Paul Hewlett
Details | Diff
Add capability to customise initramfs - 3.4.10.904 (genkernel.diff,509 bytes, patch)
2009-06-09 08:37 UTC, Paul Hewlett
Details | Diff
Add SD category for scsi emulation (initrd.defaults.diff,614 bytes, patch)
2009-06-09 09:53 UTC, Paul Hewlett
Details | Diff
Add ext4,squashfs,aufs filesystems. Add SD class of modules (modules_load.diff,2.25 KB, patch)
2009-06-09 09:55 UTC, Paul Hewlett
Details | Diff
Script to generate tailored my_modules_load file that customises initramfs (my_modules,8.42 KB, text/plain)
2009-06-09 10:00 UTC, Paul Hewlett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hewlett 2009-06-08 17:12:43 UTC
The ehci-hcd and other usb modules are not preloaded from initramfs generated by the genkernel command.
This fault is caused by a missing character in the modprobe script.
Comment 1 Paul Hewlett 2009-06-08 17:15:17 UTC
Created attachment 193915 [details, diff]
Patch for /usr/share/genkernel/generic/modprobe

Adds 2 changes - 1. modifies error message on module load failure to display the name of a dependent module and 2. fixes incorrect grep command which is confused by the presence of both usbcore.ko and wusbcore.ko in the modules.dep file
Comment 2 Paul Hewlett 2009-06-08 17:16:14 UTC
diracwifi generic # emerge --info
Portage 2.1.6.11 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.29-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7500_@_2.20GHz-with-glibc2.2.5
Timestamp of tree: Sat, 30 May 2009 19:45:02 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.7
dev-lang/python:     2.5.4-r2
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -mno-tls-direct-seg-refs"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=nocona -mno-tls-direct-seg-refs"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.heanet.ie/pub/gentoo/ http://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/"
LC_ALL="en_ZA.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US af_ZA en_ZA st_ZA xh_ZA zu_ZA en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/pro-audio"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X X509 aac ace acl acm acpi activefilter administrator afs akode alac alias alsa amarok amavis amd64 amr amrnb amrr amrwb analogtv apache2 api berkdb blender-game bluetooth bzip2 cairo caps cdaudio cdda cddb cdio cdparanoia cdr cgi cjk clamav clamd cli consolekit cpudetection cracklib crypt cups curl cvs cvsgraph dbm dbus dovecot-sasl dri dts dv dvb dvd dvdr dvdread emovix emulation encode expat extraengine ffmpeg firefox firefox3 flac flask fortran gcj gdbm gif gmail gpg gpm gsm gutenprint hal haskell httpd hunspell hvm icecast iconv idl ilbc imap ipod ipv6 ipw4965 iscsi isdnlog java java6 javascript jbig jpeg kde kdm kerberos kexi kig-scripting kqemu ktts kvm laptop lcms libwww lm_sensors loop-aes lvm lxc lzma lzo maildir memcache midi mmx mng mp3 mp4 mp4live mpd mpeg mtp mudflap multilib mysql mysqli ncurses netboot network network-cron nforce2 nfs nls nptl nptlonly nsplugin nvidia ocaml ocamlduce ocamlopt opengl openmp openvpn openvz oss pae pam pcre pdf perl pg-intdatetime php plotutils pmu png portaudio posix postfix postgis postgres ppds pppd procmail pygrub python pyx qt3 qt3support qt4 quotas rar raw rdesktop readline realmedia reflection reiserfs resolvconf rpm rss samba sasl scintilla screen sdl session slp smp sms spamassassin speex spl sql sqlite sse sse2 ssl startup-notification stream subversion svg swat sysfs tcpd theora threads threadsafe tiff tk truetype uml unicode unison unzip usb utempter utils uuencode v4l2 valgrind video vim-pager vim-syntax vim-with-x vistafree visualization vnc voice vorbis vorbis-psy webdav webdav-neon webdav-serf webkit webpresence wifi winbind wininst winpopup wma wmf wmp wordperfect xattr xcomposite xft xine xinerama xml xorg xosd xpm xprint xrandr xrender xscreensaver xsm xulrunner xv xvid xvmc zip zlib zodb" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US af_ZA en_ZA st_ZA xh_ZA zu_ZA en_GB" USERLAND="GNU" VIDEO_CARDS="fbdev intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 3 Paul Hewlett 2009-06-08 17:17:22 UTC
Kernel 2.6.29-r5
genkernel 3.4.10-r2
Comment 4 Paul Hewlett 2009-06-09 08:19:27 UTC
Created attachment 193974 [details, diff]
Add capability to customise initramfs

This patch modifies the genkernel script to read an additional file 'my_modules_load' that can override the setting in the file 'modules_load'.
This can be used to tailor the initramfs file to a specific computer.
Comment 5 Paul Hewlett 2009-06-09 08:37:36 UTC
Created attachment 193975 [details, diff]
Add capability to customise initramfs - 3.4.10.904

Modifies genkernel script to read an additional file 'my_modules_load' after 'modules_load' in order to customise initramfs
Comment 6 Paul Hewlett 2009-06-09 09:53:18 UTC
Created attachment 193979 [details, diff]
Add SD category for scsi emulation

Adds SD class of module that contains the SCSI emulation code needed for PATA/SATA/USB/FIREWIRE disks
Comment 7 Paul Hewlett 2009-06-09 09:55:22 UTC
Created attachment 193980 [details, diff]
Add ext4,squashfs,aufs filesystems. Add SD class of modules

This patch works in tandem with the initrd.defaults patch
Comment 8 Paul Hewlett 2009-06-09 10:00:23 UTC
Created attachment 193982 [details]
Script to generate tailored my_modules_load file that customises initramfs

This script will generate a 'my_modules_load' file that can be used by the patched genkernel to create an initramfs that is tailored for the current PC.
It uses the pcimodules command from pciutils.
Comment 9 Andrew Gaffney (RETIRED) gentoo-dev 2009-06-17 00:15:37 UTC
I've applied the patch for modprobe, which is what this bug was originally about. However, I'm not sure what the extra -n bit is about. What's this for?

You'll need to file separate bug(s) for the other stuff.
Comment 10 Paul Hewlett 2009-06-17 08:13:38 UTC
(In reply to comment #9)
> I've applied the patch for modprobe, which is what this bug was originally
> about. However, I'm not sure what the extra -n bit is about. What's this for?
> 
> You'll need to file separate bug(s) for the other stuff.
> 
The current implementation of genkernel makes an initramfs that loads all modules in most classes (PATA,SATA,SCSI...) and some arbitrary modules in other classes (NET="tg3 e1000"). This made booting the kernel quite slow and consumed unnecessary memory. I had a product that installed on a wide variety of motherboards and it was inefficient to compile the kernel for each motherboard separately. So the idea is to compile one generic kernel with everything as a module and then modify the initramfs to only load the necessary modules.

Loading the necessary modules is defined by an additional file 'my_modules_load' which overrides the file 'modules_load' if it exists (genkernel.diff)

The PATA,SATA classes also require the sd_* modules so these modules are separated into their own class SD. Additionally I added some extra filesystems to the FS class (initrd.defaults.diff, modules_load.diff).

Lastly I wrote a script (my_modules) which can automatically generate the 'my_modules_load' file - subsequently rebuilding the initramfs with the 'genkernel initrd' command results in faster booting and a smaller initramfs without any need to do a lengthy kernel recompile. 

I have been using this scheme successfully for over a year now. The my_modules script is a bit clumsy and could do with some work. It would probably be better as an additional option to genkernel. 

I will submit these as separate 'bugs' if you want - however the present genkernel works well enough so these fixes are not bugfixes but more of an improvement. 
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-06-17 20:13:05 UTC
Looks like a duplicate of the code I submitted in bug 186652 for loading a customized set of modules.
Comment 12 Sebastian Pipping gentoo-dev 2011-01-05 23:01:24 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bug's
nature in searches...
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-07-14 19:44:36 UTC
filesystems merged, modprobe was already merged.

[master 43621dc] modules_load: more filesystems.
 15 files changed, 15 insertions(+), 15 deletions(-)
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-07-14 19:58:16 UTC
Released in 3.5.1.1