Accepting request 1118252 from hardware

- Remove `fix-kernel-gte-6.4.patch` as it has been merged upstream.
- Fix ueficert package builds.

OBS-URL: https://build.opensuse.org/request/show/1118252
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gasket-driver?expand=0&rev=3
This commit is contained in:
Ana Guerrero 2023-10-17 18:25:05 +00:00 committed by Git OBS Bridge
commit 0211d1c4c7
9 changed files with 34 additions and 94 deletions

View File

@ -11,8 +11,8 @@ https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService
<param name="url">https://github.com/google/gasket-driver</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="revision">97aeba5</param>
<param name="version">1.0.18</param>
<param name="revision">main</param>
<param name="versionformat">1.0.18_%h</param>
</service>
<!-- Compress source files into a tarball. -->
<service name="tar" mode="buildtime"/>

View File

@ -1,21 +1,12 @@
From a87c105c14e826dafd4b25c36fa7c7c657a7ad03 Mon Sep 17 00:00:00 2001
From: hibby50 <hibby50@gmail.com>
Date: Thu, 20 Apr 2023 14:16:06 -0400
Subject: [PATCH] import DMA_BUF regardless of kernel version
---
src/gasket_page_table.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/gasket_page_table.c b/src/gasket_page_table.c
index e81ab2b..0e768e0 100644
index c9067cb..0e768e0 100644
--- a/src/gasket_page_table.c
+++ b/src/gasket_page_table.c
@@ -53,9 +53,7 @@
#include <linux/version.h>
#include <linux/vmalloc.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
-#if __has_include(<linux/dma-buf.h>)
MODULE_IMPORT_NS(DMA_BUF);
-#endif

View File

