GLEP: 33 Title: Installing kernel module source additionally to/instead of building it Version: $Revision: $ Last-Modified: $Date: $ Author: Stefan Schweizer , John Mylchreest Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 16 Nov 2004 Abstract ======== This GLEP aims at providing users with a new external kernel module build system by optionally installing sources, or modules, or both. Motivation ========== Gentoo's current module ebuild system is slow and does not track the packages to recompile. Currently we have ebuilds in portage that provide both userspace and kernel part, for example fuse and submount. That makes compiling user tools when users upgrade kernels additional bloat. Rationale ========= One way to solve the problem is to install the module sources, so that we can track what source modules are installed, and fast recompile them after the kernel has been recompiled. Implementation ============== We will install fully patched kernel module sources in /usr/src/linux-modules/${PN}. Patching includes: avoid calling depmod avoid touching files out of /usr/src or /lib/modules using a standard variable for KERNELDIR and support of make and make install. When the build is run, it will honour 2 use flags (this is mostly eclass driven). USE="binary source" We will install only the source if -binary -source. The basic process will be: pkg_setup check kernel supports modules check other config options we might need src_compile if installing source copy module src to image/usr/src/linux-modules/PN/ populate metadatafiles (BUILD_ARAMS) if installing module build module in workdir src_install if installing module doins ${MODULES} When the ebuild installs the module source it will also echo build parameters to a BUILD_PARAM file in the module source directory. This is used to allow us to control additional make options after its initial install. There is also need to create an external tool to recompile some, or all of the modules. For example, those specified in /etc/kmod.conf. The tool basically does: KERNELDIR="$(pwd)" for i in /usr/src/linux-modules/* do cd ${i} make clean make $(< BUILD_PARAMS) make install done depmod Backwards Compatibility ======================= This is an additional feature and existing behaviour will not change. Reference Implementation ======================== Roadmap: - create the user space tool - create some example ebuilds - change the kernel module eclass to support this, and if required, change ebuild src_* pkg_* functions to properly use eclass functionality. References ========== No links here .. [#nothin] http://nothin Copyright ========= This document has been placed in the public domain.