Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/rostedt/linux-2.6-kconfig

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfig:
  kconfig: add missing dependency of conf to localyesconfig
  kconfig: test if a .config already exists
  kconfig: make local .config default for streamline_config
  kconfig: test for /boot/config-uname after /proc/config.gz in localconfig
  kconfig: unset IKCONFIG_PROC and clean up nesting
  kconfig: search for a config to base the local(mod|yes)config on
  kconfig: keep config.gz around even if CONFIG_IKCONFIG_PROC is not set
  kconfig: have extract-ikconfig read ELF files
  kconfig: add check if end exists in extract-ikconfig
  kconfig: enable CONFIG_IKCONFIG from streamline_config.pl
  kconfig: do not warn about modules built in
  kconfig: streamline_config.pl do not stop with no depends
  kconfig: add make localyesconfig option
  kconfig: make localmodconfig to run streamline_config.pl
  kconfig: add streamline_config.pl to scripts
  • Loading branch information
Linus Torvalds committed Sep 15, 2009
2 parents 133309a + 4858621 commit c91d7d5
Show file tree
Hide file tree
Showing 4 changed files with 414 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ $(obj)/config_data.gz: .config FORCE
$(call if_changed,gzip)

quiet_cmd_ikconfiggz = IKCFG $@
cmd_ikconfiggz = (echo "static const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
targets += config_data.h
$(obj)/config_data.h: $(obj)/config_data.gz FORCE
$(call if_changed,ikconfiggz)
Expand Down
14 changes: 14 additions & 0 deletions scripts/extract-ikconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ dump_config() {
return
fi
end=`$binoffset $file $IKCFG_ED 2>/dev/null`
[ "$?" != "0" ] && end="-1"
if [ "$end" -eq "-1" ]; then
return
fi

start=`expr $start + 8`
size=`expr $end - $start`
Expand Down Expand Up @@ -55,6 +59,8 @@ dump_config "$image"
GZHDR1="0x1f 0x8b 0x08 0x00"
GZHDR2="0x1f 0x8b 0x08 0x08"

ELFHDR="0x7f 0x45 0x4c 0x46"

# vmlinux.gz: Check for a compressed images
off=`$binoffset "$image" $GZHDR1 2>/dev/null`
[ "$?" != "0" ] && off="-1"
Expand All @@ -69,6 +75,14 @@ elif [ "$off" -ne "-1" ]; then
(dd ibs="$off" skip=1 count=0 && dd bs=512k) <"$image" 2>/dev/null | \
zcat >"$TMPFILE"
dump_config "$TMPFILE"

# check if this is simply an ELF file
else
off=`$binoffset "$image" $ELFHDR 2>/dev/null`
[ "$?" != "0" ] && off="-1"
if [ "$off" -eq "0" ]; then
dump_config "$image"
fi
fi

echo "ERROR: Unable to extract kernel configuration information."
Expand Down
34 changes: 33 additions & 1 deletion scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 localyesconfig

ifdef KBUILD_KCONFIG
Kconfig := $(KBUILD_KCONFIG)
Expand All @@ -28,6 +29,35 @@ oldconfig: $(obj)/conf
silentoldconfig: $(obj)/conf
$< -s $(Kconfig)

localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)perl $< $(Kconfig) > .tmp.config
$(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 $(obj)/conf
$(Q)perl $< $(Kconfig) > .tmp.config
$(Q)sed -i s/=m/=y/ .tmp.config
$(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
# 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
Expand Down Expand Up @@ -83,6 +113,8 @@ 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 ' 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'
Expand Down
Loading

0 comments on commit c91d7d5

Please sign in to comment.