build: Allow kernel modules to set build ID debug symbol
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 30 Oct 2015 15:20:12 +0000 (15:20 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 30 Oct 2015 15:20:12 +0000 (15:20 +0000)
commit5b3e690aff7fb121a94127805de749b90e63f319
tree7b4055c9a89391984fdcf0b731d9ae53763499d1
parent2247ad78e98d8d328d7950cbf5e29ae96f7b0a5e
build: Allow kernel modules to set build ID debug symbol

This change adds support for specifying a build ID for kernel modules.
This is done by setting PKG_BUILD_ID to a hexadecimal string, which will
then be passed to the kernel linker. In addition, when this flag is set,
the build ID debug symbol (.note.gnu.build-id) will not be stripped from
the kernel module. This symbol is exported in sysfs by the kernel (if
the kernel is compiled with CONFIG_KALLSYMS) and so can be used to
uniquely identify a version of a kernel module in a running kernel. This
is useful for keeping track of different versions of a module when doing
experiments and development.

Modules that specify the build ID will be ~100 bytes larger (depending
on the length of the build ID specified). There is no size difference
for kernel modules that do not set this variable.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47290 3c298f89-4303-0410-b956-a3cf2f4a3e73
include/kernel-defaults.mk
rules.mk
scripts/strip-kmod.sh