Why does the feisty kernel have CONFIG_DEBUG_INFO=y set?

Asked by Henning Paul

Externally built kernel modules will be approx. 10 times as large as usual. How can I strip these modules?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Cesare Tirabassi (norsetto) said :
#1

Wouldn't be better for you to recompile with CONFIG_DEBUG_INFO=n?
If you use menuconfig you can select Load an Alternate Configuration File, and only change that option.

Revision history for this message
Henning Paul (hnch) said :
#2

This can't be a solution, since the installed module files aren't that big as they would be, they must have been stripped in Ubuntu's build system. I wonder how one could do that to an externally build kernel module.

Revision history for this message
Cesare Tirabassi (norsetto) said :
#3

Maybe they aren't as they are not compiled with debug support?

cat /boot/config-2.6.20-15-generic | grep CONFIG_DEBUG
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_RWSEMS is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_RODATA is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set

Revision history for this message
Henning Paul (hnch) said :
#4

On SuSE 10.1, setting "CONFIG_DEBUG_INFO=y" while leaving all the
other options unchanged caused the kernel modules to become approx.
10x bigger in size. This is used for creating kernel-debug packages:
%if 0%{?__debug_package:1}
cat >> ../.rpm-defs <<EOF
MAKE_ARGS="\$MAKE_ARGS CONFIG_DEBUG_INFO=y"
EOF
%endif
If I only understood dpkg's build system, I would try to understand
how an Ubuntu binary kernel package is being created in detail. Since
I don't, I ask you.

Revision history for this message
Cesare Tirabassi (norsetto) said :
#5

The only debian utility that I know that may help you is kernel-package (especially make-kpkg).
If you install it you can check the relative man page to see if it can suits you.

Otherwise you could try to ask in the MOTU mailing list, or in the #ubuntu-motu irc channel (the latter would actually be better). If you can't find help there they might redirect you to one of our kernel guys (Ben Collins for instance).

Revision history for this message
Henning Paul (hnch) said :
#6

On #ubuntu-motu, someone gave me the hint dh_strip(1).

Revision history for this message
Cesare Tirabassi (norsetto) said :
#7

Good people. From the dh_strip man page:

dh_strip is a debhelper program that is responsible for stripping exe‐
cutables, shared libraries, and static libraries that are not used for
debugging.

This program examines your package build directories and works out what
to strip on its own. It uses file(1) and file permissions and filenames
to figure out what files are shared libraries (*.so), executable bina‐
ries, and static (lib*.a) and debugging libraries (lib*_g.a,
debug/*.so), and strips each as much as is possible. (Which is not at
all for debugging libraries.) In general it seems to make very good
guesses, and will do the right thing in almost all cases.

Since it is very hard to automatically guess if a file is a module, and
hard to determine how to strip a module, dh_strip does not currently
deal with stripping binary modules such as .o files.

I guess you got it already, If not and you think it can help you:

sudo apt-get install debhelper

Can you help with this problem?

Provide an answer of your own, or ask Henning Paul for more information if necessary.

To post a message you must log in.