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
Oh man, what a mess
  • Loading branch information
EyeCantCU committed Sep 26, 2023
1 parent cd2f11d commit 69847cb
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 31 deletions.
35 changes: 19 additions & 16 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,25 @@ 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

# Exclude negativo17 kmods from Fedora 39
RUN if grep -qv "39" <<< ${FEDORA_MAJOR_VERSION}; then \
/tmp/build-kmod-evdi.sh && \
/tmp/build-kmod-xpadneo.sh && \
/tmp/build-kmod-xpad-noone.sh && \
/tmp/build-kmod-xone.sh \
RUN if [[ "${KERNEL_FLAVOR}" != "surface" ]]; then \
KERNEL_NAME="kernel" \
; else \
KERNEL_NAME="kernel-surface" \
; fi && \
/tmp/build-kmod-gasket.sh ${KERNEL_NAME} && \
/tmp/build-kmod-gcadapter_oc.sh ${KERNEL_NAME} && \
/tmp/build-kmod-nct6687d.sh ${KERNEL_NAME} && \
/tmp/build-kmod-openrazer.sh ${KERNEL_NAME} && \
/tmp/build-kmod-openrgb.sh ${KERNEL_NAME} && \
/tmp/build-kmod-ryzen-smu.sh ${KERNEL_NAME} && \
/tmp/build-kmod-steamdeck.sh ${KERNEL_NAME} && \
/tmp/build-kmod-v4l2loopback.sh ${KERNEL_NAME} && \
/tmp/build-kmod-wl.sh ${KERNEL_NAME} && \
if grep -qv "39" <<< ${FEDORA_MAJOR_VERSION}; then \
/tmp/build-kmod-evdi.sh ${KERNEL_NAME} && \
/tmp/build-kmod-xpadneo.sh ${KERNEL_NAME} && \
/tmp/build-kmod-xpad-noone.sh ${KERNEL_NAME} && \
/tmp/build-kmod-xone.sh ${KERNEL_NAME} \
; fi

RUN cp /tmp/ublue-os-akmods-addons/rpmbuild/RPMS/noarch/ublue-os-akmods-addons*.rpm \
Expand Down
7 changes: 6 additions & 1 deletion Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 [[ "${KERNEL_FLAVOR}" != "surface" ]]; then \
KERNEL_NAME="kernel" \
; else \
KERNEL_NAME="kernel-surface" \
; fi && \
/tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION} ${KERNEL_NAME}

RUN cp /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons*.rpm \
/var/cache/rpms/ublue-os/
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-evdi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-gasket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

rpm-ostree install \
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-gcadapter_oc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

rpm-ostree install \
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-nct6687d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
4 changes: 3 additions & 1 deletion build-kmod-nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ 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_NAME="$2"
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 All @@ -35,6 +36,7 @@ modinfo /usr/lib/modules/${KERNEL_VERSION}/extra/${NVIDIA_PACKAGE_NAME}/nvidia{,
(cat /var/cache/akmods/${NVIDIA_PACKAGE_NAME}/${NVIDIA_AKMOD_VERSION}-for-${KERNEL_VERSION}.failed.log && exit 1)

cat <<EOF > /var/cache/rpms/kmods/nvidia-vars.${NVIDIA_MAJOR_VERSION}
KERNEL_NAME="$1"
KERNEL_VERSION=${KERNEL_VERSION}
RELEASE=${RELEASE}
NVIDIA_PACKAGE_NAME=${NVIDIA_PACKAGE_NAME}
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-openrazer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-openrgb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

rpm-ostree install \
Expand Down
3 changes: 2 additions & 1 deletion build-kmod-ryzen-smu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-steamdeck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

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


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


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


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


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-xone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-xpad-noone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down
3 changes: 2 additions & 1 deletion build-kmod-xpadneo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ 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_NAME="$1"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"


Expand Down

0 comments on commit 69847cb

Please sign in to comment.