summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2021-03-26 15:50:37 +0100
committerŁukasz Stelmach <l.stelmach@samsung.com>2021-03-31 08:05:09 +0200
commit6302447f5c6b79b1151d1d5b3988d6d65f7bd2b4 (patch)
treec887a299e60e27d98b974a9f146c7ef99f9555ff
parent318b9b3058fd83c7ae4a9d8b3d40bb7c4313fd3e (diff)
downloadlinux-rpi3-6302447f5c6b79b1151d1d5b3988d6d65f7bd2b4.tar.gz
linux-rpi3-6302447f5c6b79b1151d1d5b3988d6d65f7bd2b4.tar.bz2
linux-rpi3-6302447f5c6b79b1151d1d5b3988d6d65f7bd2b4.zip
spec: support gbs(1) incremental builds
gbs(1) enable incremental builds that are significantly faster, hoewever, spec files need some adjustments. + You can't use -n <name> with %setup + use rsync(1) instead of cp(1)+find(1) to copy devel files Other changes are: + add _smp_mflags to make(1) things faster Change-Id: I18c47b59b1bfef17501ab57f39f93d7185592f13 Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rw-r--r--packaging/linux-rpi3.spec51
1 files changed, 27 insertions, 24 deletions
diff --git a/packaging/linux-rpi3.spec b/packaging/linux-rpi3.spec
index 9ac360ddc62e..0065596daad0 100644
--- a/packaging/linux-rpi3.spec
+++ b/packaging/linux-rpi3.spec
@@ -37,6 +37,7 @@ BuildRequires: libelf-devel
BuildRequires: elfutils
BuildRequires: xz-devel
BuildRequires: binutils-devel
+BuildRequires: rsync
%description
The Linux Kernel, the operating system core itself
@@ -80,7 +81,7 @@ This package provides the "perf" tool that can be used to monitor performance
counter events as well as various kernel internal events.
%prep
-%setup -q -n linux-kernel-%{version}
+%setup -q
%build
%{?asan:/usr/bin/gcc-unforce-options}
@@ -90,7 +91,7 @@ counter events as well as various kernel internal events.
sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -%{variant}/" Makefile
# 1-1. Set config file
-make %{config_name}
+make %{config_name} %{?_smp_mflags}
# 1-2. Build Image/Image.gz
make %{?_smp_mflags}
@@ -143,28 +144,30 @@ rm -rf %{buildroot}/usr/lib/debug
rm -rf %{buildroot}/usr/lib/perf
rm -rf %{buildroot}/usr/share
-# 3-1. remove unnecessary files to prepare for devel package
-find %{_builddir}/linux-kernel-%{version} -name ".tmp_vmlinux*" -delete
-find %{_builddir}/linux-kernel-%{version} -name ".gitignore" -delete
-find %{_builddir}/linux-kernel-%{version} -name "\.*dtb*tmp" -delete
-find %{_builddir}/linux-kernel-%{version} -name "\.*dtb" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.*tmp" -delete
-find %{_builddir}/linux-kernel-%{version} -name "Image" -delete
-find %{_builddir}/linux-kernel-%{version} -name "zImage" -delete
-find %{_builddir}/linux-kernel-%{version} -name "Image.gz" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*.cmd" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.ko" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.o" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.S" -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.HEX" -type f -delete
-find %{_builddir}/linux-kernel-%{version} -name "*\.c" -not -path "%{_builddir}/linux-kernel-%{version}/scripts/*" -delete
-
-# 3-2. move files for devel package
-cp -r %{_builddir}/linux-kernel-%{version}/ %{_builddir}/kernel-devel-%{variant}/
-
-# 4. Move files for each package
-mkdir -p %{buildroot}/boot/kernel/devel
-mv %{_builddir}/kernel-devel-%{variant} %{buildroot}/boot/kernel/devel/
+# 3. Copy files for devel package
+mkdir -p %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
+rsync -lr \
+ --include "/scripts/**.c" \
+ --exclude "/debug*.list" \
+ --exclude "/documentation.list" \
+ --exclude "/*.manifest" \
+ --exclude "/packaging/" \
+ --exclude "/.gbs.conf" \
+ --exclude ".gitignore" \
+ --exclude "*\.c" \
+ --exclude ".tmp_vmlinux*" \
+ --exclude ".*dtb*tmp" \
+ --exclude ".*dtb" \
+ --exclude "*.*tmp" \
+ --exclude "Image" \
+ --exclude "zImage" \
+ --exclude "Image.gz" \
+ --exclude "*.cmd" \
+ --exclude "*.ko" \
+ --exclude "*.o" \
+ --exclude "*.S" \
+ --exclude "*.HEX" \
+%{_builddir}/%{name}-%{version}/ %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
%clean