summaryrefslogtreecommitdiffstats
path: root/kernel.spec
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2019-10-21 15:07:07 -0400
committerLaura Abbott <labbott@redhat.com>2019-10-22 08:43:38 -0400
commitc08fbbf9f79b1dc585bb7640986755355a231b34 (patch)
tree9c90bc8f638c752362be179db1ce3ea0a0a5e68e /kernel.spec
parentbe43f9d0949875743c4931ee4eabd99cdefd5c8a (diff)
downloadkernel-c08fbbf9f79b1dc585bb7640986755355a231b34.tar.gz
kernel-c08fbbf9f79b1dc585bb7640986755355a231b34.tar.xz
kernel-c08fbbf9f79b1dc585bb7640986755355a231b34.zip
Update cross_headers commands
The kernel currently builds the headers in a separate repository but rebuilds may want to build it from the same srpm. Make sure the cross command actually works.
Diffstat (limited to 'kernel.spec')
-rw-r--r--kernel.spec25
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel.spec b/kernel.spec
index fd4578985..ecab7da6c 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1663,27 +1663,22 @@ find $RPM_BUILD_ROOT/usr/include \
%endif
%if %{with_cross_headers}
+HDR_ARCH_LIST='arm arm64 powerpc s390 x86'
mkdir -p $RPM_BUILD_ROOT/usr/tmp-headers
-make ARCH=%{hdrarch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr/tmp-headers headers_install_all
-find $RPM_BUILD_ROOT/usr/tmp-headers/include \
+for arch in $HDR_ARCH_LIST; do
+ mkdir $RPM_BUILD_ROOT/usr/tmp-headers/arch-${arch}
+ make ARCH=${arch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr/tmp-headers/arch-${arch} headers_install
+done
+
+find $RPM_BUILD_ROOT/usr/tmp-headers \
\( -name .install -o -name .check -o \
-name ..install.cmd -o -name ..check.cmd \) -delete
# Copy all the architectures we care about to their respective asm directories
-for arch in arm arm64 powerpc s390 x86 ; do
-mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include
-mv $RPM_BUILD_ROOT/usr/tmp-headers/include/arch-${arch}/asm $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/
-cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/.
-done
-
-# Remove the rest of the architectures
-rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/arch*
-rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-*
-
-# Copy the rest of the headers over
-for arch in arm arm64 powerpc s390 x86 ; do
-cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/.
+for arch in $HDR_ARCH_LIST ; do
+ mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include
+ mv $RPM_BUILD_ROOT/usr/tmp-headers/arch-${arch}/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/
done
rm -rf $RPM_BUILD_ROOT/usr/tmp-headers