gasket-driver: Install Coral EdgeTPU driver

The *gasket-driver* container installs the `gasket` and `apex` kernel
modules, which provide the driver for the Google Coral EdgeTPU AI
accellerator module.  The container image must be built ahead of time,
of course, and contains modules built for a specific Fedora kernel
version.

The udev rule has two purposes: to set the permissions on the device
node so that any user on the system can access it, and to "tag" the
device so that systemd will generate a `.device` unit for it.  The
latter allows other units (e.g. Frigate) to express a `Requires=` and
`After=` dependency on the device unit, so that they do not start until
the driver is loaded.
master
Dustin 2023-09-16 07:58:48 -05:00
parent afadd7dcf5
commit 1d71f874cf
3 changed files with 37 additions and 0 deletions

1
65-apex.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="apex", MODE="0666", TAG+="systemd"

17
gasket-driver.container Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Install the gasket/apex kernel modules
Wants=network-online.target
After=network-online.target
[Container]
Image=git.pyrocufflink.net/containerimages/gasket-driver:%v
PodmanArgs=--privileged
[Service]
Type=oneshot
RemainAfterExit=true
ExecStop=/usr/sbin/rmmod apex
ExecStop=/usr/sbin/rmmod gasket
[Install]
WantedBy=multi-user.target

19
gasket-driver.yaml Normal file
View File

@ -0,0 +1,19 @@
variant: fcos
version: 1.4.0
storage:
files:
- path: /etc/containers/systemd/gasket-driver.container
mode: 0644
contents:
local: gasket-driver.container
- path: /etc/udev/rules.d/65-apex.rules
mode: 0644
contents:
local: 65-apex.rules
systemd:
units:
- name: gasket-driver.service
enabled: true