From 872aecc2d58a92f9fd4291ead25115ee8be1bf9e Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Wed, 16 Oct 2024 20:34:48 +0200 Subject: [PATCH] Rework base image above fedora kinoite --- Containerfile | 8 ++++--- build.sh | 23 ------------------- scripts/build.sh | 6 +++++ scripts/nvidia/install.sh | 15 ++++++++++++ .../nvidia/modprobe.d/nouveau-blacklist.conf | 1 + scripts/nvidia/modprobe.d/nvidia-modeset.conf | 4 ++++ 6 files changed, 31 insertions(+), 26 deletions(-) delete mode 100755 build.sh create mode 100755 scripts/build.sh create mode 100755 scripts/nvidia/install.sh create mode 100644 scripts/nvidia/modprobe.d/nouveau-blacklist.conf create mode 100644 scripts/nvidia/modprobe.d/nvidia-modeset.conf diff --git a/Containerfile b/Containerfile index 9feb8dc..694eb75 100644 --- a/Containerfile +++ b/Containerfile @@ -1,7 +1,9 @@ -FROM ghcr.io/ublue-os/bazzite-nvidia-open:latest +ARG FEDORA_MAJOR_VERSION=40 -COPY build.sh /tmp/build.sh +FROM quay.io/fedora-ostree-desktops/kinoite:${FEDORA_MAJOR_VERSION} + +COPY scripts /tmp/scripts RUN mkdir -p /var/lib/alternatives && \ - /tmp/build.sh && \ + /tmp/scripts/build.sh && \ ostree container commit diff --git a/build.sh b/build.sh deleted file mode 100755 index e08e0af..0000000 --- a/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -ouex pipefail - -RELEASE="$(rpm -E %fedora)" - - -### Install packages - -# Packages can be installed from any enabled yum repo on the image. -# RPMfusion repos are available by default in ublue main images -# List of rpmfusion packages can be found here: -# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1 - -# this installs a package from fedora repos -rpm-ostree install screen - -# this would install a package from rpmfusion -# rpm-ostree install vlc - -#### Example for enabling a System Unit File - -systemctl enable podman.socket \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..d0e9607 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -ouex pipefail + +export RELEASE="$(rpm -E %fedora)" + +/tmp/scripts/nvidia/install.sh \ No newline at end of file diff --git a/scripts/nvidia/install.sh b/scripts/nvidia/install.sh new file mode 100755 index 0000000..7aa6511 --- /dev/null +++ b/scripts/nvidia/install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# RELEASE var is defined in build.sh script + +set -ouex pipefail + +rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$RELEASE.noarch.rpm \ + https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$RELEASE.noarch.rpm + +# see https://rpmfusion.org/Howto/NVIDIA#Kernel_Open +rpm-ostree install rpmfusion-nonfree-release-tainted + +rpm-ostree install akmod-nvidia-open xorg-x11-drv-nvidia-cuda libva-nvidia-driver \ + nvidia-vaapi-driver libva-utils vdpauinfo xorg-x11-drv-nvidia-cuda-libs + +cp /tmp/scripts/nvidia/modprobe.d/*.conf /etc/modprobe.d/ \ No newline at end of file diff --git a/scripts/nvidia/modprobe.d/nouveau-blacklist.conf b/scripts/nvidia/modprobe.d/nouveau-blacklist.conf new file mode 100644 index 0000000..1e5e027 --- /dev/null +++ b/scripts/nvidia/modprobe.d/nouveau-blacklist.conf @@ -0,0 +1 @@ +blacklist nouveau \ No newline at end of file diff --git a/scripts/nvidia/modprobe.d/nvidia-modeset.conf b/scripts/nvidia/modprobe.d/nvidia-modeset.conf new file mode 100644 index 0000000..3c1b5e2 --- /dev/null +++ b/scripts/nvidia/modprobe.d/nvidia-modeset.conf @@ -0,0 +1,4 @@ +# Nvidia modesetting support. Set to 0 or comment to disable kernel modesetting +# support. This must be disabled in case of Mosaic or SLI. + +options nvidia-drm modeset=1 fbdev=1