@ -1,43 +0,0 @@
From 83cbe8264fc63511e4e6250f2426749951a340c8 Mon Sep 17 00:00:00 2001
From: Chris Bradbury <chris@binaryspanner.com>
Date: Fri, 14 Jul 2023 18:55:56 +0100
Subject: [PATCH] Amend use of `class_create()` for kernels >= 6.4
The function signature for `class_create()` was changed in kernels >= 6.4.x to only accept a single argument (see kernel commit #dcfbb67).
This change will conditionally modify how `class_create()` is called depending on the kernel version.
---
src/gasket_core.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/gasket_core.c b/src/gasket_core.c
index 139616b..b1c2726 100644
--- a/src/gasket_core.c
+++ b/src/gasket_core.c
@@ -27,6 +27,7 @@
#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/sched.h>
+#include <linux/version.h>
#ifdef GASKET_KERNEL_TRACE_SUPPORT
#define CREATE_TRACE_POINTS
@@ -1837,8 +1838,15 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
internal = &g_descs[desc_idx];
mutex_init(&internal->mutex);
memset(internal->devs, 0, sizeof(struct gasket_dev *) * GASKET_DEV_MAX);
- internal->class =
- class_create(driver_desc->module, driver_desc->name);
+
+ /* Function signature for `class_create()` is changed in kernel >= 6.4.x
+ * to only accept a single argument.
+ * */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
+ internal->class = class_create(driver_desc->module, driver_desc->name);
+#else
+ internal->class = class_create(driver_desc->name);
+#endif
if (IS_ERR(internal->class)) {
pr_err("Cannot register %s class [ret=%ld]\n",

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e189a8829b8a50d13f472037e2e2b387cb7335d00a86b9f22f67669e98fad675
size 257035

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b23694f2d97ed358dc8875a251f0148a5f5573e785a60a38495cab3fc6b504d3
size 257547

View File

@ -13,5 +13,3 @@ addFilter("E: no-binary")
# This error is introduced by the KMP sub-package build.
addFilter("gasket-driver-kmp-.* E: suse-zypp-packageand")
# This warning is introduced by the "pesign-repackage" Secure Boot cert package build.
addFilter("gasket-driver-ueficert.* W: non-conffile-in-etc")

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 17 00:00:26 UTC 2023 - Chris Bradbury <chris@binaryspanner.com>
- Remove `fix-kernel-gte-6.4.patch` as it has been merged upstream.
- Fix ueficert package builds.
-------------------------------------------------------------------
Wed Jul 19 23:18:19 UTC 2023 - Chris Bradbury <opensuse@chrbrd.com>

View File

@ -1,4 +1,4 @@
name: gasket-driver
version: 1.0.18
mtime: 1645731663
commit: 97aeba584efd18983850c36dcf7384b0185284b3
version: 1.0.18_09385d4
mtime: 1693941990
commit: 09385d485812088e04a98a6e1227bf92663e0b59

View File

@ -33,8 +33,12 @@
#
# norootforbuild
# Upstream doesn't really do proper releases, so track the main branch
# HEAD's commit hash as well.
%define git_version 09385d4
Name: gasket-driver
Version: 1.0.18
Version: 1.0.18_%{git_version}
Release: 0
Summary: The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems
License: GPL-2.0-only
@ -43,7 +47,7 @@ URL: https://github.com/google/gasket-driver
Source0: %{name}-%{version}.tar.xz
Source1: group.conf
Source2: preamble
Source3: gasket-driver-rpmlintrc
Source3: %{name}-rpmlintrc
BuildRequires: %kernel_module_package_buildreqs
BuildRequires: pesign-obs-integration
BuildRequires: sysuser-tools
@ -51,25 +55,20 @@ Requires: %{name}-kmp
%sysusers_requires
# The dma-buf symbols used by this driver were moved into their own `DMA_BUF`
# module namespace in kernel 5.16. Consequently, the upstream source conditionally
# imports the `DMA_BUF` module namespace if the kernel version is >= 5.16.
# This patch removes that condition, allowing this module to be built for kernels
# that have backported the `DMA_BUF` namespace changes.
# module namespace in kernel 5.16. Upstream's current attempt at fixing this
# doesn't work with GCC versions that don't support the `__has_include` directive.
#
# Affects:
# - Leap 15.5
#
# See:
# https://github.com/google/gasket-driver/pull/10
# https://github.com/google/gasket-driver/commit/a87c105c14e826dafd4b25c36fa7c7c657a7ad03.patch
# https://github.com/google/gasket-driver/pull/16
# https://github.com/google/gasket-driver/issues/17
#
# PATCH-FIX-OPENSUSE fix-for-backported-dma-buf-ns.patch gh#google/gasket-driver!10
Patch0: fix-for-backported-dma-buf-ns.patch
# The function signature for `class_create()` was changed in kernels >= 6.4.x to only accept a
# single argument (see kernel commit #dcfbb67).
# This patch conditionally modifies how `class_create()` is called depending on the kernel version.
# See:
# https://github.com/google/gasket-driver/pull/13
# https://github.com/google/gasket-driver/commit/83cbe8264fc63511e4e6250f2426749951a340c8.patch
# PATCH-FIX-OPENSUSE fix-kernel-gte-6.4.patch gh#google/gasket-driver!13
Patch1: fix-kernel-gte-6.4.patch
# This directive instructs the build service to temporarily save the project's
# certificate as %%_sourcedir/_projectcert.crt. See:
# https://github.com/openSUSE/pesign-obs-integration
@ -78,10 +77,9 @@ Patch1: fix-kernel-gte-6.4.patch
#
# needssslcertforbuild
#
# Having included the above directive, using the `-c` flag below will cause
# the "ueficert" package to get built. `%%_sourcedir` must be prefixed as the
# working dir is changed before the build service attempts to source the certificate.
%kernel_module_package -p preamble -c %_sourcedir/_projectcert.crt
# Having included the above directive, the below line will
# cause the "ueficert" package to get built.
%kernel_module_package -p %_sourcedir/preamble
%description
The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems.
@ -90,13 +88,6 @@ The driver contains two modules:
for lightweight communication with Google ASICs.
- Apex refers to the EdgeTPU v1.
# This magic "KMP" subpackage is documented in
# https://en.opensuse.org/Kernel_Module_Packages#Specfile_mechanisms
%package KMP
Summary: Gasket Driver kernel modules
Group: System/Kernel
@ -114,9 +105,6 @@ mkdir -p obj
%patch0 -p1
%endif
# Apply patches without conditions.
%patch1 -p1
%build
# Build the kernel modules.
for flavor in %flavors_to_build; do