From 5b079f2d3daee5d39a6abb397f24a3fb462a6067 Mon Sep 17 00:00:00 2001 From: vietchinh <1348151+vietchinh@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:05:43 +0100 Subject: [PATCH] feat: added hci vgpu variant --- .github/workflows/build.yml | 1 + config/recipe-ucore-zfs-light-hci-vgpu.yml | 18 ++++++++++ config/scripts/vgpu.sh | 38 ++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 config/recipe-ucore-zfs-light-hci-vgpu.yml create mode 100755 config/scripts/vgpu.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 463ab6bb9e..f29db13d9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: recipe: - recipe-ucore-zfs-light.yml - recipe-ucore-zfs-light-lxd.yml + - recipe-ucore-zfs-light-hci-vgpu.yml - recipe-kinoite-light.yml - recipe-kinoite-light-bore-eevdf.yml - recipe-kinoite-light-libvirt.yml diff --git a/config/recipe-ucore-zfs-light-hci-vgpu.yml b/config/recipe-ucore-zfs-light-hci-vgpu.yml new file mode 100644 index 0000000000..72ae6f801f --- /dev/null +++ b/config/recipe-ucore-zfs-light-hci-vgpu.yml @@ -0,0 +1,18 @@ +# image will be published to ghcr.io// +name: ucore-zfs-rpm-podman-lxd +# description will be included in the image's metadata +description: Ucore minimal with zfs and lxd + +# the base image to build on top of (FROM) and the version tag to use +base-image: ghcr.io/ublue-os/ucore-hci +image-version: stable-zfs # latest is also supported if you want new updates ASAP + +# list of modules, executed in order +# you can include multiple instances of the same module +modules: + + - from-file: recipe-ucore-zfs-light.yml + + - type: script + scripts: + - vgpu.sh \ No newline at end of file diff --git a/config/scripts/vgpu.sh b/config/scripts/vgpu.sh new file mode 100755 index 0000000000..c9c81b3865 --- /dev/null +++ b/config/scripts/vgpu.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -oeux pipefail + +cd /tmp + +### BUILD nvidia + +NVIDIA_VERSION="535.104" +ZIP_NAME="NVIDIA-GRID-Linux-KVM-${NVIDIA_VERSION}.06-535.104.05-537.13.zip" + +rpm-ostree install "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "https://github.com/rpmsphere/noarch/raw/master/r/rpmsphere-release-$(rpm -E %fedora)-1.noarch.rpm" +rpm-ostree install wget p7zip p7zip-plugins mscompress osslsigncode git kernel-devel + +git clone --recursive https://github.com/VGPU-Community-Drivers/vGPU-Unlock-patcher.git -b ${NVIDIA_VERSION} + +VGPU_FOLDER="vGPU-Unlock-patcher" + +wget -q "https://github.com/justin-himself/NVIDIA-VGPU-Driver-Archive/releases/download/16.1/${ZIP_NAME}" +unzip ${ZIP_NAME} -d ${VGPU_FOLDER} +rm -f ${ZIP_NAME} + +cd ${VGPU_FOLDER} + +mv Guest_Drivers/* . +mv Host_Drivers/* . +mv Signing_Keys/* . + +chmod +x patch.sh + +./patch.sh general-merge + +KERNEL_VERSION="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')" + +./NVIDIA-Linux-x86_64-535.104.05-merged-vgpu-kvm-patched/nvidia-installer -s --kernel-source-path /usr/src/kernels/"${KERNEL_VERSION}" --no-systemd --dkms + +cd .. +rm -rf ${VGPU_FOLDER} \ No newline at end of file