Skip to content

Commit

Permalink
feat: add xbox controller kmods
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman committed May 30, 2023
1 parent b21dd76 commit b35d0fd
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ RUN /tmp/build-ublue-os-akmods-key.sh

RUN /tmp/build-kmod-v4l2loopback.sh
RUN /tmp/build-kmod-wl.sh
RUN /tmp/build-kmod-xone.sh
RUN /tmp/build-kmod-xpadneo.sh

RUN mkdir /var/cache/rpms && \
for RPM in $(find /var/cache/akmods/ -type f -name \*.rpm); do \
Expand All @@ -23,6 +25,10 @@ RUN mkdir /var/cache/rpms && \
done && \
cp /tmp/ublue-os-akmods-key/rpmbuild/RPMS/noarch/ublue-os-akmods-key*.rpm /var/cache/rpms/

RUN find /var/cache/repos
RUN find /var/cache/rpms

FROM scratch

COPY --from=builder /var/cache/repos /repos
COPY --from=builder /var/cache/rpms /rpms
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ A layer for adding extra kernel modules to your image. Use for better hardware s

Add this to your Containerfile to install all the RPM packages, replacing `RELEASE` with either `37` or `38`:

COPY --from=ghcr.io/ublue-os/akmods:RELEASE /repos/ /etc/yum.repos.d/
COPY --from=ghcr.io/ublue-os/akmods:RELEASE /rpms/ /tmp/rpms
RUN rpm-ostree install /tmp/rpms/*.rpm

It is also required that rpmfusion repos are installed and available to provide dependencies for these kmod RPMs.
This example shows copying/enabling any custom repos from `akmods` into the target environment, but building also requires that rpmfusion repos are installed and available to provide dependencies for these kmod RPMs.

# Features

Feel free to PR more kmod build scripts into this repo!

- ublue-os-akmods-key - installs our kmods signing key; install and import to allow SecureBoot systems to use these kmods
- [v4l2loopback](https://github.com/umlaeute/v4l2loopback) - allows creating "virtual video devices"
- [broadcom-wl](https://github.com/rpmfusion/broadcom-wl/) - support for some legacy broadcom wifi devices
- [wl (broadcom)](https://github.com/rpmfusion/broadcom-wl/) - support for some legacy broadcom wifi devices
- [xone](https://github.com/medusalix/xone) - xbox one controller USB wired/RF driver (akmod from [negativo17 steam repo](https://negativo17.org/steam/)
- [xpadneo](https://github.com/atar-axis/xpadneo) - xbox one controller bluetooth driver (akmod from [negativo17 steam repo](https://negativo17.org/steam/)

# Adding kmods

If you have a kmod you want to contribute send a pull request by adding a script using [build-kmod-v4l2loopback.sh](https://github.com/ublue-os/akmods/blob/main/build-kmod-v4l2loopback.sh) as an example.
If you have a kmod you want to contribute send a pull request by adding a script using [build-kmod-wl.sh](https://github.com/ublue-os/akmods/blob/main/build-kmod-wl.sh) as an example.

# Verification

Expand Down
2 changes: 1 addition & 1 deletion build-kmod-v4l2loopback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RELEASE="$(rpm -E '%fedora')"
### BUILD v4l2loopbak (succeed or fail-fast with debug output)
rpm-ostree install \
akmod-v4l2loopback-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod "v4l2loopback"
akmods --force --kernels "${KERNEL}" --kmod v4l2loopback
modinfo /usr/lib/modules/${KERNEL}/extra/v4l2loopback/v4l2loopback.ko.xz > /dev/null \
|| (find /var/cache/akmods/v4l2loopback/ -name \*.log -print -exec cat {} \; && exit 1)
23 changes: 23 additions & 0 deletions build-kmod-xone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -oeux pipefail

mkdir -p /var/cache/repos

wget https://negativo17.org/repos/fedora-steam.repo -O /var/cache/repos/fedora-steam.repo

cp /var/cache/repos/fedora-steam.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


### BUILD xone (succeed or fail-fast with debug output)
rpm-ostree install \
akmod-xone-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod xone
modinfo /usr/lib/modules/${KERNEL}/extra/xone/xone-{dongle,gip-chatpad,gip-gamepad,gip-guitar,gip-headset,gip,wired}.ko.xz > /dev/null \
|| (find /var/cache/akmods/xone/ -name \*.log -print -exec cat {} \; && exit 1)

rm -f /etc/yum.repos.d/fedora-steam.repo
23 changes: 23 additions & 0 deletions build-kmod-xpadneo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -oeux pipefail

mkdir -p /var/cache/repos

wget https://negativo17.org/repos/fedora-steam.repo -O /var/cache/repos/fedora-steam.repo

cp /var/cache/repos/fedora-steam.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


### BUILD xpadneo (succeed or fail-fast with debug output)
rpm-ostree install \
akmod-xpadneo-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod xpadneo
modinfo /usr/lib/modules/${KERNEL}/extra/xpadneo/hid-xpadneo.ko.xz > /dev/null \
|| (find /var/cache/akmods/xpadneo/ -name \*.log -print -exec cat {} \; && exit 1)

rm -f /etc/yum.repos.d/fedora-steam.repo

0 comments on commit b35d0fd

Please sign in to comment.