This overlay installing overlayed kernel-2.eclass with useflag "build-kernel" to automated kernel make on emerge time. It must work with any "sys-kernel/*-sources" package, using kernel-2.eclass. To use this "kernel-2.eclass" for Gentoo mainstream kernels and latest portage (2.2_rc30+) you need /etc/portage/repos.conf (better - /etc/portage/repos.conf/*.conf) file with something like this: [gentoo] eclass-overrides = raw or [DEFAULT] eclass-overrides = raw Currently portage (now: 2.2-rc33) have eclass overlaying bug (Bug #276264). To check: Say "emerge -pv gentoo-sources" and look for "pnp" useflag. Without bug flag must be visible. Workaround: 1. Add PORTAGE_RSYNC_EXTRA_OPTS="--exclude=/metadata/md5-cache" in make.conf; 2. say "rm /usr/portage/metadata/md5-cache -Rf" Then check bug again. If flag not visible - try "emerge --regen", remove FEATURES="metadata-transfer", edit /usr/portage/metadata/layout.conf, or something else. === Configuring kernel. Automated. Configuration starting by "make defconfig", then going optional kernel config fixes and "make oldconfig" (after each fix). Last - "genkernel ramdisk" to gentoo initrd behaviour with optional fixes. === Config options. There are two variables: KERNEL_MODULES, KERNEL_CONFIG. (see defaults in "/usr/share/genpnprd/Kconfig.pl"). KERNEL_MODULES contains directory list to wildcard modules enable. If "+" prefix given - modules will be forced, else - only unset will be modules (this path is around incomplete current modules lists in genkernel, some of default built-in modules needs to still built-in). Radical solution: KERNEL_MODULES="+." KERNEL_CONFIG contains kernel configuration options, prefixed by none ("y"), "-" ("n"), "+" ("m"), "~" (remove/oldconfig-default), "=" ("y" if undefined), "&" (embed "m" to "y" recursive). Also perl regular expressions may be used. KERNEL_CLEANUP contains directories to find modules (=m) to remove after second configuration stage (USE="embed-hardware"). Example: KERNEL_CLEANUP="sound drivers/ata" or KERNEL_CLEANUP="." First reading "/etc/make.conf" values. If empty - using defaults. Then trying "/etc/kernels/kernel.conf". Default config trying to be kernel default + maximum hardware & filesystems. To use pure kernel defaults add to "/etc/make.conf": KERNEL_MODULES="vanilla" KERNEL_CONFIG="vanilla" (or other unused keyword) Present behaviour IMHO must be most simple and configurable. Current defaults checked by kernel 2.6.20 (kerrighed-sources). Known problem: when frambuffer devices and/or fbcon are modules - tty1 (and console 1) is "dumb terminal" (but ALT-F2 is OK). === Compiling. Compiling must be usual "make all" + "genkernel ramdisk", installing into /boot and /lib/modules. No /boot mounting checks right now. Just copy into mounted /boot by hand (subject to self-check too). === Addons. Useflag "integrated" make initrd image to built-in into kernel. Useflag "pnp" add pnp/pci/etc. module bootloader, based only on prepared kernel modules info (no external hardware data). Also used experimental patch for kernel to force modules info exporting (not all modules do it, found after "ioatdma"), but "modulesfix" with "f" parameter may brake builds for exotic arches. Useflags "pnp" and "compressed" will force all kernel modules to include into initrd, compressed by "cramfs" or "squashfs" (related of kernel version). Since only new kernels support compressed initrd - implemented only universal mode - compressed "/lib" directory inside uncompressed initrd and mounted runtime by script. I see no sence to do extra path to compress all initrd (little extra kilobytes). Useflag "netboot" make Gentoo's netboot image (not yet verifyed, todo: include Kerrighed modules and tools too, but tools must be static). Useflag "thin" make additional "thin" image (network drivers, cifs, nfs), having priority to be "integrated". TODO: strip drivers to PXE agents list. Loader will continue hw detection after mounting root if at least one module not found. Useflag "klibc" will make alternative (or "standard"?) initrd with "early userspace"/klibc. If KERNEL_KLIBC_SRC (or KERNEL_KLIBC_DIR) given - klibc will be build from this source (tar.bz2), if ="*" - sources will dirty hacked from currently installed dev-libs/klibc. Useflag "embed-hardware" detecting hardware (under /proc/cpuinfo & /sys/*/uevent) and embed required modules into kernel. Using same in-kernel "modalias" database and making kernel twice. Useflag "monolythe" making monolytic kernel. Usable primary with "embed-hardware" and KERNEL_CLEANUP. Need to be tested before usage: modules sometimes not fully detected on early stage. Example: USE="-genkernel monolythe embed-hardware" KERNEL_CLEANUP="." \ emerge -1B gentoo-sources Also many useflags are "external" - placed in "/usr/share/genpnprd/*use". There are usually just a configuration templates to role optimisation. Currently there are: "minimal acl bare-metal debug desktop fbcon force-modules ipv6 laptop lxc nls rt selinux server tmem unicode" etc Kernel cmdline options: "nopnp", "unload" (try to rmmod after mounting root), "loadall" (try to load all possible drivers, slow), "slow" (fixed v0.1 mode, deprecated, now vs. new bugs), "parallel-startup[={0|1|2}]" (module parallel loading mode: 0-none, 1-normal, 2-agressive), "nopowersave" (disable powersaving/cpufreq preset), "detect_root[=...]" (root autodetection, with param - like real_root, but detect fs only on given device). To resolve problems around "quiet": "quiet=false". Raids trying to autodetect+assemble, to disable assemble try "noraid" cmd. Also you can try minimal "init=/etc/syspnp". P.S. Defaults are subject to change. .