Compile linux kernel deb-pkg target without generating dbg package?
The answer given by MariusMatutiae wasn't quite the one I was expecting, but I did take a look at some of the kernel build scripts and have found a workable solution. The script that generates the resulting debian packages is scripts/package/builddeb
. Looking at this script, the portions that build the package with debugging symbols are surrounded by conditionals dependent on BUILD_DEBUG
which greps the given KCONFIG
for CONFIG_DEBUG_INFO=y
.
So to stop generating debian packages with debugging symbols, currently you need to disable the kernel CONFIG_DEBUG_INFO
option:
CONFIG_DEBUG_INFO=n
kernel-handbook suggests this:
The build will use less disk space if the CONFIG_DEBUG_INFO option is disabled. Debuginfo is only needed if you plan to use binary object tools like crash, kgdb, and SystemTap on the kernel.
This can be achieved by this command:
cd linux-source-4.12
scripts/config --disable DEBUG_INFO