From: Felix Maurer on gitlab.com Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422
Improve the packaging process of the no_alu32 bpf selftests. They need a link to the bpftool binary (this change is already in centos-stream-9 but now added to kernel-ark) and the test_progs-no_alu32 needs to have symbols, i.e., must not be stripped.
Signed-off-by: Felix Maurer fmaurer@redhat.com
--- redhat/kernel.spec.template | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
From: Jerome Marchand jmarchan@redhat.com
bpf/selftests: fix bpf selftests install
bpftool is not installed in bpf/no_alu32/. That's because it is a link. Add a link to bpf/bpftool in bpf/no_alu32/.
Signed-off-by: Jerome Marchand jmarchan@redhat.com Signed-off-by: Felix Maurer fmaurer@redhat.com
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 @@ -2577,6 +2577,7 @@ for dir in bpf bpf/no_alu32 bpf/progs; do -name '*.o' -exec sh -c 'readelf -h "{}" | grep -q "^ Machine:.*BPF"' ; ) -print0 | \ xargs -0 cp -t %{buildroot}%{_libexecdir}/kselftests/$dir || true done +ln -sr %{buildroot}%{_libexecdir}/kselftests/bpf/bpftool %{buildroot}%{_libexecdir}/kselftests/bpf/no_alu32/bpftool %buildroot_save_unstripped "usr/libexec/kselftests/bpf/test_progs" popd export -n BPFTOOL
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422
From: Felix Maurer fmaurer@redhat.com
kernel.spec: package unstripped test_progs-no_alu32
Two bpf selftest run by test_progs-no_alu32 were failing:
./test_progs-no_alu32 -t attach_probe [...] libbpf: elf: failed to find symbol 'trigger_func2' in '/proc/self/exe' test_attach_probe:FAIL:attach_uprobe_byname unexpected error: -2 [...]
./test_progs-no_alu32 -t uprobe_autoattach [...] libbpf: elf: failed to find symbol 'autoattach_trigger_func' in '/proc/self/exe' libbpf: prog 'handle_uprobe_byname': failed to auto-attach: -2 test_uprobe_autoattach:FAIL:skel_attach unexpected error: -2 (errno 2) [...]
These selftests require symbols in the test binary to pass. We already ship kselftests/bpf/test_progs unstripped. Package the no_alu32 variant of the test binary unstripped as well.
Signed-off-by: Felix Maurer fmaurer@redhat.com
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 @@ -2579,6 +2579,7 @@ for dir in bpf bpf/no_alu32 bpf/progs; do done ln -sr %{buildroot}%{_libexecdir}/kselftests/bpf/bpftool %{buildroot}%{_libexecdir}/kselftests/bpf/no_alu32/bpftool %buildroot_save_unstripped "usr/libexec/kselftests/bpf/test_progs" +%buildroot_save_unstripped "usr/libexec/kselftests/bpf/test_progs-no_alu32" popd export -n BPFTOOL %endif
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422
From: Felix Maurer on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422#note_1370836...
There is, added it to the commit message
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422#note_1370934...
Thanks :) Sorry for the bother but it is nice to track that info. It helps us remember why we made a change later on :)
From: Justin M. Forbes on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422#note_1377175...
This didn't pass the pipeline because it doesn't build:
``` ln: failed to create symbolic link '/builddir/build/BUILDROOT/kernel-6.4.0-0.r c0.20230503git348551ddaf31.12.eln126.x86_64/usr/libexec/kselftests/bpf/no_alu3 2/bpftool': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.EBPekY (%build) ```
reverting this change fixes the build.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422#note_1377365...
My local build with rhel9 buildroot worked OK, so I'm assuming the cause is that selftests failed to build and ARK build continues. It probably needs similar check as is done in for loop above, before attempting to create symlink.
From: Patrick Talbert on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2422#note_1378675...
@fmaurer-rh As this was causing build failures it has been reverted. I should have noticed before but with all the other failures it slipped past me. Please do resubmit a corrected patch though! Thank you.
kernel@lists.fedoraproject.org