summaryrefslogtreecommitdiffstats
path: root/kernel.spec
diff options
context:
space:
mode:
authorLaura Abbott <labbott@fedoraproject.org>2016-12-02 14:18:11 -0800
committerLaura Abbott <labbott@fedoraproject.org>2016-12-22 14:11:05 -0800
commita20ad4f4fd68300449af16c2e3627703951bb83c (patch)
tree15394e927c4c19ec48a6a2d50affbe9a4349aa05 /kernel.spec
parentb77b08c9c4895b5e9fbe6bc991c7d4d23368ee6b (diff)
downloadkernel-a20ad4f4fd68300449af16c2e3627703951bb83c.tar.gz
kernel-a20ad4f4fd68300449af16c2e3627703951bb83c.tar.xz
kernel-a20ad4f4fd68300449af16c2e3627703951bb83c.zip
Add script to check config generation
The kernel configuration generation currently checks to make sure every option is defined with listnewconfig. It does not check that each option is the same as listnewconfig. This can lead to odd situations where the Fedora configuration does not match what's actually present in the generated config. Add a script to check for these kinds of changes. Based on work done by Miguel Flores Silverio <floresmigu3l@gmail.com>
Diffstat (limited to 'kernel.spec')
-rw-r--r--kernel.spec20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec
index 21a1e07d2..652af7af8 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -313,8 +313,10 @@ Summary: The Linux kernel
# printed out?
%if %{nopatches}
%define listnewconfig_fail 0
+%define configmismatch_fail 0
%else
%define listnewconfig_fail 1
+%define configmismatch_fail 1
%endif
# To temporarily exclude an architecture from being built, add it to
@@ -449,6 +451,8 @@ Source39: kernel-x86_64-debug.config
Source40: generate_all_configs.sh
Source41: generate_debug_configs.sh
+Source42: check_configs.awk
+
# This file is intentionally left empty in the stock kernel. Its a nicety
# added for those wanting to do custom rebuilds with altered config opts.
Source1000: kernel-local
@@ -1210,9 +1214,21 @@ rm -f kernel-%{version}-*debug.config
%define make make %{?cross_opts}
+CheckConfigs() {
+ ./check_configs.awk $1 $2 > .mismatches
+ if [ -s .mismatches ]
+ then
+ echo "Error: Mismatches found in configuration files"
+ cat .mismatches
+ exit 1
+ fi
+}
+
+cp %{SOURCE42} .
# 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
@@ -1226,6 +1242,10 @@ do
make ARCH=$Arch oldnoconfig
echo "# $Arch" > configs/$i
cat .config >> configs/$i
+%if %{configmismatch_fail}
+ CheckConfigs configs/$i temp-$i
+%endif
+ rm temp-$i
done
# end of kernel config
%endif