[OS-BUILD PATCH] redhat/kernel.spec: _buildvars_variant

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

 



From: Jan Stancek <jstancek@xxxxxxxxxx>

redhat/kernel.spec: _buildvars_variant

This introduces a new macro that allows to override
variant/config to use for standalone tools/tests build.

In SPEC, we support building standalone tools and selftests.
Main user are CKI pipelines, which run a native build.
Over time however, selftests introduced also kmods, so
picking a correct config now matters as well.

This patch allows CKI (or other users) to pick a variant
when doing standalone tools/tests build. Nothing is changing
for builds that include kernel build.

Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx>

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -217,6 +217,12 @@ Summary: The Linux kernel
 # arm64_64k  X         X             X
 # realtime   X         X             X
 
+# _buildvars_variant - kernel variant used to initialise build variables
+# This variable allows to set variant (and config) that is used when building
+# standalone tools and/or tests (with no kernel and no modules).
+# See variant parameter to BuildKernel() function.
+%define buildvars_variant %{?_buildvars_variant}%{nil}
+
 # kernel-doc
 %define with_doc       %{?_without_doc:       0} %{?!_without_doc:       1}
 # kernel-headers
@@ -2809,10 +2815,11 @@ BuildKernel %make_target %kernel_image %{_use_vdso}
 
 %ifnarch noarch i686 %{nobuildarches}
 %if !%{with_debug} && !%{with_zfcpdump} && !%{with_up} && !%{with_arm64_16k} && !%{with_arm64_64k} && !%{with_realtime}
-# If only building the user space tools, then initialize the build environment
-# and some variables so that the various userspace tools can be built.
+# If only building the user space tools or selftests, then initialize
+# the build environment and some variables so that the various userspace
+# tools can be built.
 %{log_msg "Initialize userspace tools build environment"}
-InitBuildVars
+InitBuildVars %{buildvars_variant}
 # Some tests build also modules, and need Module.symvers
 if ! [[ -e Module.symvers ]] && [[ -f $DevelDir/Module.symvers ]]; then
     %{log_msg "Found Module.symvers in DevelDir, copying to ."}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3089
--
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[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