commit 353fe31252542201adcd243183d300fbbf8c2462802a8962beff1fc470f12e1e Author: Michal Suchanek Date: Thu May 11 13:12:19 2023 +0000 Accepting request 1086510 from home:chrBrd I want to maintain gasket-driver in Factory and would like to use "hardware" as the devel/feeder project. OBS-URL: https://build.opensuse.org/request/show/1086510 OBS-URL: https://build.opensuse.org/package/show/hardware/gasket-driver?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..332695a --- /dev/null +++ b/_service @@ -0,0 +1,17 @@ + + + + https://github.com/google/gasket-driver + 97aeba5 + %h + git + + + + + *.tar + xz + + + diff --git a/_service:obs_scm:gasket-driver-97aeba5.obscpio b/_service:obs_scm:gasket-driver-97aeba5.obscpio new file mode 100644 index 0000000..d901aab --- /dev/null +++ b/_service:obs_scm:gasket-driver-97aeba5.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a0e596e68861b11cb701f71c3faf938c5f70867c9cfd6d788550f8de4980e0e +size 257547 diff --git a/_service:obs_scm:gasket-driver.obsinfo b/_service:obs_scm:gasket-driver.obsinfo new file mode 100644 index 0000000..d97ea3f --- /dev/null +++ b/_service:obs_scm:gasket-driver.obsinfo @@ -0,0 +1,4 @@ +name: gasket-driver +version: 97aeba5 +mtime: 1645731663 +commit: 97aeba584efd18983850c36dcf7384b0185284b3 diff --git a/gasket-driver-rpmlintrc b/gasket-driver-rpmlintrc new file mode 100644 index 0000000..dce77bd --- /dev/null +++ b/gasket-driver-rpmlintrc @@ -0,0 +1,17 @@ +# The stated solution to this error is to use `noarch`, but as this +# package is for building kernel modules `noarch` causes a cryptic error +# there's _very_ little information about online: +# ``` +# warning: Macro %flavors_to_build needs whitespace before body +# warning: Macro %_suse_kernel_module_subpackage defined but not used within scope +# error: line 43: Unknown tag: %internal_kmp_error +# ``` +# My guess is that when `noarch` is specified then `%flavors_to_build` isn't +# populated properly, and issues cascade from there. Something like that anyway... +# In the meantime this is an acceptable alternative. +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") diff --git a/gasket-driver.changes b/gasket-driver.changes new file mode 100644 index 0000000..92cdd94 --- /dev/null +++ b/gasket-driver.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu May 11 11:51:32 UTC 2023 - Chris Bradbury + +Init diff --git a/gasket-driver.spec b/gasket-driver.spec new file mode 100644 index 0000000..06c68e1 --- /dev/null +++ b/gasket-driver.spec @@ -0,0 +1,129 @@ +# +# spec file for package gasket-driver +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. +# +# Please submit bugfixes or comments via https://bugs.opensuse.org/ + +# +# Packaging Notes: +# ---- +# +# For information on building KMPs see: +# https://documentation.suse.com/sbp/all/single-html/SBP-KMP-Manual-SLE12SP2 +# https://en.opensuse.org/Kernel_Module_Packages +# +# For information on `sysusers` stuff used to create the `apex` group see: +# https://en.opensuse.org/openSUSE:Packaging_guidelines#Users_and_Groups +# +# Examples: +# https://pmbs.links2linux.org/package/view_file/Essentials/r8168/r8168.spec +# https://build.opensuse.org/package/view_file/openSUSE:Factory/vhba-kmp/vhba-kmp.spec +# https://build.opensuse.org/package/show/home:jeff_mahoney:coral-ai/gasket-driver +# https://build.opensuse.org/package/view_file/home:Sauerland/rtl8812AU_8821AU/ <- for signing? +# +# === +# The following 'comment' ensures the package will build correctly on OBS. See: +# https://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks#Permission_denied_errors +# +# norootforbuild +# + +Name: gasket-driver +Version: 97aeba5 +Release: 0 +Summary: The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems +License: GPL-2.0-only +Group: System/Kernel +URL: https://github.com/google/gasket-driver +Source0: %{name}-%{version}.tar.xz +Source1: group.conf +Source2: preamble +BuildRequires: %kernel_module_package_buildreqs +BuildRequires: sysuser-tools +BuildRequires: pesign-obs-integration +Requires: %{name}-kmp +%sysusers_requires + +# The following 'comment' instructs the build service to temporarily save +# the project's certificate as %%_sourcedir/_projectcert.crt. See: +# https://github.com/openSUSE/pesign-obs-integration +# https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual/index.html#sec-signing-module-object +# https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual/index.html#sec-appendix-a1 +# +# needssslcertforbuild +# +# Having included the above 'comment', 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 + +%description +The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems. +The driver contains two modules: +- Gasket (Google ASIC Software, Kernel Extensions, and Tools) is a top level driver + 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 + +%description KMP +The Linux Kernel Module Package for the Coral Gasket Driver. + +%prep +ls -al %_sourcedir +%setup -q +mkdir -p obj + +%build +# Build the kernel modules. +for flavor in %flavors_to_build; do + rm -rf obj/$flavor + cp -r src obj/$flavor + make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor +done +# Generate content to be used by the `%%pre` scriptlet. +%sysusers_generate_pre %{SOURCE1} group group.conf + +# Execute the system group scriptlet generated at build time. +%pre -f group.pre + +%install +# Install the kernel modules. +export INSTALL_MOD_PATH=%{buildroot} +export INSTALL_MOD_DIR=updates +for flavor in %flavors_to_build; do + make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor +done +# Install the system group used by the driver. +mkdir -p %{buildroot}%{_sysusersdir} +install -m 0644 %{SOURCE1} -D %{buildroot}%{_sysusersdir}/group-apex.conf +# Install the udev rules defined in the module source. +install -D -m 644 debian/gasket-dkms.udev %buildroot%{_udevrulesdir}/70-apex.rules + +# These env vars are used by the `pesign-obs-integration` package when signing +# the modules for Secure Boot. +export BRP_PESIGN_FILES='*.ko' +export BRP_PESIGN_COMPRESS_MODULE="xz" + +%files +%license LICENSE +%doc README.md CONTRIBUTING.md +%{_sysusersdir}/group-apex.conf +%{_udevrulesdir}/70-apex.rules + +%changelog + diff --git a/group.conf b/group.conf new file mode 100644 index 0000000..fba72fb --- /dev/null +++ b/group.conf @@ -0,0 +1,2 @@ +# Type Name ID GECOS [HOME] +g apex diff --git a/preamble b/preamble new file mode 100644 index 0000000..02226af --- /dev/null +++ b/preamble @@ -0,0 +1,3 @@ +Enhances: kernel-%1 +Requires: kernel-%1 +