Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My default kernel rpm has 12mb size, for some reasons I compile a custom kernel and make rpm from that(make rpm command). However, my custom kernel rpm size is 96mb.

I look inside default rpm, in that modules is zipped by bz format, but in my rpm isn't.

How can I compress modules in rpm compress? Is any option or command to do that?

share|improve this question
Compression happens by default IIRC (in fact I didn't know you could turn it off). Post your .spec file. – Gilles Aug 18 '11 at 19:42

Did you leave kernel debugging enabled? If you did that can yield a much larger RPM than when it is disabled.

I accepted the default options from menuconfig and ran make rpm on the kernel. The RPM it generated was 221M. After deselecting debugging, it is 21M. It was reduced by a factor of 10 which is close to the reduction you're expecting.

In 'menuconfig' you can disable kernel debugging by unchecking Kernel Hacking->Kernel debugging, or you can edit the config file directly and comment out CONFIG_DEBUG_KERNEL .

The RPM based distros have guides on building a kernel that might be helpful to you. Usually the recommendation is to not do it, but if you really need to do it, they have docs on how to do it using their method instead of the 'make rpm' method directly from the kernel tarball.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.