Skip to content

Commit 517b49c

Browse files
committed
Merge: redhat: pass correct RPM_VMLINUX_H to bpftool install
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4299 redhat: pass correct RPM_VMLINUX_H to bpftool install This is required to fix occasional racy build failures where the lack of a correctly specified path to vmlinux.h in the %install phase can cause the bpf Makefile to try and re-generate it against the build-host kernel; the mistmatched built tools and host kernel can then crash, aborting the build. To add to the fun of this, it's somewhat randomly tied to when bpf /sys/ files have updated timestamps to trigger the make dependency. By saving the file and referencing in the %install phase, we bypass all this. JIRA: INTERNAL Upstream-status: https://gitlab.com/cki-project/kernel-ark Related-issue: https://gitlab.com/cki-project/kernel-arkproject/infrastructure/-/issues/340 Related-MR: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3105 Link: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=e7b64f9d3f5b10186038201e0b91f734cbd7fc3d Signed-off-by: Ian Wienand <iwienand@redhat.com> Approved-by: Jan Stancek <jstancek@redhat.com> Approved-by: Patrick Talbert <ptalbert@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents c6642d4 + 319106d commit 517b49c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

redhat/kernel.spec.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,6 +2720,7 @@ popd
27202720
if [ -f $DevelDir/vmlinux.h ]; then
27212721
RPM_VMLINUX_H=$DevelDir/vmlinux.h
27222722
fi
2723+
echo "${RPM_VMLINUX_H}" > ../vmlinux_h_path
27232724

27242725
%if %{with_bpftool}
27252726
%global bpftool_make \
@@ -2876,6 +2877,9 @@ find Documentation -type d | xargs chmod u+w
28762877

28772878
cd linux-%{KVERREL}
28782879

2880+
# re-define RPM_VMLINUX_H, because it doesn't carry over from %build
2881+
RPM_VMLINUX_H="$(cat ../vmlinux_h_path)"
2882+
28792883
%if %{with_doc}
28802884
docdir=$RPM_BUILD_ROOT%{_datadir}/doc/kernel-doc-%{specversion}-%{pkgrelease}
28812885

0 commit comments

Comments
 (0)