l/nvidia-driver: nvidia legacy driver added, version 390.138.

This package contains libraries, binaries, config files and X.org
support - basically everything except kernel integration, which
itself has been moved to k/kmod-nvidia package.
Package building process does not perform any sort of installation.
Some files (like CUDA binaries) have been removed.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
This commit is contained in:
Michal Cieslakiewicz 2020-11-23 15:50:36 +01:00
parent 65d88f5096
commit 7b0913d649
9 changed files with 203 additions and 4 deletions

11
README.nvidia-legacy Normal file
View File

@ -0,0 +1,11 @@
Nvidia legacy binary driver is included in this tree.
It is split into two packages (listed in build order):
l/nvidia-driver
k/kmod-nvidia
First package contains libraries, binaries, config files
and X.org support - basically everything besides kernel
integration. Second one is the kernel module itself.

View File

@ -1,6 +1,4 @@
#!/bin/bash
set -x
BINDIST=NVIDIA-Linux-x86_64
VERSION=390.138
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${VERSION}/${BINDIST}-${VERSION}.run && \
chmod +x ${BINDIST}-${VERSION}.run
SRC=$(ls ../../l/nvidia-driver/${BINDIST}-*.run 2>/dev/null | tail -1)
[ ! -z "$SRC" ] && [ -s "$SRC" ] && ln -s $SRC .

View File

@ -0,0 +1,6 @@
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName ""
EndSection

View File

@ -0,0 +1,9 @@
( cd usr/lib64/xorg/modules/extensions
if [ -f libglx.so ] ; then
if [ -L libglx.so ] ; then rm -f libglx.so
else mv libglx.so libglx.so-xorg ; fi
ln -s libglx.so.$VERSION libglx.so
fi
)
[ -x sbin/ldconfig ] && sbin/ldconfig -X -C etc/ld.so.cache -f etc/ld.so.conf
[ -x usr/bin/update-desktop-database ] && usr/bin/update-desktop-database -q usr/share/applications

View File

@ -0,0 +1,8 @@
( cd usr/lib64
[ -f libGLX_indirect.so.0 ] && rm -f libGLX_indirect.so.0
[ -f libGLX_mesa.so.0.0.0 ] && ln -s libGLX_mesa.so.0.0.0 libGLX_indirect.so.0
)
( cd usr/lib64/xorg/modules/extensions
[ -f libglx.so ] && rm -f libglx.so
[ -f libglx.so-xorg ] && mv libglx.so-xorg libglx.so
)

6
l/nvidia-driver/get_sources.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -x
BINDIST=NVIDIA-Linux-x86_64
VERSION=390.138
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${VERSION}/${BINDIST}-${VERSION}.run && \
chmod +x ${BINDIST}-${VERSION}.run

View File

@ -0,0 +1 @@
options nvidia-drm modeset=1

View File

