|
29 | 29 | %global _with_cross 1 |
30 | 30 | %endif |
31 | 31 |
|
| 32 | +# RPM macros strip everything in BUILDROOT, either with __strip |
| 33 | +# or find-debuginfo.sh. Make use of __spec_install_post override |
| 34 | +# and save/restore binaries we want to package as unstripped. |
| 35 | +%define buildroot_unstripped %{_builddir}/root_unstripped |
| 36 | +%define buildroot_save_unstripped() \ |
| 37 | +(cd %{buildroot}; cp -rav --parents -t %{buildroot_unstripped}/ %1 || true) \ |
| 38 | +%{nil} |
| 39 | +%define __restore_unstripped_root_post \ |
| 40 | + echo "Restoring unstripped artefacts %{buildroot_unstripped} -> %{buildroot}" \ |
| 41 | + cp -rav %{buildroot_unstripped}/. %{buildroot}/ \ |
| 42 | +%{nil} |
| 43 | + |
32 | 44 | # The kernel's %%install section is special |
33 | 45 | # Normally the %%install section starts by cleaning up the BUILD_ROOT |
34 | 46 | # like so: |
@@ -1692,6 +1704,9 @@ cd .. |
1692 | 1704 | ### |
1693 | 1705 | %build |
1694 | 1706 |
|
| 1707 | +rm -rf %{buildroot_unstripped} || true |
| 1708 | +mkdir -p %{buildroot_unstripped} |
| 1709 | + |
1695 | 1710 | %if %{with_sparse} |
1696 | 1711 | %define sparse_mflags C=1 |
1697 | 1712 | %endif |
@@ -2549,6 +2564,7 @@ for dir in bpf bpf/no_alu32 bpf/progs; do |
2549 | 2564 | xargs -0 cp -t %{buildroot}%{_libexecdir}/kselftests/$dir || true |
2550 | 2565 | done |
2551 | 2566 | ln -sr %{buildroot}%{_libexecdir}/kselftests/bpf/bpftool %{buildroot}%{_libexecdir}/kselftests/bpf/no_alu32/bpftool |
| 2567 | +%buildroot_save_unstripped "usr/libexec/kselftests/bpf/test_progs" |
2552 | 2568 | popd |
2553 | 2569 | export -n BPFTOOL |
2554 | 2570 | %endif |
@@ -2636,6 +2652,7 @@ find Documentation -type d | xargs chmod u+w |
2636 | 2652 | %{__arch_install_post}\ |
2637 | 2653 | %{__os_install_post}\ |
2638 | 2654 | %{__remove_unwanted_dbginfo_install_post}\ |
| 2655 | + %{__restore_unstripped_root_post}\ |
2639 | 2656 | %{__modsign_install_post} |
2640 | 2657 |
|
2641 | 2658 | ### |
|
0 commit comments