13

I'm running Ubuntu 11.10, which came with kernel version 3.0.0-14. I downloaded and built a kernel from the 3.1.0 branch. After installing the new kernel, I see that my /boot/initrd.img-3.1.0 file is HUGE. It's 114MB, while my /boot/initrd.img-3.0.0-14-generic is about 13MB. I want to get rid of the bloat, which is clearly unnecessary.

When building the new kernel, I copied my /boot/config-3.0.0-14-generic to .config in my build directory, as to keep the configuration of my original kernel. I ran make oldconfig, selected the defaults for all the new options, and then built the kernel.

Looking at the file sizes within each of the initrd cpio archives, I see that all of my .ko modules are larger in size in the 3.1.0 ramdisk, than the 3.0.0-14. I assumed there was an unnecessary debug flag checked in my config file, but I don't see anything different that was not already enabled in the 3.0.0-14 config file.

My /boot/config-3.0.0-14-generic is here: http://pastebin.com/UjH7nEqd

And my /boot/config-3.0.1 is here: http://pastebin.com/HyT0M2k1

Can anyone explain where all the unnecessary bloat is coming from?

Finer Recliner
  • 233
  • 2
  • 6

1 Answers1

17

When building the kernel and module using make oldconfig, make and make install, the resulting modules will have debug information available in the files.

Use the INSTALL_MOD_STRIP option for removing debugging symbols:

make INSTALL_MOD_STRIP=1 modules_install

Similarly, for building the deb packages:

make INSTALL_MOD_STRIP=1 deb-pkg
dlitz
  • 123
  • 4
Lekensteyn
  • 20,173
  • 18
  • 71
  • 111