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 <[email protected]>
---
 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
 }
 
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6952): 
https://lists.yoctoproject.org/g/meta-intel/message/6952
Mute This Topic: https://lists.yoctoproject.org/mt/81192491/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to