aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2006-06-21 20:53:09 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-24 17:16:45 -0400
commitac031f26e89cc04fc7504f31ae137857eb83a051 (patch)
tree688a89949e477a0cb12b21b44ace0df03593230d
parent468d949401d729b28eed6ea5be25695c5731d3f1 (diff)
kbuild: add option for stripping modules while installing them
Add option for stripping modules while installing them. This function adds support for stripping modules while they are being installed. CONFIG_DEBUG_KERNEL (which will probably become more popular as developers use kdump) causes the size of the installed modules to grow by a factor of 9 or so. Some kernel package systems solve this problem by stripping the debug information from /lib/modules after running "make modules_install", but that may not work for people who are installing directly into /lib/modules --- root partitions that were sized to handle 16 megs worth of modules may not be quite so happy with 145 megs of modules, so the "make modules_install" never succeeds. This patch allows such users to request modules_install to strip the modules as they are installed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--Documentation/kbuild/makefiles.txt8
-rw-r--r--Makefile17
-rw-r--r--scripts/Makefile.modinst2
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
1128The kernel Makefiles are designed to run with GNU Make. The Makefiles 1136The kernel Makefiles are designed to run with GNU Make. The Makefiles
diff --git a/Makefile b/Makefile
index 1b2fd97f503a..d810d6cb4d08 100644
--- a/Makefile
+++ b/Makefile
@@ -512,6 +512,23 @@ export INSTALL_PATH ?= /boot
512MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 512MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
513export MODLIB 513export 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
521ifdef INSTALL_MOD_STRIP
522ifeq ($(INSTALL_MOD_STRIP),1)
523mod_strip_cmd = $STRIP) --strip-debug
524else
525mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
526endif # INSTALL_MOD_STRIP=1
527else
528mod_strip_cmd = true
529endif # INSTALL_MOD_STRIP
530export mod_strip_cmd
531
515 532
516ifeq ($(KBUILD_EXTMOD),) 533ifeq ($(KBUILD_EXTMOD),)
517core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ 534core-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
19quiet_cmd_modules_install = INSTALL $@ 19quiet_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
23INSTALL_MOD_DIR ?= extra 23INSTALL_MOD_DIR ?= extra