[grub2] Don't process a ton of grub modules with find-debuginfo.sh
Peter Jones
pjones at fedoraproject.org
Thu Sep 4 18:42:44 UTC 2014
commit ee7733c5eb0fc367d4ab4825c8a275d799418757
Author: Peter Jones <pjones at redhat.com>
Date: Wed Sep 3 15:46:53 2014 -0400
Don't process a ton of grub modules with find-debuginfo.sh
It just rejects them anyway, and it slows down the build.
Signed-off-by: Peter Jones <pjones at redhat.com>
grub2.spec | 43 +++++++++++++++----------------------------
1 files changed, 15 insertions(+), 28 deletions(-)
---
diff --git a/grub2.spec b/grub2.spec
index 03e13b4..4542688 100644
--- a/grub2.spec
+++ b/grub2.spec
@@ -59,7 +59,6 @@ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz
Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz
Source5: theme.tar.bz2
Source6: gitignore
-#Source6: grub-cd.cfg
Patch0001: 0001-fix-EFI-detection-on-Windows.patch
Patch0002: 0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch
@@ -430,19 +429,6 @@ install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/
touch $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/grub.cfg
ln -s ../boot/efi/EFI/%{efidir}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg
-# Install ELF files modules and images were created from into
-# the shadow root, where debuginfo generator will grab them from
-find $RPM_BUILD_ROOT -name '*.mod' -o -name '*.img' |
-while read MODULE
-do
- BASE=$(echo $MODULE |sed -r "s,.*/([^/]*)\.(mod|img),\1,")
- # Symbols from .img files are in .exec files, while .mod
- # modules store symbols in .elf. This is just because we
- # have both boot.img and boot.mod ...
- EXT=$(echo $MODULE |grep -q '.mod' && echo '.elf' || echo '.exec')
- TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,")
-# install -m 755 -D $BASE$EXT $TGT
-done
install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname}
%ifnarch aarch64
install -m 755 %{grubeficdname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubeficdname}
@@ -463,20 +449,6 @@ ln -s ../boot/%{name}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.cfg
cp -a $RPM_BUILD_ROOT%{_datarootdir}/locale/en\@quot $RPM_BUILD_ROOT%{_datarootdir}/locale/en
-# Install ELF files modules and images were created from into
-# the shadow root, where debuginfo generator will grab them from
-find $RPM_BUILD_ROOT -name '*.mod' -o -name '*.img' |
-while read MODULE
-do
- BASE=$(echo $MODULE |sed -r "s,.*/([^/]*)\.(mod|img),\1,")
- # Symbols from .img files are in .exec files, while .mod
- # modules store symbols in .elf. This is just because we
- # have both boot.img and boot.mod ...
- EXT=$(echo $MODULE |grep -q '.mod' && echo '.elf' || echo '.exec')
- TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,")
-# install -m 755 -D $BASE$EXT $TGT
-done
-
mv $RPM_BUILD_ROOT%{_infodir}/grub.info $RPM_BUILD_ROOT%{_infodir}/%{name}.info
mv $RPM_BUILD_ROOT%{_infodir}/grub-dev.info $RPM_BUILD_ROOT%{_infodir}/%{name}-dev.info
rm $RPM_BUILD_ROOT%{_infodir}/dir
@@ -515,6 +487,21 @@ mkdir -p boot/efi/EFI/%{efidir}/
ln -s /boot/efi/EFI/%{efidir}/grubenv boot/grub2/grubenv
%endif
+# Don't run debuginfo on all the grub modules and whatnot; it just
+# rejects them, complains, and slows down extraction.
+%global finddebugroot "%{_builddir}/%{?buildsubdir}/debug"
+mkdir -p %{finddebugroot}/usr
+cp -a ${RPM_BUILD_ROOT}/usr/bin %{finddebugroot}/usr/bin
+cp -a ${RPM_BUILD_ROOT}/usr/sbin %{finddebugroot}/usr/sbin
+
+%global dip RPM_BUILD_ROOT=%{finddebugroot} %{__debug_install_post}
+%define __debug_install_post %{dip} \
+ install -m 0755 -d %{buildroot}/usr/lib/ %{buildroot}/usr/src/ \
+ cp -al %{finddebugroot}/usr/lib/debug/ \\\
+ %{buildroot}/usr/lib/debug/ \
+ cp -al %{finddebugroot}/usr/src/debug/ \\\
+ %{buildroot}/usr/src/debug/
+
%clean
rm -rf $RPM_BUILD_ROOT
More information about the scm-commits
mailing list