Search code examples
ubuntulinux-kernelresize-image

How can i reduce the size of linux kernel?


Hi friends i have installed linux kernel 3.16.3 version and kernel image found in "/boot/vmlinuz-3.16.3" size 5.9 mb it is possible to reduce the size of my current kerenl to 2 mb or less??

I have read this article : http://swift.siphos.be/linux_sea/kernelbuilding.html

But is there any straight forward way to do this?? Please help me out in this

Thank you!


Solution

  • Here are the steps

    • Do "make menuconfig" and disable all unused features
    • Inline functions increase the code size by copying the same code in multiple places.
      • Remove "inline" flag to as many functions as possible.
    • Go to linker file and see any extra unused memory is allocated and remove them (vmlinux.lds.S in Arm codebase)