[Buildroot] [PATCH] linux: Allow kernel strip modules itself
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Fri Sep 16 14:03:14 UTC 2016
Hello,
Thanks for proposing a patch for this!
On Fri, 16 Sep 2016 13:50:24 +0300, Alexey Brodkin wrote:
> Makefile | 3 ---
> linux/linux.mk | 6 +++++-
> package/Makefile.in | 2 --
> 3 files changed, 5 insertions(+), 6 deletions(-)
We also need to change package/pkg-kernel-module.mk, which is used by
packages containing external kernel modules.
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 6e41a92..82c6d38 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -384,12 +384,16 @@ define LINUX_INSTALL_IMAGES_CMDS
> $(call LINUX_INSTALL_DTB,$(BINARIES_DIR))
> endef
>
> +ifeq ($(BR2_STRIP_strip),y)
> +LINUX_MOD_STRIP_FLAGS := INSTALL_MOD_STRIP=1
Replace := by =.
Also, since INSTALL_MOD_PATH is part of LINUX_MAKE_FLAGS, I would
suggest to do the same for INSTALL_MOD_STRIP, i.e:
ifeq ($(BR2_STRIP_strip),y)
LINUX_MAKE_FLAGS += INSTALL_MOD_STRIP=1
endif
This also automagically solves the pkg-kernel-module.mk case, which
uses $(LINUX_MAKE_FLAGS).
> diff --git a/package/Makefile.in b/package/Makefile.in
> index afd5d3a..1eb5ef7 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -207,12 +207,10 @@ STRIP_STRIP_UNNEEDED := --strip-unneeded
> STRIP_STRIP_ALL := --strip-all
> TARGET_STRIP = $(TARGET_CROSS)strip
> STRIPCMD = $(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
> -KSTRIPCMD = $(STRIPCMD) $(STRIP_STRIP_UNNEEDED)
Following this removal, the STRIP_STRIP_UNNEEDED variable is no longer
used, so its definition a few lines above can be removed.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
More information about the buildroot
mailing list