@ -0,0 +1,141 @@
#!/bin/sh
# Set initial variables:
CWD=$(pwd)
APP=nvidia-driver
BINDIST=NVIDIA-Linux-x86_64
VERSION=${VERSION:-$(echo ${BINDIST}-*.run | rev | cut -f 2- -d . | cut -f 1 -d - | rev)}
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1}
TAG=${TAG:-micu}
LIBSUFFIX=""
if [ "$ARCH" = "x86_64" ]; then
LIBSUFFIX=${LIBSUFFIX:-64}
else
LIBSUFFIX=""
fi
if [ "$TMP" = "" ]; then
TMP=/tmp
fi
PKG=$TMP/package-$APP
rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf $BINDIST-$VERSION
$CWD/${BINDIST}-${VERSION}.run -x || exit 1
cd $BINDIST-$VERSION || exit 1
chown -R root.root .
find . -perm 444 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
# Installation is performed manually, nvidia-installer is not launched:
mkdir -p $PKG/etc/modprobe.d $PKG/etc/OpenCL/vendors $PKG/etc/X11/xorg.conf.d \
$PKG/etc/vulkan/icd.d $PKG/usr/bin $PKG/usr/doc/$APP-$VERSION \
$PKG/usr/lib${LIBSUFFIX}/{tls,vdpau} \
$PKG/usr/lib${LIBSUFFIX}/xorg/modules/{drivers,extensions} \
$PKG/usr/man/man1 $PKG/usr/share/X11/xorg.conf.d \
$PKG/usr/share/applications $PKG/usr/share/egl/egl_external_platform.d \
$PKG/usr/share/glvnd/egl_vendor.d $PKG/usr/share/nvidia $PKG/usr/share/pixmaps
cp -av $CWD/modprobe_nvidia.conf $PKG/etc/modprobe.d/nvidia.conf
cp -av nvidia.icd $PKG/etc/OpenCL/vendors
cp -av $CWD/10-nvidia.conf $PKG/etc/X11/xorg.conf.d
sed -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:' nvidia_icd.json.template > $PKG/etc/vulkan/icd.d/nvidia_icd.json
cp -av nvidia-bug-report.sh nvidia-debugdump nvidia-installer nvidia-modprobe \
nvidia-settings nvidia-smi nvidia-xconfig $PKG/usr/bin
cp -av LICENSE NVIDIA_Changelog README.txt html $PKG/usr/doc/$APP-$VERSION
cp -av libEGL_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.$VERSION \
libGLESv2_nvidia.so.$VERSION libGLX_nvidia.so.$VERSION libcuda.so.$VERSION \
libnvcuvid.so.$VERSION libnvidia-cfg.so.$VERSION \
libnvidia-compiler.so.$VERSION libnvidia-eglcore.so.$VERSION \
libnvidia-encode.so.$VERSION libnvidia-fatbinaryloader.so.$VERSION \
libnvidia-fbc.so.$VERSION libnvidia-glcore.so.$VERSION \
libnvidia-glsi.so.$VERSION libnvidia-gtk2.so.$VERSION \
libnvidia-gtk3.so.$VERSION libnvidia-ifr.so.$VERSION \
libnvidia-ml.so.$VERSION libnvidia-opencl.so.$VERSION \
libnvidia-ptxjitcompiler.so.$VERSION libnvidia-tls.so.$VERSION \
$PKG/usr/lib$LIBSUFFIX
cp -av tls/libnvidia-tls.so.$VERSION $PKG/usr/lib${LIBSUFFIX}/tls
cp -av libvdpau_nvidia.so.$VERSION $PKG/usr/lib${LIBSUFFIX}/vdpau
cp -av libOpenCL.so.1.0.0 libnvidia-egl-wayland.so.1.0.2 \
$PKG/usr/lib$LIBSUFFIX
cp -av nvidia_drv.so $PKG/usr/lib${LIBSUFFIX}/xorg/modules/drivers
cp -av libglx.so.$VERSION $PKG/usr/lib${LIBSUFFIX}/xorg/modules/extensions
cp -av libnvidia-wfb.so.$VERSION $PKG/usr/lib${LIBSUFFIX}/xorg/modules
cp -av nvidia-installer.1.gz nvidia-modprobe.1.gz nvidia-settings.1.gz \
nvidia-smi.1.gz nvidia-xconfig.1.gz $PKG/usr/man/man1
cp -av nvidia-drm-outputclass.conf \
$PKG/usr/share/X11/xorg.conf.d/20-nvidia-drm-outputclass.conf
sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
nvidia-settings.desktop > $PKG/usr/share/applications/nvidia-settings.desktop
cp -av 10_nvidia_wayland.json $PKG/usr/share/egl/egl_external_platform.d
cp -av 10_nvidia.json $PKG/usr/share/glvnd/egl_vendor.d
cp -av nvidia-application-profiles-${VERSION}-key-documentation \
nvidia-application-profiles-${VERSION}-rc $PKG/usr/share/nvidia
cp -av nvidia-settings.png $PKG/usr/share/pixmaps
( cd $PKG/usr/lib$LIBSUFFIX
ln -s libEGL_nvidia.so.$VERSION libEGL_nvidia.so.0
ln -s libGLESv1_CM_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.1
ln -s libGLESv2_nvidia.so.$VERSION libGLESv2_nvidia.so.2
ln -s libGLX_nvidia.so.$VERSION libGLX_nvidia.so.0
ln -s libGLX_nvidia.so.$VERSION libGLX_indirect.so.0
ln -s libcuda.so.$VERSION libcuda.so.1
ln -s libcuda.so.1 libcuda.so
ln -s libnvcuvid.so.$VERSION libnvcuvid.so.1
ln -s libnvcuvid.so.1 libnvcuvid.so
ln -s libnvidia-cfg.so.$VERSION libnvidia-cfg.so.1
ln -s libnvidia-cfg.so.1 libnvidia-cfg.so
ln -s libnvidia-encode.so.$VERSION libnvidia-encode.so.1
ln -s libnvidia-encode.so.1 libnvidia-encode.so
ln -s libnvidia-fbc.so.$VERSION libnvidia-fbc.so.1
ln -s libnvidia-fbc.so.1 libnvidia-fbc.so
ln -s libnvidia-ifr.so.$VERSION libnvidia-ifr.so.1
ln -s libnvidia-ifr.so.1 libnvidia-ifr.so
ln -s libnvidia-ml.so.$VERSION libnvidia-ml.so.1
ln -s libnvidia-ml.so.1 libnvidia-ml.so
ln -s libnvidia-opencl.so.$VERSION libnvidia-opencl.so.1
ln -s libnvidia-ptxjitcompiler.so.$VERSION libnvidia-ptxjitcompiler.so.1
ln -s libnvidia-ptxjitcompiler.so.1 libnvidia-ptxjitcompiler.so
ln -s vdpau/libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so
ln -s libOpenCL.so.1.0.0 libOpenCL.so.1.0
ln -s libOpenCL.so.1.0 libOpenCL.so.1
ln -s libOpenCL.so.1 libOpenCL.so
ln -s libnvidia-egl-wayland.so.1.0.2 libnvidia-egl-wayland.so.1
)
( cd $PKG/usr/lib${LIBSUFFIX}/vdpau
ln -s libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so.1
ln -s libvdpau_nvidia.so.1 libvdpau_nvidia.so
)
( cd $PKG/usr/lib${LIBSUFFIX}/xorg/modules
ln -s libnvidia-wfb.so.$VERSION libnvidia-wfb.so.1
)
chown -R root.bin $PKG/usr/bin
mkdir -p $PKG/install
echo "VERSION=$VERSION" > $PKG/install/doinst.sh
[ -f $CWD/doinst.sh ] && cat $CWD/doinst.sh >> $PKG/install/doinst.sh
[ -f $CWD/douninst.sh ] && cat $CWD/douninst.sh > $PKG/install/douninst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
# Allow to run as non-root until now:
if [ $(id -u) -ne 0 ]; then
echo "*** Running as non-root, skipping makepkg."
echo "*** Package contents is in $PKG directory."
exit 0
fi
cd $PKG
makepkg -l y -c n $TMP/$APP-$VERSION-$ARCH-${BUILD}${TAG}.txz
# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/$BINDIST-$VERSION
rm -rf $PKG
fi

View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
nvidia-driver: nvidia-driver (nvidia legacy binary driver for X.org)
nvidia-driver:
nvidia-driver: This is the proprietary binary video driver from Nvidia for
nvidia-driver: the X.org X server (legacy version for older chipsets). CUDA is
nvidia-driver: not supported. This package does not include the kernel module
nvidia-driver: - it is included in the kmod-nvidia package.
nvidia-driver:
nvidia-driver:
nvidia-driver:
nvidia-driver:
nvidia-driver: