meta-agl-basesystem: fix kernel-module-evklib build 55/27455/1
authorScott Murray <scott.murray@konsulko.com>
Wed, 4 May 2022 19:56:06 +0000 (15:56 -0400)
committerScott Murray <scott.murray@konsulko.com>
Wed, 4 May 2022 19:56:06 +0000 (15:56 -0400)
Add a patch to fix building kernel-module-evklib against 5.10.0 or
newer kernels, which is required to fix building the test image for
qemux86-64 (which now has 5.15).

Bug-AGL: SPEC-4343

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I9ad382d2f0136ed27e100884c8ed82c0ee1c785c

meta-oem-production-readiness/meta-agl-basesystem/recipes-kernel/kernel-module-evklib/kernel-module-evklib/0001-Handle-switch-to-proc_ops.patch [new file with mode: 0644]
meta-oem-production-readiness/meta-agl-basesystem/recipes-kernel/kernel-module-evklib/kernel-module-evklib_1.0.0.bb

diff --git a/meta-oem-production-readiness/meta-agl-basesystem/recipes-kernel/kernel-module-evklib/kernel-module-evklib/0001-Handle-switch-to-proc_ops.patch b/meta-oem-production-readiness/meta-agl-basesystem/recipes-kernel/kernel-module-evklib/kernel-module-evklib/0001-Handle-switch-to-proc_ops.patch
new file mode 100644 (file)
index 0000000..8d25a0d
--- /dev/null
@@ -0,0 +1,60 @@
+From 8755cc145f867d9c82831c6ba7688e3614e394b1 Mon Sep 17 00:00:00 2001
+From: Scott Murray <scott.murray@konsulko.com>
+Date: Wed, 4 May 2022 15:48:10 -0400
+Subject: [PATCH] Handle switch to proc_ops
+
+The proc API switched to using proc_ops instead of file_operations
+in 5.10, add conditional definitions to get the driver compiling
+for both pre/post 5.10.0 for now.
+
+Bug-AGL: SPEC-4343
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ module/kernel-module-evklib/evk_lib.c | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/module/kernel-module-evklib/evk_lib.c b/module/kernel-module-evklib/evk_lib.c
+index e6dd238..ff8a749 100755
+--- a/module/kernel-module-evklib/evk_lib.c
++++ b/module/kernel-module-evklib/evk_lib.c
+@@ -1839,6 +1839,7 @@ evk_procFS_queue_open(struct inode *inode, struct file *file)
+   return single_open(file, evk_procFS_queue_show, NULL);
+ }
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
+ static struct file_operations evk_proc_flag_fops = {
+   .owner   = THIS_MODULE,
+   .open    = evk_procFS_flag_open,
+@@ -1862,6 +1863,28 @@ static struct file_operations evk_proc_queue_fops = {
+   .llseek  = seq_lseek,
+   .release = single_release,
+ };
++#else
++static struct proc_ops evk_proc_flag_fops = {
++  .proc_open    = evk_procFS_flag_open,
++  .proc_read    = seq_read,
++  .proc_lseek   = seq_lseek,
++  .proc_release = single_release,
++};
++
++static struct proc_ops evk_proc_flag64_fops = {
++  .proc_open    = evk_procFS_flag64_open,
++  .proc_read    = seq_read,
++  .proc_lseek   = seq_lseek,
++  .proc_release = single_release,
++};
++
++static struct proc_ops evk_proc_queue_fops = {
++  .proc_open    = evk_procFS_queue_open,
++  .proc_read    = seq_read,
++  .proc_lseek   = seq_lseek,
++  .proc_release = single_release,
++};
++#endif
+ #endif /*ENABLE_PROC_FS*/
+ __init int
+-- 
+2.35.1
+
index c40b270..9f57e53 100644 (file)
@@ -7,7 +7,9 @@ LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE.GPL-2.0-only;md5=4ee23c52855c222cba72583d301d2338"
 
 PV = "1.0.0+gitr${SRCPV}"
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/basesystem.git;protocol=https;branch=${AGL_BRANCH}"
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/basesystem.git;protocol=https;branch=${AGL_BRANCH} \
+           file://0001-Handle-switch-to-proc_ops.patch;striplevel=3 \
+"
 SRCREV := "${BASESYSTEM_REVISION}"
 
 S = "${WORKDIR}/git/module/kernel-module-evklib"