diff --git a/Containerfile.common b/Containerfile.common index 51466c34..15d4845e 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -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 \ diff --git a/Containerfile.nvidia b/Containerfile.nvidia index 48f57b0c..29d97d3a 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -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/ diff --git a/build-kmod-evdi.sh b/build-kmod-evdi.sh index c3f6f06c..a3853a15 100755 --- a/build-kmod-evdi.sh +++ b/build-kmod-evdi.sh @@ -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')" diff --git a/build-kmod-gasket.sh b/build-kmod-gasket.sh index 979a0657..48ee5b6d 100755 --- a/build-kmod-gasket.sh +++ b/build-kmod-gasket.sh @@ -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 \ diff --git a/build-kmod-gcadapter_oc.sh b/build-kmod-gcadapter_oc.sh index ac9792a1..f14ac45a 100755 --- a/build-kmod-gcadapter_oc.sh +++ b/build-kmod-gcadapter_oc.sh @@ -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 \ diff --git a/build-kmod-nct6687d.sh b/build-kmod-nct6687d.sh index 39e25c07..a9f2a4cf 100755 --- a/build-kmod-nct6687d.sh +++ b/build-kmod-nct6687d.sh @@ -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')" diff --git a/build-kmod-nvidia.sh b/build-kmod-nvidia.sh index 16f0399d..1acb1dce 100755 --- a/build-kmod-nvidia.sh +++ b/build-kmod-nvidia.sh @@ -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}')" @@ -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 < /var/cache/rpms/kmods/nvidia-vars.${NVIDIA_MAJOR_VERSION} +KERNEL_NAME="$1" KERNEL_VERSION=${KERNEL_VERSION} RELEASE=${RELEASE} NVIDIA_PACKAGE_NAME=${NVIDIA_PACKAGE_NAME} diff --git a/build-kmod-openrazer.sh b/build-kmod-openrazer.sh index c54ae849..a6e14021 100755 --- a/build-kmod-openrazer.sh +++ b/build-kmod-openrazer.sh @@ -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')" diff --git a/build-kmod-openrgb.sh b/build-kmod-openrgb.sh index 7f1207f0..62359394 100755 --- a/build-kmod-openrgb.sh +++ b/build-kmod-openrgb.sh @@ -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 \ diff --git a/build-kmod-ryzen-smu.sh b/build-kmod-ryzen-smu.sh index 1e930fd4..962211d1 100755 --- a/build-kmod-ryzen-smu.sh +++ b/build-kmod-ryzen-smu.sh @@ -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')" diff --git a/build-kmod-steamdeck.sh b/build-kmod-steamdeck.sh index 026cf02b..834bac47 100755 --- a/build-kmod-steamdeck.sh +++ b/build-kmod-steamdeck.sh @@ -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 \ diff --git a/build-kmod-v4l2loopback.sh b/build-kmod-v4l2loopback.sh index 7609b027..c3f97139 100755 --- a/build-kmod-v4l2loopback.sh +++ b/build-kmod-v4l2loopback.sh @@ -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')" diff --git a/build-kmod-wl.sh b/build-kmod-wl.sh index 1e7a6254..bd78e768 100755 --- a/build-kmod-wl.sh +++ b/build-kmod-wl.sh @@ -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')" diff --git a/build-kmod-xone.sh b/build-kmod-xone.sh index 0fe8aa72..d142c6b4 100755 --- a/build-kmod-xone.sh +++ b/build-kmod-xone.sh @@ -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')" diff --git a/build-kmod-xpad-noone.sh b/build-kmod-xpad-noone.sh index 78d83e49..66bf80b0 100755 --- a/build-kmod-xpad-noone.sh +++ b/build-kmod-xpad-noone.sh @@ -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')" diff --git a/build-kmod-xpadneo.sh b/build-kmod-xpadneo.sh index 145f4f53..0e9a12ed 100755 --- a/build-kmod-xpadneo.sh +++ b/build-kmod-xpadneo.sh @@ -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')"