questions about building and installing a kernel

Hi,

Following the steps given in How To Compile A Kernel - The SuSE Way | HowtoForge - Linux Howtos and Tutorials I’ve rebuilt a kernel from source and I’m wondering why the kernel image and initrd images are so large. I’d appreciate it if anybody had some pointers.

I installed openSUSE 11.4 from an .iso

uname -a
Linux linux-wdux 2.6.37.1-1.2-default #1 SMP 2011-02-21 10:34:10 +0100 i686 i686 i386 GNU/Linux

In Yast, software Manager, selecting Patterns, I installed everything in Linux Kernel Development and then built the kernel source which was downloaded …

cd /usr/src/linux
sudo make cloneconfig
sudo make rpm

This seemed to successfully create /usr/src/packages/RPMS/i386/kernel-2.6.37.61.2default-1.i386.rpm and when I extract the rpm it creates

/boot/vmlinux-2.6.37.6-1.2-default.bz2

But I notice it’s 52M. The vmlinux for my running kernel is only 3.9 M

Why is the vmlinux I built, using my running system’s .config, so large? I checked my .config and there are lots of things set to be built as modules. The .config is virtually the same as that of my running kernel.

Then when I try to run mkinitrd ( with sudo) it’s creates an initrd that’s 21M but the initrd for my running system is only 8.7M

diff config-2.6.37.1-1.2-default config-2.6.37.6-1.2-default
3c3,4
< # Linux/i386 2.6.37 Kernel Configuration

> # Linux Kernel Configuration
> # Fri Jun 17 11:03:22 2011
4891d4891
< CONFIG_SAMSUNG_LAPTOP=m
5003a5004
> CONFIG_SAMSUNG_LAPTOP=m

–John

aah, I think I’ve found (part of) the answer …

it’s a vmlinux-2.6.37.6-1.2-default.bz2 which is 52 MB

I see there is also a vmlinuz-2.6.37.6-1.2-default which is 3.8 MB.

I wonder what extra things the bz2 contains ?

When I extract the bz2 I see a vmlinux-2.6.37.6-1.2-default which is 134 MB ? Which is even more puzzling.

My question still remains about why my new initrd is much larger than that provided by my distro ? Maybe different bild params and a different build process is used when building the distro ?

On 2011-06-17 15:36, jooliver wrote:

> when I extract the rpm it creates
>
> /boot/vmlinux-2.6.37.6-1.2-default.bz2

Don’t leave the name as “default”. Change it in the config, or it will
overwrite the “default”.

> But I notice it’s 52M. The vmlinux for my running kernel is only 3.9 M

Debug info.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

thanks v much Carlos. That’s cleared it up!

On 2011-06-17 18:06, jooliver wrote:
>
> thanks v much Carlos. That’s cleared it up!

Welcome :slight_smile:

But I don’t know how to reduce the debug info of the kernel, though.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)