From 7008d635a7e9e1de4f0af0316c3c0cec7d89717d Mon Sep 17 00:00:00 2001 From: Jon Mulder Date: Sun, 31 Mar 2024 22:01:23 -0400 Subject: [PATCH] feat: add facetimehd-kmod to akmod cache This is the initial commit of the facetimehd firmware for the integrated camera for older macbook air models. --- Containerfile.common | 1 + build-kmod-facetimehd.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 build-kmod-facetimehd.sh diff --git a/Containerfile.common b/Containerfile.common index 755faee3..079e6545 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -46,6 +46,7 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \ /tmp/build-kmod-bmi160.sh && \ /tmp/build-kmod-bmi260.sh && \ /tmp/build-kmod-bmi323.sh && \ + /tmp/build-kmod-facetimehd.sh && \ /tmp/build-kmod-gcadapter_oc.sh && \ /tmp/build-kmod-nct6687d.sh && \ /tmp/build-kmod-openrazer.sh && \ diff --git a/build-kmod-facetimehd.sh b/build-kmod-facetimehd.sh new file mode 100755 index 00000000..438322c8 --- /dev/null +++ b/build-kmod-facetimehd.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -oeux pipefail + +ARCH="$(rpm -E '%_arch')" +KERNEL="$(rpm -q "${KERNEL_NAME:-kernel}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" +RELEASE="$(rpm -E '%fedora')" + +if [[ "${RELEASE}" -ge 40 ]]; then + COPR_RELEASE="rawhide" +else + COPR_RELEASE="${RELEASE}" +fi + +wget "https://copr.fedorainfracloud.org/coprs/mulderje/facetimehd-kmod/repo/fedora-${COPR_RELEASE}/mulderje-facetimehd-kmod-fedora-${COPR_RELEASE}.repo" -O /etc/yum.repos.d/_copr_mulderje-facetimehd-kmod.repo + +### BUILD facetimehd (succeed or fail-fast with debug output) +rpm-ostree install \ + "akmod-facetimehd-*.fc${RELEASE}.${ARCH}" \ + facetimehd-firmware +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) + +rm -f /etc/yum.repos.d/_copr_mulderje-facetimehd-kmod.repo