From fd9f7b5587c1bbd9dc1309351a9d0fee80a43db9 Mon Sep 17 00:00:00 2001 From: VHSgunzo Date: Mon, 28 Aug 2023 16:55:43 +0300 Subject: [PATCH] v0.8 --- .SRCINFO | 17 +++++++++++------ .github/workflows/ci.yml | 4 ++-- PKGBUILD | 17 ++++++++++------- build.sh | 34 +++++++++++++++++++++------------- 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index aeac0fd..fe33d5b 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,15 +1,20 @@ -pkgbase = fake-nvidia-utils - pkgdesc = Fake nvidia-utils for RunImage container - pkgver = 0.5 +pkgbase = fake-nvidia-driver + pkgdesc = Fake Nvidia driver for RunImage container + pkgver = 0.8 pkgrel = 1 - url = https://github.com/VHSgunzo/runimage-fake-nvidia-utils + url = https://github.com/VHSgunzo/runimage-fake-nvidia-driver arch = x86_64 license = MIT provides = lib32-nvidia-utils provides = nvidia-utils + provides = lib32-opencl-nvidia + provides = opencl-nvidia + provides = NVIDIA-MODULE conflicts = lib32-nvidia-utils conflicts = nvidia-utils - source = fake-nvidia-utils.tar.gz + conflicts = lib32-opencl-nvidia + conflicts = opencl-nvidia + source = fake-nvidia-driver.tar.gz sha256sums = SKIP -pkgname = fake-nvidia-utils +pkgname = fake-nvidia-driver diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1acaccf..49b0244 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: build_and_release: - name: fake-nvidia-utils + name: fake-nvidia-driver runs-on: ubuntu-latest permissions: contents: write @@ -29,6 +29,6 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: fake-nvidia-utils*.tar.* + files: fake-nvidia-driver*.tar.* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/PKGBUILD b/PKGBUILD index f1fa14c..3a60133 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,16 +1,19 @@ # Maintainer: VHSgunzo -pkgname='fake-nvidia-utils' -pkgver='0.7' +pkgname='fake-nvidia-driver' +pkgver='0.8' pkgrel='1' pkgbase="$pkgname" -pkgdesc='Fake nvidia-utils for RunImage container' -url="https://github.com/VHSgunzo/runimage-fake-nvidia-utils" +pkgdesc='Fake Nvidia driver for RunImage container' +url="https://github.com/VHSgunzo/runimage-fake-nvidia-driver" arch=('x86_64') license=('MIT') -conflicts=('lib32-nvidia-utils' 'nvidia-utils') -provides=('lib32-nvidia-utils' 'nvidia-utils' 'NVIDIA-MODULE') -source=('fake-nvidia-utils.tar.gz') +conflicts=( + 'lib32-nvidia-utils' 'nvidia-utils' + 'lib32-opencl-nvidia' 'opencl-nvidia' +) +provides=("${conflicts[@]}" 'NVIDIA-MODULE') +source=('fake-nvidia-driver.tar.gz') sha256sums=('SKIP') package() { diff --git a/build.sh b/build.sh index b95a928..83c73ed 100755 --- a/build.sh +++ b/build.sh @@ -17,8 +17,19 @@ try_dl() { fi } +create_fake_lib() { + if [ ! -f "usr/$1/$2.so.000.00.00" ] + then + (cd usr/$1 + touch "$2.so.000.00.00" + chmod +x "$2.so.000.00.00" + ln -sf "$2.so.000.00.00" "$2.so.1" + ln -sf "$2.so.1" "$2.so") + fi +} + cd "$(dirname "$(readlink -f "$0" 2>/dev/null)" 2>/dev/null)" -rm -rf *nvidia-utils* pkg src 2>/dev/null +rm -rf *nvidia* pkg src 2>/dev/null if try_dl "lib32-nvidia-utils.tar.zst" "https://archlinux.org/packages/multilib/x86_64/lib32-nvidia-utils/download" && \ try_dl "nvidia-utils.tar.zst" "https://archlinux.org/packages/extra/x86_64/nvidia-utils/download" then @@ -27,7 +38,7 @@ if try_dl "lib32-nvidia-utils.tar.zst" "https://archlinux.org/packages/multilib/ tar -xf lib32-nvidia-utils.tar.zst -C nvidia-utils echo "= unpack nvidia-utils.tar.zst" tar -xf nvidia-utils.tar.zst -C nvidia-utils - echo "= create fake nvidia-utils" + echo "= create fake nvidia-driver" (cd nvidia-utils rm -rf ./.* usr/bin usr/share/doc usr/share/man usr/share/licenses \ usr/lib/sysusers.d usr/lib/systemd usr/lib/udev usr/lib/modprobe.d \ @@ -50,23 +61,20 @@ if try_dl "lib32-nvidia-utils.tar.zst" "https://archlinux.org/packages/multilib/ mv -f "$file" "$(echo "$file"|sed "s|$nvidia_version|000.00.00|g")" done for lib in libnvidia-pkcs11 libnvidia-pkcs11-openssl3 - do - if [ ! -f "usr/lib/$lib.so.000.00.00" ] - then - (cd usr/lib - touch "$lib.so.000.00.00" - chmod +x "$lib.so.000.00.00" - ln -sf "$lib.so.000.00.00" "$lib.so.1" - ln -sf "$lib.so.1" "$lib.so") - fi + do create_fake_lib lib $lib + done + for arch in lib lib32 + do create_fake_lib $arch libnvidia-opencl done mkdir -p usr/bin/nvidia mkdir -p usr/lib/nvidia/32 mkdir -p usr/lib/nvidia/64 mkdir -p etc/ld.so.conf.d + mkdir -p etc/OpenCL/vendors + touch etc/OpenCL/vendors/nvidia.icd echo -e "/usr/lib/nvidia/64\n/usr/lib/nvidia/32" > etc/ld.so.conf.d/nvidia.conf - echo "= create fake-nvidia-utils.tar.gz" - tar --gzip -acf ../fake-nvidia-utils.tar.gz -C ./ usr etc) + echo "= create fake-nvidia-driver.tar.gz" + tar --gzip -acf ../fake-nvidia-driver.tar.gz -C ./ usr etc) echo "= create archlinux package" makepkg -s echo "= cleanup"