From 40b56593d5f23340b525f431f3a82e329d482bc3 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Mon, 25 Sep 2023 18:13:47 -0500 Subject: [PATCH 01/11] fix: add missing asus copr This should fix the ASUS build but Surface is still not quite right. --- build-prep.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build-prep.sh b/build-prep.sh index 21f4cffa..b9223521 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -17,9 +17,6 @@ fi # enable RPMs with alternatives to create them in this image build mkdir -p /var/lib/alternatives -# allow simple `dnf install` style commands to work (in some spec scripts) -ln -s /usr/bin/rpm-ostree /usr/bin/dnf - # enable more repos rpm-ostree install \ https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \ @@ -37,7 +34,9 @@ fi ### PREPARE CUSTOM KERNEL SUPPORT if [[ "asus" == "${KERNEL_FLAVOR}" ]]; then - echo "Installing ASUS Kernel:" && \ + echo "Installing ASUS Kernel:" + wget https://copr.fedorainfracloud.org/coprs/lukenukem/asus-linux/repo/fedora-$(rpm -E %fedora)/lukenukem-asus-linux-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_lukenukem-asus-linux.repo && \ + wget https://copr.fedorainfracloud.org/coprs/lukenukem/asus-kernel/repo/fedora-$(rpm -E %fedora)/lukenukem-asus-kernel-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_lukenukem-asus-kernel.repo rpm-ostree cliwrap install-to-root / && \ rpm-ostree override replace \ --experimental \ @@ -46,16 +45,16 @@ if [[ "asus" == "${KERNEL_FLAVOR}" ]]; then kernel-core \ kernel-modules \ kernel-modules-core \ - kernel-modules-extra \ - kernel-uki-virt + kernel-modules-extra elif [[ "surface" == "${KERNEL_FLAVOR}" ]]; then - echo "Installing Surface Kernel:" && \ + echo "Installing Surface Kernel:" + # Add Linux Surface repo + wget https://pkg.surfacelinux.com/fedora/linux-surface.repo -P /etc/yum.repos.d wget https://github.com/linux-surface/linux-surface/releases/download/silverblue-20201215-1/kernel-20201215-1.x86_64.rpm -O \ - /tmp/surface-kernel.rpm && \ + /tmp/surface-kernel.rpm rpm-ostree cliwrap install-to-root / && \ rpm-ostree override replace /tmp/surface-kernel.rpm \ --remove kernel-core \ - --remove kernel-devel-matched \ --remove kernel-modules \ --remove kernel-modules-extra \ --install kernel-surface From 2a9187f75fd7726cbf5d10b53e7f2de29c272a70 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 18:18:30 -0600 Subject: [PATCH 02/11] chore(asus): Remove unused asus-linux repo when installing kernel --- build-prep.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build-prep.sh b/build-prep.sh index b9223521..f6f11869 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -35,9 +35,8 @@ fi ### PREPARE CUSTOM KERNEL SUPPORT if [[ "asus" == "${KERNEL_FLAVOR}" ]]; then echo "Installing ASUS Kernel:" - wget https://copr.fedorainfracloud.org/coprs/lukenukem/asus-linux/repo/fedora-$(rpm -E %fedora)/lukenukem-asus-linux-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_lukenukem-asus-linux.repo && \ wget https://copr.fedorainfracloud.org/coprs/lukenukem/asus-kernel/repo/fedora-$(rpm -E %fedora)/lukenukem-asus-kernel-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_lukenukem-asus-kernel.repo - rpm-ostree cliwrap install-to-root / && \ + rpm-ostree cliwrap install-to-root / rpm-ostree override replace \ --experimental \ --from repo=copr:copr.fedorainfracloud.org:lukenukem:asus-kernel \ @@ -52,7 +51,7 @@ elif [[ "surface" == "${KERNEL_FLAVOR}" ]]; then wget https://pkg.surfacelinux.com/fedora/linux-surface.repo -P /etc/yum.repos.d wget https://github.com/linux-surface/linux-surface/releases/download/silverblue-20201215-1/kernel-20201215-1.x86_64.rpm -O \ /tmp/surface-kernel.rpm - rpm-ostree cliwrap install-to-root / && \ + rpm-ostree cliwrap install-to-root / rpm-ostree override replace /tmp/surface-kernel.rpm \ --remove kernel-core \ --remove kernel-modules \ From cdb4fbabb4081cc292add1b05af31121b6a2b342 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 18:21:26 -0600 Subject: [PATCH 03/11] fix(surface): Attempt to fix kernel installation --- build-prep.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build-prep.sh b/build-prep.sh index f6f11869..92936a15 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -56,7 +56,11 @@ elif [[ "surface" == "${KERNEL_FLAVOR}" ]]; then --remove kernel-core \ --remove kernel-modules \ --remove kernel-modules-extra \ - --install kernel-surface + --install kernel-surface \ + --install kernel-surface-core \ + --install kernel-surface-modules \ + --install kernel-surface-modules-core \ + --install kernel-surface-modules-extra else echo "Default main kernel needs no customization." fi From b791b171029902fcbf47c26786a79bcf6f76e42e Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 18:34:13 -0600 Subject: [PATCH 04/11] fix: Install kernel devel (matched) --- build-prep.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-prep.sh b/build-prep.sh index 92936a15..5b90da81 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -42,6 +42,8 @@ if [[ "asus" == "${KERNEL_FLAVOR}" ]]; then --from repo=copr:copr.fedorainfracloud.org:lukenukem:asus-kernel \ kernel \ kernel-core \ + kernel-devel \ + kernel-devel-matched \ kernel-modules \ kernel-modules-core \ kernel-modules-extra @@ -58,6 +60,8 @@ elif [[ "surface" == "${KERNEL_FLAVOR}" ]]; then --remove kernel-modules-extra \ --install kernel-surface \ --install kernel-surface-core \ + --install kernel-surface-devel \ + --install kernel-surface-devel-matched \ --install kernel-surface-modules \ --install kernel-surface-modules-core \ --install kernel-surface-modules-extra From cb3cd61494c4b6070387ba81c1d53fd165b1eddf Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 18:39:20 -0600 Subject: [PATCH 05/11] fix(ci): Exclude Surface akmods for Fedora 39 for now --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1fe63e9..1a4137cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,8 @@ jobs: nvidia_version: 535 - cfile_suffix: nvidia nvidia_version: 0 + - kernel_flavor: surface + major_version: 39 steps: # Checkout push-to-registry action GitHub repository - name: Checkout Push to Registry action From bad986afa04eeaa9f9f70281183793d9b214f2d8 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 18:52:07 -0600 Subject: [PATCH 06/11] fix: Restore rpm-ostree -> dnf symlink for Fedora 37 only --- build-prep.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-prep.sh b/build-prep.sh index 5b90da81..e12c95ee 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -17,6 +17,11 @@ fi # enable RPMs with alternatives to create them in this image build mkdir -p /var/lib/alternatives +# allow simple `dnf install` style commands to work (in some spec scripts) +if [[ "${RELEASE}" -eq "37" ]]; then + ln -s /usr/bin/rpm-ostree /usr/bin/dnf +fi + # enable more repos rpm-ostree install \ https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \ From c0b680ff84e84867474d5de5e1f7a7d4d6ed2f0e Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 19:01:18 -0600 Subject: [PATCH 07/11] fix: Exclude ASUS and Surface akmods based on Fedora 37 --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a4137cb..85c5235e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,10 @@ jobs: nvidia_version: 535 - cfile_suffix: nvidia nvidia_version: 0 + - kernel_flavor: asus + major_version: 37 + - kernel_flavor: surface + major_version: 37 - kernel_flavor: surface major_version: 39 steps: From cd2f11dcdea4b44e941c823660f8a8eb7190e3e7 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 25 Sep 2023 20:32:41 -0600 Subject: [PATCH 08/11] fix(surface): Don't build Nvidia 470 kmods for Surface Every GPU supported by Surface devices still supports the latest driver --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85c5235e..640e3822 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,8 @@ jobs: major_version: 37 - kernel_flavor: surface major_version: 39 + - kernel_flavor: surface + nvidia_version: 470 steps: # Checkout push-to-registry action GitHub repository - name: Checkout Push to Registry action From b32bfeace20574aee398b4875b20429e8af870b0 Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Tue, 26 Sep 2023 10:08:13 -0600 Subject: [PATCH 09/11] fix(surface): Query kernel-surface version instead of kernel version --- Containerfile.common | 28 +++++++++++++++++----------- Containerfile.nvidia | 8 +++++++- build-kmod-evdi.sh | 2 +- build-kmod-gasket.sh | 2 +- build-kmod-gcadapter_oc.sh | 2 +- build-kmod-nct6687d.sh | 2 +- build-kmod-nvidia.sh | 2 +- build-kmod-openrazer.sh | 2 +- build-kmod-openrgb.sh | 2 +- build-kmod-ryzen-smu.sh | 2 +- build-kmod-steamdeck.sh | 2 +- build-kmod-v4l2loopback.sh | 2 +- build-kmod-wl.sh | 2 +- build-kmod-xone.sh | 2 +- build-kmod-xpad-noone.sh | 2 +- build-kmod-xpadneo.sh | 2 +- 16 files changed, 38 insertions(+), 26 deletions(-) diff --git a/Containerfile.common b/Containerfile.common index 51466c34..4e108727 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -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 @@ -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 && \ diff --git a/Containerfile.nvidia b/Containerfile.nvidia index 48f57b0c..ce283964 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -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 @@ -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/ diff --git a/build-kmod-evdi.sh b/build-kmod-evdi.sh index c3f6f06c..f206afa5 100755 --- a/build-kmod-evdi.sh +++ b/build-kmod-evdi.sh @@ -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')" diff --git a/build-kmod-gasket.sh b/build-kmod-gasket.sh index 979a0657..7a1254f9 100755 --- a/build-kmod-gasket.sh +++ b/build-kmod-gasket.sh @@ -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 \ diff --git a/build-kmod-gcadapter_oc.sh b/build-kmod-gcadapter_oc.sh index ac9792a1..d174a48b 100755 --- a/build-kmod-gcadapter_oc.sh +++ b/build-kmod-gcadapter_oc.sh @@ -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 \ diff --git a/build-kmod-nct6687d.sh b/build-kmod-nct6687d.sh index 39e25c07..9f1520bb 100755 --- a/build-kmod-nct6687d.sh +++ b/build-kmod-nct6687d.sh @@ -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')" diff --git a/build-kmod-nvidia.sh b/build-kmod-nvidia.sh index 16f0399d..2948701e 100755 --- a/build-kmod-nvidia.sh +++ b/build-kmod-nvidia.sh @@ -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}')" diff --git a/build-kmod-openrazer.sh b/build-kmod-openrazer.sh index c54ae849..b819ff0a 100755 --- a/build-kmod-openrazer.sh +++ b/build-kmod-openrazer.sh @@ -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')" diff --git a/build-kmod-openrgb.sh b/build-kmod-openrgb.sh index 7f1207f0..2120c23d 100755 --- a/build-kmod-openrgb.sh +++ b/build-kmod-openrgb.sh @@ -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 \ diff --git a/build-kmod-ryzen-smu.sh b/build-kmod-ryzen-smu.sh index 1e930fd4..ea5228c8 100755 --- a/build-kmod-ryzen-smu.sh +++ b/build-kmod-ryzen-smu.sh @@ -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')" diff --git a/build-kmod-steamdeck.sh b/build-kmod-steamdeck.sh index 026cf02b..00933774 100755 --- a/build-kmod-steamdeck.sh +++ b/build-kmod-steamdeck.sh @@ -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 \ diff --git a/build-kmod-v4l2loopback.sh b/build-kmod-v4l2loopback.sh index 7609b027..66cef2a8 100755 --- a/build-kmod-v4l2loopback.sh +++ b/build-kmod-v4l2loopback.sh @@ -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')" diff --git a/build-kmod-wl.sh b/build-kmod-wl.sh index 1e7a6254..6081b43c 100755 --- a/build-kmod-wl.sh +++ b/build-kmod-wl.sh @@ -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')" diff --git a/build-kmod-xone.sh b/build-kmod-xone.sh index 0fe8aa72..1c448143 100755 --- a/build-kmod-xone.sh +++ b/build-kmod-xone.sh @@ -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')" diff --git a/build-kmod-xpad-noone.sh b/build-kmod-xpad-noone.sh index 78d83e49..3f44ef03 100755 --- a/build-kmod-xpad-noone.sh +++ b/build-kmod-xpad-noone.sh @@ -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')" diff --git a/build-kmod-xpadneo.sh b/build-kmod-xpadneo.sh index 145f4f53..d2776d53 100755 --- a/build-kmod-xpadneo.sh +++ b/build-kmod-xpadneo.sh @@ -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')" From c6ad6edfbee5dde1540cf65df2fdfd96d460a931 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 26 Sep 2023 11:29:31 -0500 Subject: [PATCH 10/11] chore: build ARG KERNEL_NAME not required --- Containerfile.common | 1 - Containerfile.nvidia | 1 - 2 files changed, 2 deletions(-) diff --git a/Containerfile.common b/Containerfile.common index 4e108727..17be3983 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -10,7 +10,6 @@ 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 diff --git a/Containerfile.nvidia b/Containerfile.nvidia index ce283964..7307b3eb 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -11,7 +11,6 @@ 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 From bbf543bc7eba1e3d48d0109560928c1199cf53f7 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 26 Sep 2023 11:47:26 -0500 Subject: [PATCH 11/11] fix: export local KERNEL_NAME --- Containerfile.common | 4 ++-- Containerfile.nvidia | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Containerfile.common b/Containerfile.common index 17be3983..3ffce826 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -30,9 +30,9 @@ RUN /tmp/build-ublue-os-akmods-addons.sh # Set kernel name # Exclude negativo17 kmods from Fedora 39 RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \ - KERNEL_NAME="kernel" \ + export KERNEL_NAME="kernel" \ ; else \ - KERNEL_NAME="kernel-surface" \ + export KERNEL_NAME="kernel-surface" \ ; fi && \ /tmp/build-kmod-gasket.sh && \ /tmp/build-kmod-gcadapter_oc.sh && \ diff --git a/Containerfile.nvidia b/Containerfile.nvidia index 7307b3eb..85175c2b 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -33,9 +33,9 @@ RUN /tmp/build-prep.sh RUN /tmp/build-ublue-os-nvidia-addons.sh RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \ - KERNEL_NAME="kernel" \ + export KERNEL_NAME="kernel" \ ; else \ - KERNEL_NAME="kernel-surface" \ + export KERNEL_NAME="kernel-surface" \ ; fi && \ /tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION}