From c0cded1a92b0c47751038a4aee4737bab7ea8c8d Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 30 Jan 2008 12:54:44 -0500 Subject: [PATCH] Improved linux26/linux-conf.in's auto_config() to make 2 loops over .3,.4,.5 --- base/linux26/linux-conf.in | 56 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/base/linux26/linux-conf.in b/base/linux26/linux-conf.in index e1de3c17c..e1f7c7e90 100644 --- a/base/linux26/linux-conf.in +++ b/base/linux26/linux-conf.in @@ -57,6 +57,7 @@ var_append makeopt ' ' "ARCH=$lx_cpu CROSS_COMPILE=$archprefix KCC=$KCC" makeinstopt="$makeopt" auto_config() { + local x= loop= # get defconfig (.config.1) # if [ -f $base/architecture/$arch/kernel$treever.conf.sh ] ; then @@ -90,33 +91,38 @@ auto_config() { echo "Enabling all modules ..." yes '' | eval $MAKE $makeopt no2modconfig > /dev/null ; cp .config{,.2} - # call scripts to tweak the config file + # for "safety" we will apply the config twice, so hidden options have time + # to appear # - for x in $lx_confscripts ; do - echo " running: $x" - sh $x .config + for loop in 1 2; do + # call scripts to tweak the config file + # + for x in $lx_confscripts ; do + echo " running: $x" + sh $x .config + done + cp .config{,.3.$loop} + + # merge various text/plain config files + # + for x in $lx_confmerge; do + if [ -f $x ] ; then + echo " merging: '$x'" + tag="$(sed '/CONFIG_/ ! d; s,.*CONFIG_\([^ =]*\).*,\1,' \ + $x | tr '\n' '|')" + egrep -v "\bCONFIG_($tag)\b" < .config > .config.4.$loop + sed 's,\(CONFIG_.*\)=n,# \1 is not set,' \ + $x >> .config.4.$loop + cp .config{.4.$loop,} + else + echo_warning "Can't find '${x#$base/}' for merging." + fi + done + + # create a valid .config + # + yes '' | eval $MAKE $makeopt oldconfig > /dev/null ; cp .config{,.5.$loop} done - cp .config{,.3} - - # merge various text/plain config files - # - for x in $lx_confmerge; do - if [ -f $x ] ; then - echo " merging: '$x'" - tag="$(sed '/CONFIG_/ ! d; s,.*CONFIG_\([^ =]*\).*,\1,' \ - $x | tr '\n' '|')" - egrep -v "\bCONFIG_($tag)\b" < .config > .config.4 - sed 's,\(CONFIG_.*\)=n,# \1 is not set,' \ - $x >> .config.4 - cp .config{.4,} - else - echo_warning "Can't find '${x#$base/}' for merging." - fi - done - - # create a valid .config - # - yes '' | eval $MAKE $makeopt oldconfig > /dev/null ; cp .config{,.5} # last disable broken stuff #