From ad95515783226863543f4d9e2baa6ee44e73ba6d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 12 May 2021 16:29:36 +0200 Subject: [PATCH] d/rules: headers compile: run modules_prepare copy scripts & includes after The prepare/compile/install targets feel a bit mixed, so it's not 100% clear where this should happen. But as the `.headers_compile_mark` already triggers various kernel build targets with a correct kconfig setup, it is a good fit to add the modules_prepare step (which is recommended to use when preparing a out-of-three (OOT) module build environment like dkms expects) there. As we can only copy (= install) the `scripts` directory afterwards it follows that it needs to be moved afterwards. Moving installing the `include` directory there is not really necessary but it feels like a better place than the _prepare_ target and safes a extra line, so move that over too. In terms of actual changes to the built header package we get additionally the, now generated, module.lds file. Signed-off-by: Thomas Lamprecht --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index cb170bc..7b1b251 100755 --- a/debian/rules +++ b/debian/rules @@ -185,7 +185,6 @@ binary: install -o -name '*.pl' \ \) \ -print | cpio -pd --preserve-modification-time ${BUILD_DIR}/debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} - cd ${KERNEL_SRC_COPY}; cp -a include scripts ${BUILD_DIR}/debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} cd ${KERNEL_SRC_COPY}; \ ( \ find arch/${KERNEL_HEADER_ARCH} -name include -type d -print | \ @@ -199,7 +198,8 @@ binary: install rm -rf ${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG} mkdir -p ${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG} cp ${KERNEL_SRC}/.config ${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG}/.config - ${MAKE} -C ${KERNEL_SRC_COPY} O=${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG} -j1 syncconfig prepare scripts + ${MAKE} -C ${KERNEL_SRC_COPY} O=${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG} -j1 syncconfig modules_prepare prepare scripts + cd ${KERNEL_SRC_COPY}; cp -a include scripts ${BUILD_DIR}/debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME} find ${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG} -name \*.o.ur-\* -o -name '*.cmd' | xargs rm -f rsync --ignore-existing -r -v -a $(addprefix ${BUILD_DIR}/${KERNEL_SRC_COPY}/${PVE_HEADER_PKG}/,arch include kernel scripts tools) ${BUILD_DIR}/debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}/ rm -rf ${BUILD_DIR}/${KERNEL_SRC_COPY}