From 03fa25da8335a942161a8070b3298cfd4edf9b6a Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 29 Apr 2009 22:52:22 -0400 Subject: kconfig: make localmodconfig to run streamline_config.pl Running the streamline_config.pl script manually can still be confusing for some users. This patch adds the localmodconfig option. This will automatically run streamline_config.pl on the current .config and then run "make silentoldconfig" to fix any wholes that might have been created. $ make localmodconfig This will remove any module configurations in .config that are not needed to compile the modules that are loaded. Signed-off-by: Steven Rostedt --- scripts/kconfig/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig/Makefile') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5ddf8becd7a..e4d8394ff75 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -2,7 +2,8 @@ # Kernel configuration targets # These targets are used from top-level makefile -PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config +PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ + localmodconfig ifdef KBUILD_KCONFIG Kconfig := $(KBUILD_KCONFIG) @@ -28,6 +29,15 @@ oldconfig: $(obj)/conf silentoldconfig: $(obj)/conf $< -s $(Kconfig) +localmodconfig: $(obj)/streamline_config.pl $(obj)/conf + $(Q)perl $< $(Kconfig) > .tmp.config + $(Q)cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + mv -f .config.old.1 .config.old) + $(Q)rm -f .tmp.config + # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files # The symlink is used to repair a deficiency in arch/um @@ -83,6 +93,7 @@ help: @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' oldconfig - Update current config utilising a provided .config as base' + @echo ' localmodconfig - Update current config disabling modules not loaded' @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' -- cgit v1.2.3 From 281c9dadc31ffd9f3cf637553134fefe75e849da Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 29 Apr 2009 22:52:23 -0400 Subject: kconfig: add make localyesconfig option This adds the option localyesconfig to make. This is similar to localmodconfig, but after it removes unnecessary modules it runs sed -i s/=m/=y/ on the .config file. It then runs "make silentoldconfig" to fix any wholes that were created by the conversion of modules to core. Signed-off-by: Steven Rostedt --- scripts/kconfig/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts/kconfig/Makefile') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index e4d8394ff75..12a4d9e2cad 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -3,7 +3,7 @@ # These targets are used from top-level makefile PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ - localmodconfig + localmodconfig localyesconfig ifdef KBUILD_KCONFIG Kconfig := $(KBUILD_KCONFIG) @@ -38,6 +38,16 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf mv -f .config.old.1 .config.old) $(Q)rm -f .tmp.config +localyesconfig: $(obj)/streamline_config.pl + $(Q)perl $< $(Kconfig) > .tmp.config + $(Q)sed -i s/=m/=y/ .tmp.config + $(Q)cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + mv -f .config.old.1 .config.old) + $(Q)rm -f .tmp.config + # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files # The symlink is used to repair a deficiency in arch/um @@ -94,6 +104,7 @@ help: @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' oldconfig - Update current config utilising a provided .config as base' @echo ' localmodconfig - Update current config disabling modules not loaded' + @echo ' localyesconfig - Update current config converting local mods to core' @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' -- cgit v1.2.3 From a7c02602a85a0d3f34331ff34d54de7416085985 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 7 May 2009 11:09:55 -0400 Subject: kconfig: test if a .config already exists If one were to run localmodconfig or localyesconfig without having a .config already in the file, then the end of the process would give a warning when it tries to move the old .config to .config.old. This patch adds a test to check if .config exists and avoid the moves if it does not. [ Impact: remove warning after make localmodconfig ] Signed-off-by: Steven Rostedt --- scripts/kconfig/Makefile | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'scripts/kconfig/Makefile') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 12a4d9e2cad..915a39a0329 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -31,21 +31,31 @@ silentoldconfig: $(obj)/conf localmodconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)perl $< $(Kconfig) > .tmp.config - $(Q)cmp -s .tmp.config .config || \ - (mv -f .config .config.old.1; \ - mv -f .tmp.config .config; \ - $(obj)/conf -s $(Kconfig); \ - mv -f .config.old.1 .config.old) + $(Q)if [ -f .config ]; then \ + cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + mv -f .config.old.1 .config.old) \ + else \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + fi $(Q)rm -f .tmp.config localyesconfig: $(obj)/streamline_config.pl $(Q)perl $< $(Kconfig) > .tmp.config $(Q)sed -i s/=m/=y/ .tmp.config - $(Q)cmp -s .tmp.config .config || \ - (mv -f .config .config.old.1; \ - mv -f .tmp.config .config; \ - $(obj)/conf -s $(Kconfig); \ - mv -f .config.old.1 .config.old) + $(Q)if [ -f .config ]; then \ + cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + mv -f .config.old.1 .config.old) \ + else \ + mv -f .tmp.config .config; \ + $(obj)/conf -s $(Kconfig); \ + fi $(Q)rm -f .tmp.config # Create new linux.pot file -- cgit v1.2.3 From 48586218b6515b9bd70694e3cd8c901a6a6ee69c Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 21 Aug 2009 12:42:20 -0400 Subject: kconfig: add missing dependency of conf to localyesconfig There's a dependency missing. $ make localyesconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/basic/hash using config: '/boot/config-2.6.27.25-78.2.56.fc9.x86_64' /bin/sh: line 8: scripts/kconfig/conf: No such file or directory make[1]: *** [localyesconfig] Error 127 make: *** [localyesconfig] Error 2 Thus the script failed to run. But the sed command that converts the '=m' to '=y' still ran. This gives us a distro config with all modules converted to built in! The missing dependency was for conf for localyesconfig. This dependency was already set for localmodconfig. Reported-by: Ingo Molnar Signed-off-by: Steven Rostedt --- scripts/kconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/kconfig/Makefile') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 915a39a0329..6d69c7ccdcc 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -43,7 +43,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf fi $(Q)rm -f .tmp.config -localyesconfig: $(obj)/streamline_config.pl +localyesconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)perl $< $(Kconfig) > .tmp.config $(Q)sed -i s/=m/=y/ .tmp.config $(Q)if [ -f .config ]; then \ -- cgit v1.2.3