Re: merge two kernel .config 's into one union of the two

"John Lumby" <[email protected]> Sat, 01 Jul 2006 12:32:42 -0400
Newsgroups org.kernel.vger.linux-config
Message-ID <[email protected]>
>From: terry white <[email protected]>
>: on "6-29-2006" "John Lumby" writ:
>: but also (of course) a valid .config
>
>    i'm not sure that a trivial task.
>
>: suggest any method at all for achieving this?
>
>     i use the following to find differences in .config files.  it assumes
>those copied to "config-[0-9]*".  typically, '[0-9]*' a two digit minor
>version number.  you might want to tweak to taste.
>
>fgrep -v \# config-[0-9]* | sort -t ":" -k 2,2 \
>| uniq -s 10 -u | sort > config.diff
>
Thanks Terry - that's a useful script and using that I got a lot closer to 
completing the merge.    I was finally able to use one of the configs  in 
make xconfig, and then use the output of your diff in another window to add 
in the missing functions from the other config.

And to repay the help, here's part of a script I wrote whose purpose is, 
given the name of a config parm, to print out the name of the corresponding 
kernel source file and the help for the parm:

find . -name Kconfig -exec ksh_c 'pline="";fl=' {} ';egrep -e "^config 
'"${cparm}"'" $fl && echo " from $fl" && sed -ne "/^config 
'"${cparm}"'/,/^config/ p" $fl| while read line; do { print -- "$pline"; 
pline="$line"; };done' \;

ksh_c is an executable which simply glues all its parms together into one 
string and passes it to ksh using ksh -c "string", which is useful when run 
from inside the -exec option of find.