Fixed recompilation of kernel headers into a single thread. (#2851)

Compiling the kernel headers repeatedly and in a single thread
increased the overall package build time by several times.

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
This commit is contained in:
The-going 2021-05-27 21:40:29 +03:00 committed by GitHub
parent 2d3f31643a
commit 050feb590f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -77,10 +77,12 @@ EOT
cat >> $pdir/DEBIAN/postinst << EOT
cd /usr/src/linux-headers-$version
echo "Compiling headers - please wait ..."
NCPU=\$(grep -c 'processor' /proc/cpuinfo)
find -type f -exec touch {} +
make -j\$NCPU M=scripts clean >/dev/null
yes "" | make oldconfig >/dev/null
make -j\$(grep -c 'processor' /proc/cpuinfo) -s scripts >/dev/null
make -j\$(grep -c 'processor' /proc/cpuinfo) -s M=scripts/mod/ >/dev/null
make -j\$NCPU -s scripts >/dev/null
make -j\$NCPU -s M=scripts/mod/ >/dev/null
exit 0
EOT
@ -108,9 +110,11 @@ deploy_kernel_headers () {
rm -rf $pdir
destdir=$pdir/usr/src/linux-headers-$version
mkdir -p $destdir
(
cd $srctree
$MAKE M=scripts clean >/dev/null
find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl
find arch/*/include include scripts -type f -o -type l
find security/*/include -type f
@ -131,9 +135,6 @@ deploy_kernel_headers () {
fi
} > debian/hdrobjfiles
destdir=$pdir/usr/src/linux-headers-$version
mkdir -p $destdir
(
cd $destdir
patch -p1 < /tmp/headers-debian-byteshift.patch

View File

@ -231,15 +231,11 @@ cat <<EOF > debian/rules
srctree ?= .
build-indep:
build-arch:
build:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile
build: build-arch
binary-indep:
binary-arch: build-arch
binary-arch:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg