aboutsummaryrefslogtreecommitdiff
path: root/scripts/extract-ikconfig
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 19:59:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 19:59:37 -0700
commitc91d7d54ea9e75ec18c733969ba16dd7ab94fc99 (patch)
tree5b93c6931adf9908f9f207eaa7a0f91d8207ad08 /scripts/extract-ikconfig
parent133309a89e7430f907ebe85e78906ee12c311727 (diff)
parent48586218b6515b9bd70694e3cd8c901a6a6ee69c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
Diffstat (limited to 'scripts/extract-ikconfig')
-rwxr-xr-xscripts/extract-ikconfig14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/extract-ikconfig b/scripts/extract-ikconfig
index 72997c353cb..de233ff43c1 100755
--- a/scripts/extract-ikconfig
+++ b/scripts/extract-ikconfig
@@ -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`
@@ -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"
@@ -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."