more debug output
[linux-2.4.git] / scripts / extract-ikconfig
1 #! /bin/bash -x
2 # extracts .config info from a [b]zImage file
3 # uses: binoffset (new), dd, zcat, strings, grep
4 # $arg1 is [b]zImage filename
5
6 HDR=`binoffset $1 0x1f 0x8b 0x08 0x0`
7 PID=$$
8 TMPFILE="$1.vmlin.$PID"
9
10 # dd if=$1 bs=1 skip=$HDR | zcat - | strings /dev/stdin \
11 # | grep "[A-Za-z_0-9]=[ynm]$" | sed "s/^/CONFIG_/" > $1.oldconfig.$PID
12 # exit
13
14 dd if=$1 bs=1 skip=$HDR | zcat - > $TMPFILE
15 strings $TMPFILE | grep "^[\#[:blank:]]*CONFIG_[A-Za-z_0-9]*" > $1.oldconfig.$PID
16 wc $1.oldconfig.$PID
17 rm $TMPFILE