Skip to content

Commit 9a8d282

Browse files
committed
kernel.spec: allow to package some binaries as unstripped
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2161464 Upstream Status: RHEL only ARK commit 9cc9fe68f41bf0ca97ad7235f4735dc7a22943fc Some binaries (tests) don't work properly without symbols. Add a macro that allows to package their unstripped version. Signed-off-by: Jan Stancek <jstancek@redhat.com>
1 parent 3419415 commit 9a8d282

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

redhat/kernel.spec.template

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
%global _with_cross 1
3030
%endif
3131

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+
3244
# The kernel's %%install section is special
3345
# Normally the %%install section starts by cleaning up the BUILD_ROOT
3446
# like so:
@@ -1597,6 +1609,9 @@ cd ..
15971609
###
15981610
%build
15991611

1612+
rm -rf %{buildroot_unstripped} || true
1613+
mkdir -p %{buildroot_unstripped}
1614+
16001615
%if %{with_sparse}
16011616
%define sparse_mflags C=1
16021617
%endif
@@ -2491,6 +2506,7 @@ find Documentation -type d | xargs chmod u+w
24912506
%{__arch_install_post}\
24922507
%{__os_install_post}\
24932508
%{__remove_unwanted_dbginfo_install_post}\
2509+
%{__restore_unstripped_root_post}\
24942510
%{__modsign_install_post}
24952511

24962512
###

0 commit comments

Comments
 (0)