diff options
-rw-r--r-- | Documentation/kbuild/makefiles.txt | 8 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | scripts/Makefile.modinst | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index a9c00facdf40..14ef3868a328 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -1123,6 +1123,14 @@ The top Makefile exports the following variables: | |||
1123 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may | 1123 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may |
1124 | override this value on the command line if desired. | 1124 | override this value on the command line if desired. |
1125 | 1125 | ||
1126 | INSTALL_MOD_STRIP | ||
1127 | |||
1128 | If this variable is specified, will cause modules to be stripped | ||
1129 | after they are installed. If INSTALL_MOD_STRIP is '1', then the | ||
1130 | default option --strip-debug will be used. Otherwise, | ||
1131 | INSTALL_MOD_STRIP will used as the option(s) to the strip command. | ||
1132 | |||
1133 | |||
1126 | === 8 Makefile language | 1134 | === 8 Makefile language |
1127 | 1135 | ||
1128 | The kernel Makefiles are designed to run with GNU Make. The Makefiles | 1136 | The kernel Makefiles are designed to run with GNU Make. The Makefiles |
@@ -512,6 +512,23 @@ export INSTALL_PATH ?= /boot | |||
512 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 512 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
513 | export MODLIB | 513 | export MODLIB |
514 | 514 | ||
515 | # | ||
516 | # INSTALL_MOD_STRIP, if defined, will cause modules to be | ||
517 | # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then | ||
518 | # the default option --strip-debug will be used. Otherwise, | ||
519 | # INSTALL_MOD_STRIP will used as the options to the strip command. | ||
520 | |||
521 | ifdef INSTALL_MOD_STRIP | ||
522 | ifeq ($(INSTALL_MOD_STRIP),1) | ||
523 | mod_strip_cmd = $STRIP) --strip-debug | ||
524 | else | ||
525 | mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) | ||
526 | endif # INSTALL_MOD_STRIP=1 | ||
527 | else | ||
528 | mod_strip_cmd = true | ||
529 | endif # INSTALL_MOD_STRIP | ||
530 | export mod_strip_cmd | ||
531 | |||
515 | 532 | ||
516 | ifeq ($(KBUILD_EXTMOD),) | 533 | ifeq ($(KBUILD_EXTMOD),) |
517 | core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ | 534 | core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 2686dd5dce8c..f0ff248f5e6f 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
@@ -17,7 +17,7 @@ __modinst: $(modules) | |||
17 | @: | 17 | @: |
18 | 18 | ||
19 | quiet_cmd_modules_install = INSTALL $@ | 19 | quiet_cmd_modules_install = INSTALL $@ |
20 | cmd_modules_install = mkdir -p $(2); cp $@ $(2) | 20 | cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) |
21 | 21 | ||
22 | # Modules built outside the kernel source tree go into extra by default | 22 | # Modules built outside the kernel source tree go into extra by default |
23 | INSTALL_MOD_DIR ?= extra | 23 | INSTALL_MOD_DIR ?= extra |