Skip to content

Commit

Permalink
feat: Add new ublue-os/akmod copr repo
Browse files Browse the repository at this point in the history
fix: Restore steamdeck and gcadapter_oc akmods
  • Loading branch information
KyleGospo committed Jul 17, 2023
1 parent 14a10b1 commit b2c0452
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ COPY build*.sh /tmp
COPY certs /tmp/certs
COPY ublue-os-akmods-addons.spec /tmp/ublue-os-akmods-addons/ublue-os-akmods-addons.spec

ADD https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/repo/fedora-${FEDORA_MAJOR_VERSION}/ublue-os-akmods-fedora-${FEDORA_MAJOR_VERSION}.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo

ADD https://negativo17.org/repos/fedora-steam.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-steam.repo

Expand All @@ -18,6 +21,8 @@ RUN /tmp/build-ublue-os-akmods-addons.sh

RUN /tmp/build-kmod-v4l2loopback.sh
RUN /tmp/build-kmod-xpadneo.sh
RUN /tmp/build-kmod-steamdeck.sh
RUN /tmp/build-kmod-gcadapter_oc.sh

RUN mkdir -p /var/cache/rpms/{kmods,ublue-os}
RUN cp /tmp/ublue-os-akmods-addons/rpmbuild/RPMS/noarch/ublue-os-akmods-addons*.rpm \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The rpmfusion and extra repos provide dependencies which are required by the kmo
Feel free to PR more kmod build scripts into this repo!

- ublue-os-akmods-addons - installs extra repos and our kmods signing key; install and import to allow SecureBoot systems to use these kmods
- [gcadapter_oc](https://github.com/hannesmann/gcadapter-oc-kmod) - kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter (akmod from [copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [steamdeck](https://lkml.org/lkml/2022/2/5/391) - platform driver for Valve's Steam Deck handheld PC (akmod from [copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [v4l2loopback](https://github.com/umlaeute/v4l2loopback) - allows creating "virtual video devices"
- [xpadneo](https://github.com/atar-axis/xpadneo) - xbox one controller bluetooth driver (akmod from [negativo17 steam repo](https://negativo17.org/steam/)

Expand Down
17 changes: 17 additions & 0 deletions build-kmod-gcadapter_oc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -oeux pipefail

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

wget https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/repo/fedora-${RELEASE}/ublue-os-akmods-fedora-${RELEASE}.repo -O /etc/yum.repos.d/_copr_ublue-os-akmods.repo

rpm-ostree install \
akmod-gcadapter_oc-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod gcadapter_oc
modinfo /usr/lib/modules/${KERNEL}/extra/gcadapter_oc/gcadapter_oc.ko.xz > /dev/null \
|| (find /var/cache/akmods/gcadapter_oc/ -name \*.log -print -exec cat {} \; && exit 1)

rm -f /etc/yum.repos.d/_copr_ublue-os-akmods.repo
17 changes: 17 additions & 0 deletions build-kmod-steamdeck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -oeux pipefail

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

wget https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/repo/fedora-${RELEASE}/ublue-os-akmods-fedora-${RELEASE}.repo -O /etc/yum.repos.d/_copr_ublue-os-akmods.repo

rpm-ostree install \
akmod-steamdeck-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod steamdeck
modinfo /usr/lib/modules/${KERNEL}/extra/steamdeck/steamdeck.ko.xz > /dev/null \
|| (find /var/cache/akmods/steamdeck/ -name \*.log -print -exec cat {} \; && exit 1)

rm -f /etc/yum.repos.d/_copr_ublue-os-akmods.repo
14 changes: 11 additions & 3 deletions ublue-os-akmods-addons.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: ublue-os-akmods-addons
Version: 0.2
Version: 0.3
Release: 1%{?dist}
Summary: Signing key and repos for ublue os akmods

Expand All @@ -10,7 +10,8 @@ BuildArch: noarch
Supplements: mokutil policycoreutils

Source0: public_key.der
Source1: negativo17-fedora-steam.repo
Source1: _copr_ublue-os-akmods.repo
Source2: negativo17-fedora-steam.repo

%description
Adds the signing key for importing with mokutil to enable secure boot for kernel modules and repo files required to install akmod dependencies.
Expand All @@ -22,20 +23,27 @@ Adds the signing key for importing with mokutil to enable secure boot for kernel
%build
# Have different name for *.der in case kmodgenca is needed for creating more keys
install -Dm0644 %{SOURCE0} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
install -Dm0644 %{SOURCE1} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo
install -Dm0644 %{SOURCE1} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/_copr_ublue-os-akmods.repo
install -Dm0644 %{SOURCE2} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo

sed -i 's@enabled=1@enabled=0@g' %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo

install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der %{buildroot}%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/_copr_ublue-os-akmods.repo %{buildroot}%{_sysconfdir}/yum.repos.d/_copr_ublue-os-akmods.repo
install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo %{buildroot}%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo

%files
%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/_copr_ublue-os-akmods.repo
%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo
%attr(0644,root,root) %{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
%attr(0644,root,root) %{_sysconfdir}/yum.repos.d/_copr_ublue-os-akmods.repo
%attr(0644,root,root) %{_sysconfdir}/yum.repos.d/negativo17-fedora-steam.repo

%changelog
* Mon Jul 17 2023 Kyle Gospodnetich <me@kylegospodneti.ch> - 0.3
- Add ublue-os/akmods copr repo for modules not available upstream/elsewhere

* Tue May 30 2023 Benjamin Sherman <benjamin@holyarmy.org> - 0.2
- Add negativo17 fedora-steam repo to enable xbox controllers

Expand Down

0 comments on commit b2c0452

Please sign in to comment.