The "How to Build External Modules" section of the kernel.org kbuild documentation ( https://www.kernel.org/doc/Documentation/kbuild/modules.txt ) says:
To build external modules, you must have a prebuilt kernel available that contains the configuration and header files used in the build. Also, the kernel must have been built with modules enabled. If you are using a distribution kernel, there will be a package for the kernel you are running provided by your distribution.
An alternative is to use the "make" target "modules_prepare."
My question is, alternative to what? Alternative to
"have a prebuilt kernel available that contains the configuration and header files"
or
"the kernel must have been built with modules enabled"
or something else?
make modules_prepare
? – Lavya Jun 10 '15 at 16:55make modules_prepare
route. But if you do that, make sure it is has the same version number (they are all archived if you descend into https://www.kernel.org/pub/linux/kernel/). – goldilocks Jun 10 '15 at 17:11make module_prepare
in that and then build modules with it. Is that correct? Thanks once again for your help! – Lavya Jun 10 '15 at 17:31-devel
package. Pretty sure you do have to do themake modules_prepare
thing with it too, unless they've done so already -- in which case doing it again won't do any harm. The tree will be in/usr/src/kernels/[version]
and will have an appropriate.config
in it. – goldilocks Jun 10 '15 at 17:44.config
, and use that. – goldilocks Jun 10 '15 at 17:51/proc/config.gz
that should work -- you'll end up with the exact same kernel sans Fedora patches. Those are not hugely significant, though. Fedora is my distro of choice and I've been rolling my own kernels from the vanilla source there for years and never had a problem. Pay attention to steps 4, 5, and 6 here: http://unix.stackexchange.com/a/115621/25985 – goldilocks Jun 11 '15 at 12:08