From ca72977fdcb7f16624979ad5b66e4cc3610bf3a9 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Fri, 15 Sep 2023 23:32:54 -0700 Subject: [PATCH] feat: Add OpenRazer kmod Works by masquerading itself as the dkms package with a very high version number so the remaining openrazer packages can be layered as normal. Closes #5 --- Containerfile.common | 1 + build-kmod-openrazer.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 build-kmod-openrazer.sh diff --git a/Containerfile.common b/Containerfile.common index 412806a0..b9f9817f 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -29,6 +29,7 @@ RUN /tmp/build-ublue-os-akmods-addons.sh RUN /tmp/build-kmod-evdi.sh RUN /tmp/build-kmod-gasket.sh RUN /tmp/build-kmod-gcadapter_oc.sh +RUN /tmp/build-kmod-openrazer.sh RUN /tmp/build-kmod-openrgb.sh RUN /tmp/build-kmod-steamdeck.sh RUN /tmp/build-kmod-v4l2loopback.sh diff --git a/build-kmod-openrazer.sh b/build-kmod-openrazer.sh new file mode 100755 index 00000000..c54ae849 --- /dev/null +++ b/build-kmod-openrazer.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -oeux pipefail + +cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/ + +ARCH="$(rpm -E '%_arch')" +KERNEL="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" +RELEASE="$(rpm -E '%fedora')" + + +### BUILD openrazer (succeed or fail-fast with debug output) +rpm-ostree install \ + akmod-openrazer-*.fc${RELEASE}.${ARCH} +akmods --force --kernels "${KERNEL}" --kmod openrazer +modinfo /usr/lib/modules/${KERNEL}/extra/openrazer/razerkbd.ko.xz > /dev/null \ +|| (find /var/cache/akmods/openrazer/ -name \*.log -print -exec cat {} \; && exit 1) +modinfo /usr/lib/modules/${KERNEL}/extra/openrazer/razermouse.ko.xz > /dev/null \ +|| (find /var/cache/akmods/openrazer/ -name \*.log -print -exec cat {} \; && exit 1) +modinfo /usr/lib/modules/${KERNEL}/extra/openrazer/razerkraken.ko.xz > /dev/null \ +|| (find /var/cache/akmods/openrazer/ -name \*.log -print -exec cat {} \; && exit 1) +modinfo /usr/lib/modules/${KERNEL}/extra/openrazer/razeraccessory.ko.xz > /dev/null \ +|| (find /var/cache/akmods/openrazer/ -name \*.log -print -exec cat {} \; && exit 1) + +rm -f /etc/yum.repos.d/_copr_ublue-os-akmods.repo