On Wed, Oct 28, 2020 at 03:53:33AM -0000, GitLab Bridge on behalf of dzickusrh wrote:
From: Don Zickus <dzickus(a)redhat.com>
For CKI and its cross-compile environment, it can not cross
compile userspace tools. Instead we will native compiles them.
To allow this split, the kernel.spec needs to support only
building userspace stuff and not the kernel itself.
However the userspace tools need some vars defined. This
patch creates a new function and sets up those vars.
Also very useful for debugging userspace tools and skipping
the hour long kernel build times (like LTO).
To use this effectively, one would use
--without_up
--without_debug
--without_zfcpdump
Original author is Brian Masney <bmasney(a)redhat.com>, which
I took from his RHEL-8 contribution.
Cc: Brian Masney <bmasney(a)redhat.com>
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/kernel.spec.template | 68 +++++++++++++++++++++++--------------
1 file changed, 42 insertions(+), 26 deletions(-)
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index 7cbfb9c139eb..5354ee7cffdf 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -79,10 +79,9 @@ Summary: The Linux kernel
%define pkg_release %{specrelease}
-# What parts do we want to build? We must build at least one kernel.
-# These are the kernels that are built IF the architecture allows it.
-# All should default to 1 (enabled) and be flipped to 0 (disabled)
-# by later arch-specific checks.
+# What parts do we want to build? These are the kernels that are built IF the
+# architecture allows it. All should default to 1 (enabled) and be flipped to
+# 0 (disabled) by later arch-specific checks.
# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
@@ -1338,33 +1337,18 @@ cp_vmlinux()
%define make %{__make} %{?cross_opts} %{?make_opts}
HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
-BuildKernel() {
- MakeTarget=$1
- KernelImage=$2
- Flavour=$4
- DoVDSO=$3
- Flav=${Flavour:++${Flavour}}
- InstallName=${5:-vmlinuz}
+InitBuildVars() {
+ # Initialize the kernel .config file and create some variables that are
+ # needed for the actual build process.
- DoModules=1
- if [ "$Flavour" = "zfcpdump" ]; then
- DoModules=0
- fi
+ Flavour=$1
+ Flav=${Flavour:++${Flavour}}
# Pick the right config file for the kernel we're building
Just one minor nit pick. This comment needs updated to 'Pick the right
kernel config file' to match the RHEL 8 patch. All of the other parts
look good.
Brian