make-kpkg with ubuntu sources creates gigantic package

Bug #90283 reported by Matt Price on 2007-03-07
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
kernel-package (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: kernel-package

when building kernels from linux-source-2.6.20, the resultant packages are enormous -- around 215M. have tried e.g. to simply use the default config for the generic kernel, but no luck reducing the size.

unsure whether the issue has to do with my specific environment but the issue has been present for long enough that i'm filing the bug here.

steps to reproduce: invoke

make-kpkg --append-to-version=whatever kernel-image

consequence: very unwieldy kernel packages.

Mark Reitblatt (mark-reitblatt) wrote :

Strange, I can't actually get it to work at all for me under Feisty ATM (2.6.20-9). To whomever picks up this bug: Should I report my failure in another bug report?

Changed in kernel-package:
importance: Undecided → Medium
status: Unconfirmed → Needs Info
goto (gotolaunchpad) wrote :

also having the same problem:

installed feisty from desktop cd, normal options. did not do any apt-get upgrades. apt-got openssh-server, vim-full and samba, plus sysv-rc-conf, then:

1. apt-get install ncurses-dev kernel-package linux-source build-essential gawk linux-kernel-devel
2. cd /usr/src
3. tar jzxvf linux-source-2.6.20.tar.bz2
4. ln -sf linux-source-2.6.20 linux
5. cd linux
6. uname -r ==> 2.6.20-15-generic
7. cp /boot/config-`uname -r` ./.config
8. make-kpkg --initrd --append-to-version=-custom01 kernel_image kernel_headers
9. du -sh ../linux-image*.deb
226M ../linux-image-2.6.20.3-ubuntu1-custom01_2.6.20.3-ubuntu1-custom01-10.00.Custom_i386.deb

On Fri, 2007-04-05 at 19:33 +0000, bugmenot wrote:
> also having the same problem:
>
> installed feisty from desktop cd, normal options. did not do any apt-
> get upgrades. apt-got openssh-server, vim-full and samba, plus sysv-rc-
> conf, then:
>
> 1. apt-get install ncurses-dev kernel-package linux-source build-essential gawk linux-kernel-devel
> 2. cd /usr/src
> 3. tar jzxvf linux-source-2.6.20.tar.bz2
> 4. ln -sf linux-source-2.6.20 linux
> 5. cd linux
> 6. uname -r ==> 2.6.20-15-generic
> 7. cp /boot/config-`uname -r` ./.config
> 8. make-kpkg --initrd --append-to-version=-custom01 kernel_image kernel_headers
> 9. du -sh ../linux-image*.deb
> 226M ../linux-image-2.6.20.3-ubuntu1-custom01_2.6.20.3-ubuntu1-custom01-10.00.Custom_i386.deb
>
there's a workaround for this:

cd /usr/src/linux-source-2.6.20
grep -i debug .config

then change all the CONFIG_XXX_DEBUG=Y entries to
# CONFIG_XXX_DEBUG is not set

and recompile. of course if for some reason you need some debug output
you have to be more careful. nonetheless this remains a bug, anyone on
kernel-team want to fix it? or are you guys so adamantly opposed to
users compiling kernels that you are leaving it this way on purpose?
(it's an honest question, even if it sounds a little hostile).

matt

--
Matt Price
History Dept
University of Toronto
<email address hidden>

asis (supporto-asis) wrote :

Same problem here.
Matt hint works like a charm.

Changed in kernel-package:
status: Needs Info → Confirmed
Charles Perreault (muganor) wrote :

Umm this is not, IMHO, a bug. From the Kernel/Compile page from Ubuntu (https://help.ubuntu.com/community/Kernel/Compile):

[quote]
If you re-used the existing configuration, note that Ubuntu kernels build with debugging information on, which makes the resulting kernel modules (*.ko files) much larger than they would otherwise be. To turn this off, go into "Kernel hacking"; then, under "Kernel debugging", turn OFF "Compile the kernel with debug info".
[/quote]

The linux-image packages in the Ubuntu repositories seem to be compiled with the "Compile the kernel with debug info" option OFF (the package size is ~18Mb), but it installs a config-`uname -r` in /boot that have that option ON. Therefore, if you reuse the old/existing configuration, debugging will be enabled (gcc -g...) and make-kpkg will produce a huge kernel. I've compiled a custom hardy kernel 2.6.24-rc5 today, using the config from linux-image-2.6.24-2-server, and I had to disable the debugging option to get a decent 20Mb package, else with debug ON it was about 215Mb.

From here there are two choices :
1- Leave the default/existing config-`uname -r` in /boot as is, and let people disable debugging like it's done now. After all, that feature is documented and people should read howtos. Maybe it's not enough documented though...
2- Change the default debug option in the config file, which would help people compile custom kernels. I don't know why debug is ON by default, but the kernel-team probably has a good reason.

Nonetheless, I personally think the debug option should be set OFF by default, as people with problems will know what to enable to debug their kernel using gdb or another tool. There are less many kernel debuggers than people that just want a working custom kernel.

If you guys choose option 2, then change the importance to "wishlist". Else, please close it.

Erlenmayr (erlenmayr) wrote :

The same problem occurs, when I compile the vanilla kernel sources (2.6.24) with kpkg-make on Ubuntu (Gutsy) on the 64 bit version (Core 2 Duo processor).

Charles Perreault (muganor) wrote :

Or course, the problem is neither with kpkg-make, nor with the kernel source you use. It's your kernel config file that has the "Compile the kernel with debug info" option enabled.

Disable that option from the config file (edit it or do make menuconfig), clean your source folder, recompile and you'll get a normal size package. There ain't no bug there. Read my previous post and check the link on help.ubuntu.com. Somewhere in the middle of the page it tells you why you get huge packages when compiling with the stock Ubuntu kernel config file.

Theodore Ts'o (tytso) wrote :

Enclosed please find a patch which when applied to the files in /usr/share/kernel-package, will make the linux-image file manageable even if CONFIG_DEBUG_INFO is set to yes. What this does is add INSTALL_MOD_STRIP=1 to the "make modules_install" command, which will strip out the debugging information from the modules installed in /lib/modules/<kver>.

What I do if I want to use systemtap (which requires the debugging symbols) is I run the command from the build tree: "make INSTALL_MOD_PATH=/usr/lib/debug modules_install". This is a big help because on my systems /lib is on the root partition, and doesn't have the space for multiple kernels with 600 megs worth of modules. However, I *do* have the space in the /usr partition. On my todo list is to hack make-kpkg to create a linux-debuginfo dpkg, much like Red Hat does. If someone does that ahead of me, please let me know; to be honest it's relatively low on my priority list. Hopefully this patch is helpful, though!

Affect me too, here is the diff (in .config I disable CONFIG_DEBUG_INFO)
diff /boot/config-2.6.35-22-generic .config
3,4c3,4
< # Linux kernel version: 2.6.35-22-generic
< # Sat Oct 16 20:45:25 2010
---
> # Linux kernel version: 2.6.35.4
> # Sat Nov 6 13:18:01 2010
5152c5152
< CONFIG_DEBUG_INFO=y
---
> # CONFIG_DEBUG_INFO is not set

Bryan Quigley (bryanquigley) wrote :

I just built a kernel with debug on and it was 43 MB. Is anyone still having this issue?

Changed in kernel-package (Ubuntu):
status: Confirmed → Incomplete
Changed in kernel-package (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers