Hello! I have had exactly the same issue, which I could solve after a lot of digging as I could find precious little information on the topic.
So, some clues are in the kernel.spec
file which refers to a number of options that one can turn on and off:
# The following build options are (mostly) enabled by default, but may become
# enabled/disabled by later architecture-specific checks.
# Where disabled by default, they can be enabled by using --with <opt> in the
# rpmbuild command, or by forcing these values to 1.
# Where enabled by default, they can be disabled by using --without <opt> in
# the rpmbuild command, or by forcing these values to 0.
There is one option in particular that seemed really useful to me:
# Only build the base kernel (--with baseonly):
%define with_baseonly %{?_with_baseonly: 1} %{?!_with_baseonly: 0}
and
# check for mismatched config options
%define with_configchecks %{?_without_configchecks: 0} %{?!_without_configchecks: 1}
Then the packaging guidelines shows:
If the spec file contains conditional dependencies selected based on presence of optional
--with(out) foo
arguments torpmbuild
, build the source RPM to be submitted with the default options, i.e., so that none of these arguments are present in therpmbuild
command line. The reason is that those requirements get “serialized” into the resulting source RPM, i.e., the conditionals no longer apply.
And the --with
, --without
options also now apply to fedpkg local
(and scratch-build
), see this bug tracker for the history.
So, putting it all together what made my day, today, is:
fedpkg local --arch x86_64 --without configcheck --with baseonly
Bonus point, the build is super rapid (granted, my kernel-local
was made with make localmodconfig
on a VM, so very few modules to build) and I don’t end up with a million rpm packages that I don’t need.
Hope that’ll be useful for many folks out there.