1) When doing patch for qat, the variable KERNEL_VERSION may not be set
yet, so qat17_4.7.0-00006-Switch-to-skcipher-API.patch cannot be applied.
Add task dependency to fix it.

2) Changing SRC_URI may lead to "basehash value changed" error message.
Doing patch in a separate function to avoid it.

Signed-off-by: Yongxin Liu <[email protected]>
---
 recipes-extended/qat/qat17_4.7.0-00006.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/recipes-extended/qat/qat17_4.7.0-00006.bb 
b/recipes-extended/qat/qat17_4.7.0-00006.bb
index 693a2f8..a77f4c0 100644
--- a/recipes-extended/qat/qat17_4.7.0-00006.bb
+++ b/recipes-extended/qat/qat17_4.7.0-00006.bb
@@ -21,11 +21,19 @@ SRC_URI = 
"https://01.org/sites/default/files/downloads/qat1.7.l.4.7.0-00006.tar
            file://qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch \
            file://qat17_4.7.0-00006-Link-driver-with-object-files.patch \
            file://qat17_4.7.0-00006-Drop-pr_warning-definition.patch \
+           file://qat17_4.7.0-00006-Switch-to-skcipher-API.patch;apply=0 \
           "
 
-python __anonymous () {
+do_patch[depends] += "virtual/kernel:do_shared_workdir"
+
+do_patch_append () {
     if d.getVar("KERNEL_VERSION") >= "5.5%":
-        d.appendVar('SRC_URI', 
"file://qat17_4.7.0-00006-Switch-to-skcipher-API.patch")
+        bb.build.exec_func('do_switch_to_skcipher_api', d)
+}
+
+do_switch_to_skcipher_api () {
+    cd "${S}"
+    patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-Switch-to-skcipher-API.patch"
 }
 
 SRC_URI[md5sum] = "ac939b51cc8836c182e31e309c065002"
-- 
2.14.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#6339): 
https://lists.yoctoproject.org/g/meta-intel/message/6339
Mute This Topic: https://lists.yoctoproject.org/mt/69746863/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to