Skip to content

Commit

Permalink
fix(surface): Query kernel-surface version instead of kernel version
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Sep 26, 2023
1 parent cd2f11d commit b32bfea
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 26 deletions.
28 changes: 17 additions & 11 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
ARG KERNEL_FLAVOR="{KERNEL_FLAVOR:-main}"
ARG KERNEL_NAME="kernel"

COPY build*.sh /tmp
COPY certs /tmp/certs
Expand All @@ -27,18 +28,23 @@ RUN /tmp/build-prep.sh

RUN /tmp/build-ublue-os-akmods-addons.sh

RUN /tmp/build-kmod-gasket.sh
RUN /tmp/build-kmod-gcadapter_oc.sh
RUN /tmp/build-kmod-nct6687d.sh
RUN /tmp/build-kmod-openrazer.sh
RUN /tmp/build-kmod-openrgb.sh
RUN /tmp/build-kmod-ryzen-smu.sh
RUN /tmp/build-kmod-steamdeck.sh
RUN /tmp/build-kmod-v4l2loopback.sh
RUN /tmp/build-kmod-wl.sh

# Set kernel name
# Exclude negativo17 kmods from Fedora 39
RUN if grep -qv "39" <<< ${FEDORA_MAJOR_VERSION}; then \
RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
KERNEL_NAME="kernel" \
; else \
KERNEL_NAME="kernel-surface" \
; fi && \
/tmp/build-kmod-gasket.sh && \
/tmp/build-kmod-gcadapter_oc.sh && \
/tmp/build-kmod-nct6687d.sh && \
/tmp/build-kmod-openrazer.sh && \
/tmp/build-kmod-openrgb.sh && \
/tmp/build-kmod-ryzen-smu.sh && \
/tmp/build-kmod-steamdeck.sh && \
/tmp/build-kmod-v4l2loopback.sh && \
/tmp/build-kmod-wl.sh && \
if grep -qv "39" <<< ${FEDORA_MAJOR_VERSION}; then \
/tmp/build-kmod-evdi.sh && \
/tmp/build-kmod-xpadneo.sh && \
/tmp/build-kmod-xpad-noone.sh && \
Expand Down
8 changes: 7 additions & 1 deletion Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-535}"
ARG KERNEL_FLAVOR="{KERNEL_FLAVOR:-main}"
ARG KERNEL_NAME="kernel"

COPY build*.sh /tmp
COPY certs /tmp/certs
Expand All @@ -32,7 +33,12 @@ RUN /tmp/build-prep.sh

RUN /tmp/build-ublue-os-nvidia-addons.sh

RUN /tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION}
RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
KERNEL_NAME="kernel" \
; else \
KERNEL_NAME="kernel-surface" \
; fi && \
/tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION}

RUN cp /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons*.rpm \
/var/cache/rpms/ublue-os/
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-evdi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-gasket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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

rpm-ostree install \
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-gcadapter_oc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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

rpm-ostree install \
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-nct6687d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda,devel,kmodsrc,power}*:${NVIDIA_MAJOR_VERSION}.*.fc${RELEASE}

# Either successfully build and install the kernel modules, or fail early with debug output
KERNEL_VERSION="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
KERNEL_VERSION="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
NVIDIA_AKMOD_VERSION="$(basename "$(rpm -q "akmod-${NVIDIA_PACKAGE_NAME}" --queryformat '%{VERSION}-%{RELEASE}')" ".fc${RELEASE%%.*}")"
NVIDIA_LIB_VERSION="$(basename "$(rpm -q "xorg-x11-drv-${NVIDIA_PACKAGE_NAME}" --queryformat '%{VERSION}-%{RELEASE}')" ".fc${RELEASE%%.*}")"
NVIDIA_FULL_VERSION="$(rpm -q "xorg-x11-drv-${NVIDIA_PACKAGE_NAME}" --queryformat '%{EPOCH}:%{VERSION}-%{RELEASE}.%{ARCH}')"
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-openrazer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-openrgb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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

rpm-ostree install \
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-ryzen-smu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-steamdeck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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

rpm-ostree install \
Expand Down
2 changes: 1 addition & 1 deletion build-kmod-v4l2loopback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -oeux pipefail


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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-wl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -oeux pipefail


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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-xone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-steam.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-xpad-noone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

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


Expand Down
2 changes: 1 addition & 1 deletion build-kmod-xpadneo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -oeux pipefail
cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-steam.repo /etc/yum.repos.d/

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


Expand Down

0 comments on commit b32bfea

Please sign in to comment.