Compare commits

...

12 Commits

Author SHA1 Message Date
9af0a381aa Remove Conflicts for kernel-core
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
Now that the _gasket-driver_ package is an "install only" package
(meaning multiple versions can be installed simultaneously), the
conflict with _kernel-core_ no longer makes sense.  Since
_gasket-driver_ will never "update," the old version will not be
uninstalled, and thus will continuously prevent installing a new kernel
version.

Removing the conflict does open up the possibility of having a new
kernel version installed without a corresponding _gasket-driver_
package.  I think the CI pipeline is working well enough, though, that
this is unlikely.  I would much rather keep the "install only" feature,
so that booting into an older kernel will work as expected.
2025-12-02 18:26:57 -06:00
1b1bd829f1 ci: Fix NoSuchMethodError
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
That's the problem with having conditional stages that don't execute for
test builds...
2025-11-23 18:19:30 -06:00
71bb2e8de5 Provide installonlypkg(kernel-module)
Some checks failed
RPMs/gasket-driver/pipeline/head There was a failure building this commit
This should hopefully allow multiple simultaneous versions of the
package to be installed (i.e. one for each installed kernel), without
having to explicitly specify `installonlypkgs = gasket-driver` in
`dnf.conf`.
2025-11-23 18:15:08 -06:00
1a2b2f604c ci: Use fedoraBuild function
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
Instead of manually specifying a list of Fedora versions to target, we
can now use the `fedoraBuild` pipeline function to generate the target
matrix automatically.

Note that the stage names need to be unique, as the `when` function
cannot mark the correct stage as "skipped" if there are multiple stages
with the same name.
2025-11-23 16:48:40 -06:00
2684e4b814 Add Conflicts to prevent upgrades
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
Since _kernel_ is an `installonly` package, "upgrading" actually
installs a new version instead of replacing the installed version.
Because of this, the `Requires` tag of _gasket-driver_ does not prevent
upgrading to a new version of the kernel, as the requirement will still
be satisfied by the old version.

To fully prevent upgrading to a new kernel for which there is no
_gasket-driver_ (which would prevent Frigate from starting after the
reboot), we need to add a `Conflicts` tag.  This will not allow RPM to
install a version of _kernel_ newer than the one that matches
_gasket-driver_.
2025-11-22 10:19:07 -06:00
63d4723e8b ci: Add generic webhook trigger
This will allow `updatecheck` to trigger builds by sending an HTTP POST
request when it finds an update for the _kernel_ package.
2025-11-22 10:19:07 -06:00
1a3a502213 Include kernel version in release tag
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
This will allow `dnf` to automatically upgrade the package when a new
build is published for a new kernel release.
2025-11-16 09:30:18 -06:00
5a6e882d45 ci: Fetch sources from local mirror
I've created a mirror of the _gasket-driver_ Git repository, to ensure
it remains available, even if Google decides to remove it or GitHub is
temporarily unavailable.
2025-11-16 09:30:18 -06:00
663a2976ad ci: Publish RPMs to dch Yum repo 2025-11-16 09:30:12 -06:00
7f673e3b5a ci: Sign RPMs 2025-11-16 09:29:52 -06:00
2b7954bb52 ci: Sign the kernel modules
It turns out, everything is already in place to enable kernel module
signing.  All that's necessary is to provide a certificate and private
key at the correct path; if those are present, the modules files will be
signed during `modules_install`.
2025-11-16 09:26:45 -06:00
cdc38a9f5a ci: Begin Jenkins pipeline 2025-11-16 09:26:41 -06:00
7 changed files with 213 additions and 3 deletions

89
ci/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,89 @@
@Library('dch')_
properties([
pipelineTriggers([
GenericTrigger(
causeString: 'Webhook Trigger',
genericVariables: [[
key: 'nvr',
value: '$[*].builds[*].nvr',
]],
printContributedVariables: true,
printPostContent: true,
regexpFilterExpression: 'kernel-.*',
regexpFilterText: '$nvr',
silentResponse: true,
tokenCredentialId: 'webhook-trigger',
)
])
])
try {
fedoraBuild(
architectures: ['amd64'],
podTemplate: 'ci/podTemplate.yaml',
buildContainer: 'fedora',
) { arch, fedoraVersion ->
stage("Prepare f${fedoraVersion}/${arch}") {
checkout scm
container('fedora') {
sh '. ci/prepare.sh'
}
}
stage("Build f${fedoraVersion}/${arch}") {
withCredentials([file(
credentialsId: 'kmod-signing-cert',
variable: 'SIGNING_KEY',
)]) {
container('fedora') {
sh '. ci/build.sh'
}
}
}
stage("Sign f${fedoraVersion}/${arch}") {
when(BRANCH_NAME == 'main') {
withEnv([
"GNUPGHOME=${env.WORKSPACE_TMP}/gnupg",
]) {
withCredentials([
file(
credentialsId: 'rpm-gpg-key',
variable: 'RPM_GPG_PRIVATE_KEY',
),
file(
credentialsId: 'rpm-gpg-key-passphrase',
variable: 'RPM_GPG_KEY_PASSPHRASE',
),
]) {
container('fedora') {
sh '. ci/sign.sh'
}
}
}
}
}
archiveArtifacts '*.rpm'
stage("Publish f${fedoraVersion}/${arch}") {
when(BRANCH_NAME == 'main') {
container('fedora') {
sshagent(['jenkins-repohost']) {
sh '. ci/publish.sh'
}
}
}
}
}
} catch (ex) {
currentBuild.result = 'FAILED'
emailext(
to: 'gyrfalcon@ebonfire.com',
subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
)
throw ex
}

