Fix stripped module signatures if CONFIG_DEBUG_INFO

If building with CONFIG_MODULE_SIG_ALL and CONFIG_DEBUG_INFO the
objcopy call that adds the debuglink has the side-effect of removing
the signature added to the kernel module. Let's explicitly sign the
installed modules again in that case.

Closes: #852715
This commit is contained in:
Jan Blunck 2017-01-26 17:04:11 +01:00 committed by Luca Boccassi
parent 5d952f897c
commit c33c43727d
1 changed files with 5 additions and 0 deletions

5
debian/rules.real vendored
View File

@ -435,6 +435,11 @@ ifeq ($(DEBUG),True)
find $(PACKAGE_DIR) -name '*.ko' | sed 's|$(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/||' | while read module ; do \
$(CROSS_COMPILE)objcopy --add-gnu-debuglink=$(DIR)/$$module $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/$$module || exit; \
done
# stripping the modules removes signatures as well - if automated signing is enabled with
# an ephemeral key, re-do the sign step
+if grep -qs '^CONFIG_MODULE_SIG_ALL=y' $(DIR)/.config; then \
$(MAKE_CLEAN) -C $(DIR) modules_sign INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR); \
fi
endif
cp $(DIR)/.config $(PACKAGE_DIR)/boot/config-$(REAL_VERSION)
cp $(DIR)/System.map $(PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)