From: Prarit Bhargava <prarit(a)redhat.com>
spec: Fix separate tools build
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2054579
Upstream Status: RHEL only
If we re building only tools without kernel, we need to generate config
headers and prepare tree for modules building. The modules_prepare target
will cover both.
Signed-off-by: Jiri Olsa <jolsa(a)redhat.com>
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2348,6 +2348,14 @@ popd
# in the source tree. We installed them previously to $RPM_BUILD_ROOT/usr
# but there's no way to tell the Makefile to take them from there.
%{make} %{?_smp_mflags} headers_install
+
+# If we re building only tools without kernel, we need to generate config
+# headers and prepare tree for modules building. The modules_prepare target
+# will cover both.
+if [ ! -f include/generated/autoconf.h ]; then
+ %{make} %{?_smp_mflags} modules_prepare
+fi
+
%{make} %{?_smp_mflags} ARCH=$Arch V=1 M=samples/bpf/ || true
# Prevent bpf selftests to build bpftool repeatedly:
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2021