35
ci/build.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
if [ $(id -u) -eq 0 ]; then
kver=$(rpm -q --qf %{VERSION}-%{RELEASE}.%{ARCH} kernel-devel)
ln -s "${SIGNING_KEY}" /usr/src/kernels/${kver}/certs/signing_key.x509
ln -s "${SIGNING_KEY}" /usr/src/kernels/${kver}/certs/signing_key.pem
exec setpriv --clear-groups --reuid 1000 --regid 1000 --inh-caps=-all \
sh -ex ci/build.sh
fi
git_rev=$(
sed -nr '/^%global git_revision_full/s/.* ([a-z0-9]{40})$/\1/p' \
gasket-driver.spec
)
curl -fL \
-o gasket-driver-${git_rev}.tar.gz \
https://git.pyrocufflink.net/dustin/gasket-driver/archive/${git_rev}.tar.gz
# We're downloading the archive from our local mirror of upstream's repository,
# just in case it goes away or becomes unavailable. Unfortunately, Gitea
# creates a slightly different archive layout than GitHub, so we need to fix it
# up before passing it to `rpmbuild`.
rm -rf src
mkdir src
tar -xzf gasket-driver-${git_rev}.tar.gz -C src
mv src/gasket-driver src/gasket-driver-${git_rev}
tar -cf gasket-driver-${git_rev}.tar.gz -C src gasket-driver-${git_rev}
rpmbuild \
-D "_topdir ${PWD}" \
-D '_sourcedir %{_topdir}' \
-ba gasket-driver.spec
ln RPMS/*/*.rpm SRPMS/*.rpm .

24
ci/podTemplate.yaml Normal file
View File

@@ -0,0 +1,24 @@
spec:
containers:
- name: fedora
command:
- cat
stdin: true
tty: true
resources:
requests:
cpu: 1500m
securityContext:
runAsUser: 0
runAsGroup: 0
volumeMounts:
- mountPath: /etc/ssh/ssh_known_hosts
name: ssh-known-hosts
subPath: ssh_known_hosts
hostUsers: false
nodeSelector:
du5t1n.me/jenkins:
volumes:
- name: ssh-known-hosts
configMap:
name: ssh-known-hosts

10
ci/prepare.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
xargs dnf install -y --setopt install_weak_deps=0 <<EOF
kernel-devel
openssh-clients
rpm-build
rpm-sign
rsync
util-linux
EOF

22
ci/publish.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
ARCH="$(uname -m)"
REPO_HOST=jenkins@files.pyrocufflink.blue
REPO_PATH=/srv/www/repohost/repos/dch/fedora/$(rpm --eval %fedora)
case "${ARCH}" in
x86_64)
# only include the SRPM once
include='*.rpm'
;;
*)
include="*.${ARCH}.rpm"
;;
esac
rsync -rtiO \
--chmod=ugo=rwX \
--include "${include}" \
--exclude '*' \
./ \
"${REPO_HOST}:${REPO_PATH}/"

21
ci/sign.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
if [ $(id -u) -eq 0 ]; then
exec setpriv --clear-groups --reuid 1000 --regid 1000 --inh-caps=-all \
sh -ex ci/sign.sh
fi
install -m u=rwx,go= -d "${GNUPGHOME}"
cat > "${GNUPGHOME}"/gpg-agent.conf <<EOF
allow-loopback-pinentry
EOF
gpg2 --pinentry-mode loopback --passphrase-fd 0 \
--import "${RPM_GPG_PRIVATE_KEY}" \
< "${RPM_GPG_KEY_PASSPHRASE}"
rpmsign --addsign \
-D '_gpg_name jenkins@pyrocufflink.net' \
-D '_gpg_sign_cmd_extra_args --pinentry-mode loopback --passphrase-fd 3' \
*.rpm \
3< "${RPM_GPG_KEY_PASSPHRASE}"

View File

@@ -1,13 +1,15 @@
%global git_revision 5815ee3
%global git_revision_full 5815ee3908a46a415aac616ac7b9aedcb98a504c
%global kernel_ver %(rpm -q --qf %{VERSION}-%{RELEASE} kernel-devel)
%global kernel_version %(rpm -q --qf %{VERSION} kernel-devel)
%global kernel_release %(rpm -q --qf %{RELEASE} kernel-devel)
%global kernel_ver %{kernel_version}-%{kernel_release}
%define _debugsource_template %{nil}
Name: gasket-driver
Version: 0.0.git%{git_revision}
Release: 1
Release: 5.k%{kernel_version}%{?dist}
Summary: The Coral Gasket Driver allows usage of the Coral EdgeTPU on Linux systems
License: GPL-2.0
@@ -17,7 +19,8 @@ Patch0: 0001-core-Omit-no_llseek-reference.patch
Patch1: 0002-Update-gasket_page_table.c-Fix-MODULE_IMPORT_NS.patch
BuildRequires: kernel-devel
Requires: kernel-core == %{kernel_ver}
Provides: installonlypkg(kernel-module)
Requires: kernel-core == %{kernel_version}
Requires(post): kmod
%description
@@ -47,5 +50,11 @@ depmod -a %{kernel_ver}.%{_arch}
%changelog
* Sun Nov 23 2025 Dustin C. Hatch <dustin@hatch.name> [0.0.git5815ee3-4]
- Provide installonlypkg(kernel-module)
* Sun Nov 16 2025 Dustin C. Hatch <dustin@hatch.name> [0.0.git5815ee3-2]
- Include kernel version in release tag
* Wed Aug 06 2025 Dustin C. Hatch <dustin@hatch.name> [0.0.git5815ee3-1]
- Initial package