From da575b2a0a02ef84f037e8fea6e02f573021dc60 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Fri, 19 Jan 2024 22:56:51 -0800 Subject: [PATCH] feat: Add bmi260 kmod, used for gyro input on various handheld PCs --- Containerfile.common | 1 + README.md | 1 + build-kmod-bmi260.sh | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100755 build-kmod-bmi260.sh diff --git a/Containerfile.common b/Containerfile.common index b80030e9..951e6b5d 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -41,6 +41,7 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \ /tmp/build-kmod-openrgb.sh && \ /tmp/build-kmod-steamdeck.sh \ ; fi && \ + /tmp/build-kmod-bmi260.sh && \ /tmp/build-kmod-gasket.sh && \ /tmp/build-kmod-gcadapter_oc.sh && \ /tmp/build-kmod-nct6687d.sh && \ diff --git a/README.md b/README.md index 3bb6c4ee..40e07c03 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Feel free to PR more kmod build scripts into this repo! - ublue-os-nvidia-addons - installs extra repos enabling our nvidia support - [nvidia container selinux policy](https://github.com/NVIDIA/dgx-selinux/tree/master/src/nvidia-container-selinux) - uses RHEL9 policy as the closest match - [nvidia-container-tookkit repo](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-yum-or-dnf) - version 1.14 (and newer) provide CDI for podman use of nvidia gpus +- [bmi260](https://github.com/hhd-dev/bmi260) - kernel module driver for the Bosch BMI260 IMU (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/)) - [evdi](www.displaylink.com) - kernel module required for use of displaylink (akmod from [negativo17 multimedia repo](https://negativo17.org/multimedia/) - [gasket/apex](https://github.com/google/gasket-driver) - kernel module for Coral Gasket Driver, allowing usage of the Coral EdgeTPU on Linux systems (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/)) - [gcadapter_oc](https://github.com/hannesmann/gcadapter-oc-kmod) - kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/)) diff --git a/build-kmod-bmi260.sh b/build-kmod-bmi260.sh new file mode 100755 index 00000000..bed47b6d --- /dev/null +++ b/build-kmod-bmi260.sh @@ -0,0 +1,17 @@ +#!/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_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" +RELEASE="$(rpm -E '%fedora')" + +rpm-ostree install \ + akmod-bmi260-*.fc${RELEASE}.${ARCH} +akmods --force --kernels "${KERNEL}" --kmod bmi260 +modinfo /usr/lib/modules/${KERNEL}/extra/bmi260/bmi260_{core,i2c}.ko.xz > /dev/null \ +|| (find /var/cache/akmods/bmi260/ -name \*.log -print -exec cat {} \; && exit 1) + +rm -f /etc/yum.repos.d/_copr_ublue-os-akmods.repo