Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Rok CDEmu for including vhba kmod #165

Merged
merged 16 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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://copr.fedorainfracloud.org/coprs/rok/cdemu/repo/fedora-${FEDORA_MAJOR_VERSION}/rok-cdemu-fedora-${FEDORA_MAJOR_VERSION}.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_rok-cdemu.repo
ADD https://negativo17.org/repos/fedora-multimedia.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo

Expand Down Expand Up @@ -49,6 +51,7 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
/tmp/build-kmod-rtl8814au.sh && \
/tmp/build-kmod-rtl88xxau.sh && \
/tmp/build-kmod-v4l2loopback.sh && \
/tmp/build-kmod-vhba.sh && \
/tmp/build-kmod-VirtualBox.sh && \
/tmp/build-kmod-wl.sh && \
/tmp/build-kmod-xpadneo.sh && \
Expand Down
24 changes: 24 additions & 0 deletions build-kmod-vhba.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -oeux pipefail


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

if [[ "$RELEASE" -lt 39 ]]; then
echo "SKIPPED BUILD of vhba on Fedora $RELEASE"
exit 0
fi

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_rok-cdemu.repo /etc/yum.repos.d/

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

rm -f /etc/yum.repos.d/_copr_rok-cdemu.repo
15 changes: 12 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.4
Version: 0.5
Release: 1%{?dist}
Summary: Signing key and repos for ublue os akmods

Expand All @@ -11,7 +11,8 @@ Supplements: mokutil policycoreutils

Source0: public_key.der
Source1: _copr_ublue-os-akmods.repo
Source2: negativo17-fedora-multimedia.repo
Source2: _copr_rok-cdemu.repo
Source3: negativo17-fedora-multimedia.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 @@ -24,23 +25,31 @@ Adds the signing key for importing with mokutil to enable secure boot for kernel
# 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/_copr_ublue-os-akmods.repo
install -Dm0644 %{SOURCE2} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.repo
install -Dm0644 %{SOURCE2} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/_copr_rok-cdemu.repo
install -Dm0644 %{SOURCE3} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.repo

sed -i 's@enabled=1@enabled=0@g' %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.repo
sed -i 's@enabled=1@enabled=0@g' %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/_copr_rok-cdemu.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/_copr_rok-cdemu.repo %{buildroot}%{_sysconfdir}/yum.repos.d/_copr_rok-cdemu.repo
install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.repo %{buildroot}%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.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/_copr_rok-cdemu.repo
%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.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/_copr_rok-cdemu.repo
%attr(0644,root,root) %{_sysconfdir}/yum.repos.d/negativo17-fedora-multimedia.repo

%changelog
* Mon Apr 22 2024 Marco Rodolfi <marco.rodolfi@tuta.io> - 0.5
- Add rok/cdemu copr repo for vhba kmod support

* Mon Nov 20 2023 RJ Trujillo <eyecantcu@pm.me> - 0.4
- Migrate xpadneo/xone modules from negativo17 fedora-steam to negativo17 fedora-multimedia

Expand Down
Loading