Hi All,
We've been using merge.pl to merge Fedora's config file fragments for as
long as I can remember. However, in the interest of using what's
upstream, I took a look at the newly added merge_config.sh script and
what it would take to use that instead.
The good:
It actually worked fairly well. The resulting merged config files were
identical to the ones merge.pl creates.
It also provides a lot more output about the options present, what is
overriding what, and final config verification (if we used it to do the
oldconfig step). At some point we could use it to auto-disable new
config options too, but that's a big maybe.
The ok:
The changes to kernel.spec are pretty small. I basically used the same
approach we do today by creating Makefile.merge and calling the script
from within that. Doing similar creation steps in the spec itself was
pretty ugly. The largest change, aside from using a different merge
tool, is that the fragments are merged after all patches are applied. I
don't think there is a reason why they're merged before hand now, but it
is a small difference.
The ugly:
It's slow. All that checking and reporting and verification takes quite
a bit of processing. How much? Well, compare:
Current:
[jwboyer@vader kernel]$ time fedpkg -v prep --arch=noarch >
foo.log
real 0m46.898s
user 0m9.248s
sys 0m35.764s
[jwboyer@vader kernel]$
merge_config.sh (yes, for real):
[jwboyer@vader kernel]$ time fedpkg -v prep --arch=noarch >
foo.log
real 25m16.705s
user 0m58.587s
sys 19m57.125s
[jwboyer@vader kernel]$
merge_config.sh + patch:
[jwboyer@vader kernel]$ time fedpkg -v prep --arch=noarch >
foo.log
real 3m12.711s
user 0m15.655s
sys 2m47.259s
[jwboyer@vader kernel]$
So, ignoring the stock merge_config.sh case which is clearly not usable,
it would make the %prep section roughly 4x longer. The patch I added to
make it at least somewhat reasonable has been sent upstream.
I've attached a log file from a run with merge_config.sh for people to
glance over. Before I do anything else, do people think the output is
useful and this is perhaps beneficial?
josh
Spec diff:
diff --git a/kernel.spec b/kernel.spec
index 858c483..a21eb0a 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -574,6 +574,7 @@ Source15: merge.pl
Source16: mod-extra.list
Source19: Makefile.release
+Source18: Makefile.merge
Source20: Makefile.config
Source21: config-debug
Source22: config-nodebug
@@ -743,6 +744,8 @@ Patch21091: kmemleak.patch
Patch21092: udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
+Patch21093: faster-merge.patch
+
# compat-wireless patches
Patch50000: compat-wireless-config-fixups.patch
Patch50001: compat-wireless-pr_fmt-warning-avoidance.patch
@@ -1265,28 +1268,6 @@ make -f %{SOURCE19} config-release
%endif
%endif
-# Dynamically generate kernel .config files from config-* files
-make -f %{SOURCE20} VERSION=%{version} configs
-
-%if %{with_backports}
-# Turn-off bits provided by compat-wireless
-for i in %{all_arch_configs}
-do
- mv $i $i.tmp
- ./merge.pl %{SOURCE200} $i.tmp > $i
- rm $i.tmp
-done
-%endif
-
-# Merge in any user-provided local config option changes
-%if %{?all_arch_configs:1}%{!?all_arch_configs:0}
-for i in %{all_arch_configs}
-do
- mv $i $i.tmp
- ./merge.pl %{SOURCE1000} $i.tmp > $i
- rm $i.tmp
-done
-%endif
ApplyPatch linux-2.6-makefile-after_link.patch
@@ -1439,6 +1420,8 @@ ApplyPatch udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
#rhbz 783211
ApplyPatch fs-Inval-cache-for-parent-block-device-if-fsync-called-on-part.patch
+ApplyPatch faster-merge.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -1466,6 +1449,45 @@ done
rm -f kernel-%{version}-*debug.config
%endif
+# Ok, now let's try to do this with merge_config.sh
+chmod +x scripts/kconfig/merge_config.sh
+
+# Dynamically generate kernel .config files from config-* files
+make -f %{SOURCE18} VERSION=%{version} configs
+
+%if %{with_backports}
+# Turn-off bits provided by compat-wireless
+for i in %{all_arch_configs}
+do
+ mv $i $i.tmp
+ scripts/kconfig/merge_config.sh -m -n $i.tmp %{SOURCE200}
+ mv .config $i
+ rm $i.tmp
+done
+%endif
+
+# Merge in any user-provided local config option changes
+%if %{?all_arch_configs:1}%{!?all_arch_configs:0}
+for i in %{all_arch_configs}
+do
+ mv $i $i.tmp
+ scripts/kconfig/merge_config.sh -m -n $i.tmp %{SOURCE1000}
+ mv .config $i
+ rm $i.tmp
+done
+%endif
+
+# Remove configs not for the buildarch
+for cfg in kernel-%{version}-*.config; do
+ if [ `echo %{all_arch_configs} | grep -c $cfg` -eq 0 ]; then
+ rm -f $cfg
+ fi
+done
+
+%if !%{debugbuildsenabled}
+rm -f kernel-%{version}-*debug.config
+%endif
+
# now run oldconfig over all the config files
for i in *.config
do