]> git.proxmox.com Git - pve-kernel.git/commitdiff
d/rules: close race between 'cp' and module handling
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 15 Jun 2021 11:27:29 +0000 (13:27 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Jun 2021 12:31:10 +0000 (14:31 +0200)
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>
debian/rules

index 0bd8eb5524c807e9f324033a3e39a7c2f6f88c71..6be3f18d964dee4b86a3d56c25de51568f5af0dd 100755 (executable)
@@ -114,6 +114,9 @@ binary: install
 .config_mark:
        cd ${KERNEL_SRC}; scripts/config ${PVE_CONFIG_OPTS}
        ${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 $@
 
 .compile_mark: .config_mark
@@ -179,9 +182,6 @@ binary: install
        rm -rf debian/${PVE_HEADER_PKG}
        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}
-       # 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
        cd ${KERNEL_SRC_COPY}; find . -path './debian/*' -prune \
            -o -path './include/*' -prune \