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:

FATAL: Can't read module /lib/modules/ 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:




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