d/rules: close race between 'cp' and module handling

sometimes the build would fail with

cp: cannot stat 'ubuntu-hirsute/.tmp_1987275': No such file or directory
make[1]: *** [debian/rules:181: .headers_prepare_mark] Error 1
make[1]: Leaving directory '/home/fgruenbichler/pve-kernel/build'
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
make: *** [Makefile:58: pve-kernel-5.11.21-1-pve_5.11.21-1_amd64.deb] Error 2

if copying was slow enough.

so let's do the copying first, then do the rest in parallel without
needing to worry about side-effects.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-06-15 13:27:29 +02:00 committed by Thomas Lamprecht
parent b5dd2682ff
commit 5ca6d78da6

6
debian/rules vendored
View File

@ -114,6 +114,9 @@ binary: install
.config_mark: .config_mark:
cd ${KERNEL_SRC}; scripts/config ${PVE_CONFIG_OPTS} cd ${KERNEL_SRC}; scripts/config ${PVE_CONFIG_OPTS}
${MAKE} -C ${KERNEL_SRC} oldconfig ${MAKE} -C ${KERNEL_SRC} oldconfig
# copy to allow building in parallel to kernel/module compilation without interference
rm -rf ${KERNEL_SRC_COPY}
cp -ar ${KERNEL_SRC} ${KERNEL_SRC_COPY}
touch $@ touch $@
.compile_mark: .config_mark .compile_mark: .config_mark
@ -179,9 +182,6 @@ binary: install
rm -rf debian/${PVE_HEADER_PKG} rm -rf debian/${PVE_HEADER_PKG}
mkdir -p debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} mkdir -p debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}
install -m 0644 ${KERNEL_SRC}/.config debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} install -m 0644 ${KERNEL_SRC}/.config debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}
# copy to allow building in parallel to kernel/module compilation without interference
rm -rf ${KERNEL_SRC_COPY}
cp -ar ${KERNEL_SRC} ${KERNEL_SRC_COPY}
make -C ${KERNEL_SRC_COPY} mrproper make -C ${KERNEL_SRC_COPY} mrproper
cd ${KERNEL_SRC_COPY}; find . -path './debian/*' -prune \ cd ${KERNEL_SRC_COPY}; find . -path './debian/*' -prune \
-o -path './include/*' -prune \ -o -path './include/*' -prune \