From bdce7a2deab922d609b82671ee38563c6e6e93a1 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Tue, 9 Mar 2021 10:25:47 +0800 Subject: qat17: do not let do_fetch depend on kernel's do_shared_workdir Having do_fetch depend on kernel's do_shared_workdir has a serious problem, that is, merely performing the do_fetch action will cause more than 400+ tasks run. The dependency is as below. "qat17.do_fetch" -> "linux-yocto.do_shared_workdir" "linux-yocto.do_shared_workdir" -> "linux-yocto.do_compile" "linux-yocto.do_compile" -> "linux-yocto.do_configure" "linux-yocto.do_configure" -> "linux-yocto.do_prepare_recipe_sysroot" "linux-yocto.do_prepare_recipe_sysroot" -> "bc-native.do_populate_sysroot" "linux-yocto.do_prepare_recipe_sysroot" -> "gcc-cross-i686.do_populate_sysroot" [snip] >From the commit history, we can know that the dependency is put on do_fetch to avoid the re-patch problem. This problem could be solved by manually controlling the patching process by checking some marks. So put such check in do_patch_append, and change the dependency back, making do_patch depend on kernel's do_shared_workdir. The best solution for all these mess is to 1) always apply all patches 2) in patch's source codes, check the kernel version and do operation accordingly 3) make do_configure depend on kernel's do_shared_workdir Unfortunately, I'm not familiar with the kernel codes, so hope someone else will have time to fix this entirely in future. Signed-off-by: Chen Qi Signed-off-by: Anuj Mittal --- recipes-extended/qat/qat17_4.7.0-00006.bb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/recipes-extended/qat/qat17_4.7.0-00006.bb b/recipes-extended/qat/qat17_4.7.0-00006.bb index 11082f9..8b222ed 100644 --- a/recipes-extended/qat/qat17_4.7.0-00006.bb +++ b/recipes-extended/qat/qat17_4.7.0-00006.bb @@ -30,7 +30,7 @@ SRC_URI = "https://01.org/sites/default/files/downloads/qat1.7.l.4.7.0-00006.tar file://qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch \ " -do_fetch[depends] += "virtual/kernel:do_shared_workdir" +do_patch[depends] += "virtual/kernel:do_shared_workdir" do_patch_append () { kernel_version = int(d.getVar("KERNEL_VERSION").split(".")[0]) @@ -43,13 +43,19 @@ do_patch_append () { } do_switch_to_skcipher_api () { - cd "${S}" - patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-Switch-to-skcipher-API.patch" + if [ ! -e ${S}/patches/qat17_4.7.0-00006-Switch-to-skcipher-API.patch.applied ]; then + cd "${S}" + patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-Switch-to-skcipher-API.patch" + touch ${S}/patches/qat17_4.7.0-00006-Switch-to-skcipher-API.patch.applied + fi } do_patch_for_kernel_5_6 () { - cd "${S}" - patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch" + if [ ! -e ${S}/patches/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch.applied ]; then + cd "${S}" + patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch" + touch ${S}/patches/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch.applied + fi } -- cgit v1.2.3-54-g00ecf