Thursday, June 4, 2009

Fix for depmod gives "Cannot allocate memory" error

I encountered an error I've never seen before while building a kernel. While doing a "make modules_install" I got this error:

DEPMOD 2.6.29.4-0.1-pae
FATAL: Can't read module /lib/modules/2.6.29.4-0.1-pae/kernel/drivers/net/wireless/b43/b43.ko: Cannot allocate memory


At first, I thought it was a symptom of building a kernel on a low memory machine, but I upped the swap space and tried again, only to get stuck in the exact same spot. It turns out the error is easily fixed by turning off the debug option in the /usr/src/linux/.config file. You can do this either with a text editor or "make xconfig" (or "make menuconfig", etc).

You want to replace the line:

CONFIG_DEBUG_KERNEL=yes


with:

#CONFIG_DEBUG_KERNEL is not set


It is near the end of .config.

In the configuration programs, the option to turn off is "Kernel hacking | Kernel debugging".

No comments:

Post a Comment