ARG BASE_IMAGE=forge.in.quineglobal.com/quine-global-labs/aurora:stable
FROM ${BASE_IMAGE} AS kmod-builder
RUN set -eux; \
NVR="$(rpm -q kernel-core --qf '%{VERSION}-%{RELEASE}.%{ARCH}')"; \
VERSION="$(rpm -q kernel-core --qf '%{VERSION}')"; \
RELEASE="$(rpm -q kernel-core --qf '%{RELEASE}')"; \
ARCH="$(rpm -q kernel-core --qf '%{ARCH}')"; \
echo "Building snd-hda-codec-cs8409 against kernel ${NVR}"; \
dnf install -y gcc make elfutils-libelf-devel bc perl patch; \
dnf install -y "kernel-devel-${NVR}" \
|| dnf install -y "https://kojipkgs.fedoraproject.org/packages/kernel/${VERSION}/${RELEASE}/${ARCH}/kernel-devel-${NVR}.rpm"; \
echo "${NVR}" > /kernel-nvr.txt
COPY patches/snd-hda-codec-cs8409/vendor/ /usr/src/snd-hda-codec-cs8409/
COPY patches/snd-hda-codec-cs8409/0001-imac19-2-force-intmike-adc-nid-fallback.patch /tmp/
RUN set -eux; \
cd /usr/src/snd-hda-codec-cs8409; \
patch -p1 --fuzz=0 < /tmp/0001-imac19-2-force-intmike-adc-nid-fallback.patch; \
make KVER="$(cat /kernel-nvr.txt)"; \
mkdir -p /output; \
cp snd-hda-codec-cs8409.ko /output/
FROM ${BASE_IMAGE} AS kickoff-builder
COPY kickoff/CMakeLists.txt /tmp/kickoff/
RUN set -eux; \
v() { rpm -q --qf '%{VERSION}-%{RELEASE}' "$1"; }; \
devel=(cmake gcc-c++ extra-cmake-modules \
"libplasma-devel-$(v libplasma)" \
"qt6-qtbase-devel-$(v qt6-qtbase)" \
"qt6-qtdeclarative-devel-$(v qt6-qtdeclarative)"); \
for f in kcoreaddons kconfig kpackage kwindowsystem kservice ki18n kguiaddons knotifications; do \
devel+=("kf6-$f-devel-$(v "kf6-$f")"); \
done; \
dnf install -y --setopt=install_weak_deps=False "${devel[@]}"; \
V="$(rpm -q --qf '%{VERSION}' plasma-desktop)"; \
echo "Building Kickoff from quine-global-labs/plasma-desktop, branch quine-v${V}"; \
curl -fsSL --retry 3 -o /tmp/plasma-desktop.tar.gz \
"https://forge.in.quineglobal.com/quine-global-labs/plasma-desktop/archive/quine-v${V}.tar.gz" \
|| { echo "No branch quine-v${V} in quine-global-labs/plasma-desktop: the image moved to Plasma ${V}; its rebase workflow makes the branch, or failed to (check its Actions)" >&2; exit 1; }; \
mkdir -p /build-src; \
tar -xzf /tmp/plasma-desktop.tar.gz -C /build-src --strip-components=2 \
plasma-desktop/applets/kickoff; \
cp /tmp/kickoff/CMakeLists.txt /build-src/; \
cmake -S /build-src -B /build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr; \
cmake --build /build -j"$(nproc)"; \
DESTDIR=/out cmake --install /build --strip; \
ls -l /out/usr/lib64/qt6/plugins/plasma/applets/org.kde.plasma.kickoff.so
FROM ${BASE_IMAGE} AS final
COPY overlay/ /
RUN dnf install -y alsa-tools
COPY --from=kmod-builder /output/snd-hda-codec-cs8409.ko /tmp/snd-hda-codec-cs8409.ko
RUN set -eux; \
NVR="$(rpm -q kernel-core --qf '%{VERSION}-%{RELEASE}.%{ARCH}')"; \
mkdir -p "/usr/lib/modules/${NVR}/extra"; \
mv /tmp/snd-hda-codec-cs8409.ko "/usr/lib/modules/${NVR}/extra/snd-hda-codec-cs8409.ko"; \
depmod -a "${NVR}"
RUN dnf install -y \
--repofrompath=quine,https://forge.in.quineglobal.com/api/packages/quine-global-labs/rpm/quine \
--setopt=quine.gpgcheck=0 --setopt=quine.repo_gpgcheck=1 \
--setopt=quine.gpgkey=https://forge.in.quineglobal.com/api/packages/quine-global-labs/rpm/repository.key \
layer-wizard dnf-package-store swap-watchdog
COPY --from=kickoff-builder /out/usr/lib64/qt6/plugins/plasma/applets/org.kde.plasma.kickoff.so \
/usr/lib64/qt6/plugins/plasma/applets/org.kde.plasma.kickoff.so
RUN systemctl enable rpm-ostree-cleanup.timer cs8409-intmike-power-fixup.service \
quine-update-check.timer