Skip to content

Commit

Permalink
fix: install supergfxctl-plasmoid (#121)
Browse files Browse the repository at this point in the history
Corrects a problem where this was failing to install due to the
ublue-os-nvidia-addons RPM disabling the required COPR repo.

Fixes #99 again
  • Loading branch information
bsherman authored Jun 18, 2023
1 parent 5c716a8 commit 1f6d6f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 63 deletions.
1 change: 0 additions & 1 deletion install.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ COPY --from=${AKMODS_CACHE}:${AKMODS_VERSION}-${NVIDIA_MAJOR_VERSION} / .

COPY install.sh /tmp/install.sh
COPY post-install.sh /tmp/post-install.sh
COPY packages.json /tmp/packages.json
RUN /tmp/install.sh
RUN /tmp/post-install.sh
RUN rm -rf /tmp/* /var/*
Expand Down
33 changes: 7 additions & 26 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ set -ouex pipefail

sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular,updates-modular}.repo

INCLUDED_PACKAGES=($(jq -r "[(.all.include | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[])] \
| sort | unique[]" /tmp/packages.json))
EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[])] \
| sort | unique[]" /tmp/packages.json))

if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]}))
fi

install -D /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/nvidia-container-runtime.repo \
/etc/yum.repos.d/nvidia-container-runtime.repo
install -D /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/lukenukem-asus-linux.repo \
Expand All @@ -24,22 +13,14 @@ install -D /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/jhyub-supergfxctl-plasmo

source /var/cache/akmods/nvidia-vars

if [[ "${IMAGE_NAME}" == "kinoite" ]]; then
VARIANT_PKGS="supergfxctl-plasmoid"
else
VARIANT_PKGS=""
fi

rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \
nvidia-container-toolkit nvidia-vaapi-driver supergfxctl \
nvidia-container-toolkit nvidia-vaapi-driver supergfxctl ${VARIANT_PKGS} \
/var/cache/akmods/${NVIDIA_PACKAGE_NAME}/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm \
/tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons-*.rpm

if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then
rpm-ostree install \
${INCLUDED_PACKAGES[@]}
elif [[ "${#INCLUDED_PACKAGES[@]}" -eq 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
${EXCLUDED_PACKAGES[@]}
elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
${EXCLUDED_PACKAGES[@]} \
$(printf -- "--install=%s " ${INCLUDED_PACKAGES[@]})
else
echo "No packages to install."
fi
36 changes: 0 additions & 36 deletions packages.json

This file was deleted.

0 comments on commit 1f6d6f2

Please sign in to comment.