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:
parent
2d3f31643a
commit
050feb590f
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user