generated from ublue-os/base
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build nvidia images in main repo (#319)
This adds the nvidia build scripts to the repo and reconfigures Containerfile to build both FOO-main and FOO-nvidia images per matrix provided build-args. Workflow matrix was modified to support this use case, including changes to variables and tag generation. Reviewers: please double-check the generated tags look correct per image. I did review and put some effort into this, but would appreciate extra eyes. Changes which were not technically required: "main" build.sh, post-install.sh, packages.json renamed (with main- prefix) to make things more consistent and easier to follow for future switched to COPY instead of ADD in Containerfile for compliance with best practices added retry logic to curl in github-release-install.sh to avoid some observed intermittent errors Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com>
- Loading branch information
Showing
8 changed files
with
128 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -ouex pipefail | ||
|
||
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular,updates-modular}.repo | ||
|
||
rpm-ostree install \ | ||
/tmp/akmods-rpms/ublue-os/ublue-os-nvidia-addons-*.rpm | ||
|
||
source /tmp/akmods-rpms/kmods/nvidia-vars.${NVIDIA_MAJOR_VERSION} | ||
|
||
if [[ "${IMAGE_NAME}" == "kinoite" ]]; then | ||
VARIANT_PKGS="supergfxctl-plasmoid" | ||
elif [[ "${IMAGE_NAME}" == "silverblue" ]]; then | ||
VARIANT_PKGS="gnome-shell-extension-supergfxctl-gex" | ||
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 ${VARIANT_PKGS} \ | ||
/tmp/akmods-rpms/kmods/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -ouex pipefail | ||
|
||
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/{eyecantcu-supergfxctl,nvidia-container-runtime}.repo | ||
|
||
mv /etc/nvidia-container-runtime/config.toml{,.orig} | ||
cp /etc/nvidia-container-runtime/config{-rootless,}.toml | ||
|
||
semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp | ||
ln -s /usr/bin/ld.bfd /etc/alternatives/ld | ||
ln -s /etc/alternatives/ld /usr/bin/ld | ||
|
||
if [[ "${IMAGE_NAME}" == "sericea" ]]; then | ||
mv /etc/sway/environment{,.orig} | ||
install -Dm644 /usr/share/ublue-os/etc/sway/environment /etc/sway/environment | ||
fi |