Skip to content

Commit

Permalink
feat: bundle akmods into resulting image
Browse files Browse the repository at this point in the history
  • Loading branch information
antheas committed Oct 19, 2024
1 parent 749b769 commit 0501278
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 22 deletions.
4 changes: 3 additions & 1 deletion build-kmod-VirtualBox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"


### BUILD VirtualBox (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-VirtualBox-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-VirtualBox-*.rpm
akmods --force --kernels "${KERNEL}" --kmod VirtualBox
modinfo /usr/lib/modules/${KERNEL}/extra/VirtualBox/{vboxdrv,vboxnetadp,vboxnetflt}.ko.xz > /dev/null \
|| (find /var/cache/akmods/VirtualBox/ -name \*.log -print -exec cat {} \; && exit 1)
4 changes: 3 additions & 1 deletion build-kmod-ayaneo-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-ayaneo-platform-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-ayaneo-platform-*.rpm
akmods --force --kernels "${KERNEL}" --kmod ayaneo-platform
modinfo /usr/lib/modules/${KERNEL}/extra/ayaneo-platform/ayaneo-platform.ko.xz > /dev/null \
|| (find /var/cache/akmods/ayaneo-platform/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-ayn-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-ayn-platform-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-ayn-platform-*.rpm
akmods --force --kernels "${KERNEL}" --kmod ayn-platform
modinfo /usr/lib/modules/${KERNEL}/extra/ayn-platform/ayn-platform.ko.xz > /dev/null \
|| (find /var/cache/akmods/ayn-platform/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-bmi260.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-bmi260-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-bmi260-*.rpm
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)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-evdi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ set -e pipefail

### BUILD evdi (succeed or fail-fast with debug output)
export CFLAGS="-fno-pie -no-pie"
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
kmod-evdi*.fc"${RELEASE}.${ARCH}" akmod-evdi-*.fc"${RELEASE}.${ARCH}"
dnf install -y \
/var/cache/rpms/akmods/kmod-evdi*.rpm /var/cache/rpms/akmods/akmod-evdi-*.rpm
akmods --force --kernels "${KERNEL}" --kmod evdi
modinfo /usr/lib/modules/"${KERNEL}"/extra/evdi/evdi.ko.xz >/dev/null ||
(find /var/cache/akmods/evdi/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-facetimehd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ curl -LsSf -o /etc/yum.repos.d/_copr_mulderje-facetimehd-kmod.repo \
"https://copr.fedorainfracloud.org/coprs/mulderje/facetimehd-kmod/repo/fedora-${COPR_RELEASE}/mulderje-facetimehd-kmod-fedora-${COPR_RELEASE}.repo"

### BUILD facetimehd (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-facetimehd-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-facetimehd-*.rpm
akmods --force --kernels "${KERNEL}" --kmod facetimehd
modinfo "/usr/lib/modules/${KERNEL}/extra/facetimehd/facetimehd.ko.xz" > /dev/null \
|| (find /var/cache/akmods/facetimehd/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-gcadapter_oc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-gcadapter_oc-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-gcadapter_oc-*.rpm
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)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-kvmfr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ fi
curl -LsSf -o /etc/yum.repos.d/_copr_hikariknight-looking-glass-kvmfr.repo "https://copr.fedorainfracloud.org/coprs/hikariknight/looking-glass-kvmfr/repo/fedora-${COPR_RELEASE}/hikariknight-looking-glass-kvmfr-fedora-${COPR_RELEASE}.repo"

### BUILD kvmfr (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
"akmod-kvmfr-*.fc${RELEASE}.${ARCH}"
dnf install -y \
/var/cache/rpms/akmods/akmod-kvmfr-*.rpm
akmods --force --kernels "${KERNEL}" --kmod kvmfr
modinfo "/usr/lib/modules/${KERNEL}/extra/kvmfr/kvmfr.ko.xz" > /dev/null \
|| (find /var/cache/akmods/kvmfr/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-nct6687d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RELEASE="$(rpm -E '%fedora')"
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

### BUILD nct6687d (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-nct6687d-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-nct6687d-*.rpm
akmods --force --kernels "${KERNEL}" --kmod nct6687d
modinfo /usr/lib/modules/${KERNEL}/extra/nct6687d/nct6687.ko.xz > /dev/null \
|| (find /var/cache/akmods/nct6687d/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ cd /tmp
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/rpmfusion-*.repo
cp /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/negativo17-fedora-nvidia.repo /etc/yum.repos.d/

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-nvidia*.fc${RELEASE}
dnf install -y \
/var/cache/rpms/akmods/akmod-nvidia*.rpm

# Either successfully build and install the kernel modules, or fail early with debug output
rpm -qa |grep nvidia
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-openrazer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RELEASE="$(rpm -E '%fedora')"
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

### BUILD openrazer (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-openrazer-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-openrazer-*.rpm
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)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-rtl8814au.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ fi

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-rtl8814au-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-rtl8814au-*.rpm
akmods --force --kernels "${KERNEL}" --kmod rtl8814au
modinfo /usr/lib/modules/${KERNEL}/extra/rtl8814au/rtl8814au.ko.xz > /dev/null \
|| (find /var/cache/akmods/rtl8814au/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-rtl88xxau.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ fi

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-rtl88xxau-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-rtl88xxau-*.rpm
akmods --force --kernels "${KERNEL}" --kmod rtl88xxau
modinfo /usr/lib/modules/${KERNEL}/extra/rtl88xxau/88XXau.ko.xz > /dev/null \
|| (find /var/cache/akmods/rtl88xxau/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-ryzen-smu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RELEASE="$(rpm -E '%fedora')"
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

### BUILD ryzen-smu (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-ryzen-smu-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-ryzen-smu-*.rpm
akmods --force --kernels "${KERNEL}" --kmod ryzen-smu
modinfo /usr/lib/modules/${KERNEL}/extra/ryzen-smu/ryzen_smu.ko.xz > /dev/null \
|| (find /var/cache/akmods/ryzen-smu/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-v4l2loopback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')
RELEASE="$(rpm -E '%fedora')"

### BUILD v4l2loopbak (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-v4l2loopback-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-v4l2loopback-*.rpm
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)
4 changes: 3 additions & 1 deletion build-kmod-vhba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ fi
curl -LsSf -o /etc/yum.repos.d/_copr_rok-cdemu.repo "https://copr.fedorainfracloud.org/coprs/rok/cdemu/repo/fedora-${COPR_RELEASE}/rok-cdemu-fedora-${COPR_RELEASE}.repo"

### BUILD vhba (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-vhba-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-vhba-*.rpm
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)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-wl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RELEASE="$(rpm -E '%fedora')"


### BUILD wl (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-wl-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-wl-*.rpm
akmods --force --kernels "${KERNEL}" --kmod wl
modinfo /usr/lib/modules/${KERNEL}/extra/wl/wl.ko.xz > /dev/null \
|| (find /var/cache/akmods/wl/ -name \*.log -print -exec cat {} \; && exit 1)
4 changes: 3 additions & 1 deletion build-kmod-xone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ RELEASE="$(rpm -E '%fedora')"
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

### BUILD xone (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-xone-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-xone-*.rpm
akmods --force --kernels "${KERNEL}" --kmod xone
modinfo /usr/lib/modules/${KERNEL}/extra/xone/xone-{dongle,gip,gip-gamepad,gip-headset,gip-chatpad,gip-madcatz-strat,gip-madcatz-glam,gip-pdp-jaguar}.ko.xz > /dev/null \
|| (find /var/cache/akmods/xone/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-xpadneo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ fi
set -e pipefail

### BUILD xpadneo (succeed or fail-fast with debug output)
dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-xpadneo-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-xpadneo-*.rpm
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)
Expand Down
4 changes: 3 additions & 1 deletion build-kmod-zenergy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ RELEASE="$(rpm -E '%fedora')"

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

dnf install -y \
dnf download -y --destdir /var/cache/rpms/akmods \
akmod-zenergy-*.fc${RELEASE}.${ARCH}
dnf install -y \
/var/cache/rpms/akmods/akmod-zenergy-*.rpm
akmods --force --kernels "${KERNEL}" --kmod zenergy
modinfo /usr/lib/modules/${KERNEL}/extra/zenergy/zenergy.ko.xz > /dev/null \
|| (find /var/cache/akmods/zenergy/ -name \*.log -print -exec cat {} \; && exit 1)
Expand Down
9 changes: 7 additions & 2 deletions build-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ fi
### PREPARE BUILD ENV
dnf install -y \
akmods \
mock
mock \
ruby-devel

# FPM is needed to rename akmods, gem provided by ruby-devel
gem install fpm


if [[ ! -s "/tmp/certs/private_key.priv" ]]; then
echo "WARNING: Using test signing key. Run './generate-akmods-key' for production builds."
Expand Down Expand Up @@ -93,4 +98,4 @@ fi
chmod 1777 /tmp /var/tmp

# create directories for later copying resulting artifacts
mkdir -p /var/cache/rpms/{kmods,ublue-os,ucore}
mkdir -p /var/cache/rpms/{akmods,kmods,ublue-os,ucore}

0 comments on commit 0501278

Please sign in to comment.