Skip to content

Commit

Permalink
v0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
VHSgunzo committed Aug 28, 2023
1 parent 920e237 commit fd9f7b5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 28 deletions.
17 changes: 11 additions & 6 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build_and_release:
name: fake-nvidia-utils
name: fake-nvidia-driver
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -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 }}
17 changes: 10 additions & 7 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Maintainer: VHSgunzo <vhsgunzo.github.io>

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() {
Expand Down
34 changes: 21 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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"
Expand Down

0 comments on commit fd9f7b5

Please sign in to comment.