Re: [PATCHv2] Check generated config files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 18, 2016 at 6:05 PM, Laura Abbott <labbott@xxxxxxxxxx> wrote:

> On 08/17/2016 12:38 PM, Miguel Flores Silverio wrote:
>
>> Double check configuration files in order to avoid discrepancies
>> like this: https://bugzilla.redhat.com/show_bug.cgi?id=1347454
>>
>>
> Even after the typo corrections this still isn't completely working for me.
>
ugh! I copied and pasted in the wrong spot.

> Signed-off-by: Miguel Flores Silverio <floresmigu3l@xxxxxxxxx>
>>  * PATCHv1
>>    - Check config files at compilation time
>>
>>  * PATCHv2
>>    - Check config files before and after oldconfig is aplied
>>    - Save log of mismatches in logs directory in tree
>>
>> ---
>>  kernel.spec | 16 +++++++++++++++-
>>  1 file changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel.spec b/kernel.spec
>> index d6856d2..d12b74b 100644
>> --- a/kernel.spec
>> +++ b/kernel.spec
>> @@ -1161,7 +1161,6 @@ if [ ! -d .git ]; then
>>      git commit -a -q -m "baseline"
>>  fi
>>
>> -
>>  # released_kernel with possible stable updates
>>  %if 0%{?stable_base}
>>  # This is special because the kernel spec is hell and nothing is
>> consistent
>> @@ -1181,6 +1180,19 @@ make -f %{SOURCE19} config-release
>>  %endif
>>  %endif
>>
>> +# Used to check for discrepancies in configuration files
>> +CheckConfigs() {
>> +    if [ ! -d ../../logs ];then
>> +       mkdir ../../logs
>> +    fi
>>
>
> I don't really like relying on a relative log directory like this. The
> eventual
> goal is something like the oldconfig checking below which should spit out
> the
> options that are different. It's going to need some clean up of the configs
> which I've started working on. Maybe make this an option like the newconfig
> check below?
>

Understood :)


> +    GEN_CONFIG=$1
>> +    FINAL_CONFIG=$2
>> +    Arch=$3
>> +    awk 'NR==FNR{gen_cofigs[$1]++;next;}
>>
>
> You're using $1 here but $0 below, it's a little hard to understand.
>

>
> +    !($0 in gen_configs)' $FINAL_CONFIG $GEN_CONFIG >
>> ../../logs/config-check-$Arch.log
>>
>
> This is going to check all lines including those without CONFIG in the name


I did test this but I'll admit it was not exhaustive. There were only a few
mismatches I was checking for.

>
>
> +    rm $GEN_CONFIG
>> +}
>> +
>>
>
> It looks strange to delete this here, it's better to delete this outside
> the function.


I had this outside the function and decide to change it last minute. I'll
make the changes :)

>
>  # Dynamically generate kernel .config files from config-* files
>>  make -f %{SOURCE20} VERSION=%{version} configs
>>
>> @@ -1227,6 +1239,7 @@ rm -f kernel-%{version}-*debug.config
>>  # now run oldconfig over all the config files
>>  for i in *.config
>>  do
>> +  cat $i > temp-$i
>>    mv $i .config
>>    Arch=`head -1 .config | cut -b 3-`
>>    make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
>> @@ -1240,6 +1253,7 @@ do
>>    make ARCH=$Arch oldnoconfig
>>    echo "# $Arch" > configs/$i
>>    cat .config >> configs/$i
>> +  CheckConfigs temp-$i configs/$i $Arch
>>  done
>>  # end of kernel config
>>  %endif
>> --
>> 2.7.4
>>
>>
>


-- 
Regards,
Miguel
_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux