diff options
Diffstat (limited to 'system/nvidia-legacy390-driver')
9 files changed, 248 insertions, 295 deletions
diff --git a/system/nvidia-legacy390-driver/README b/system/nvidia-legacy390-driver/README index 56e253398f..e9d688e422 100644 --- a/system/nvidia-legacy390-driver/README +++ b/system/nvidia-legacy390-driver/README @@ -1,48 +1,27 @@ This is the proprietary binary video driver from NVidia for the X.Org -X-server. This package does not include the kernel module - it is a part -of the nvidia-legacy390-kernel package at SlackBuilds.org. +X-server. This package does not include the kernel module - it is a +part of the nvidia-legacy390-kernel package at SlackBuilds.org. -Installing the 32-bit compatibility libraries is available: if desired, -do: +Installing the 32-bit compatibility libraries is available: +if desired, do: COMPAT32="yes" ./nvidia-legacy390-driver.SlackBuild -If you plan to test this buildscript on current/15.0, do: +This script now gives the option of installing the nvidia-persitenced +daemon. PLEASE read README.nvidia-persitenced before building with +perstistenced. - CURRENT="yes" ./nvidia-legacy390-driver.SlackBuild - -This avoids stomping on the libglvnd libraries, plus it forces the -script to use the prebuilt nvidia-installer since it no longer builds -in current. As a consequence, this script may no longer work in a VM. - -If you build and install this driver on current WITHOUT using the -CURRENT="yes" flag, it will corrupt both xorg-server AND libglvnd, so -after removing the driver both packages will have to be reinstalled. - -This script now gives the option of installing the nvidia-persistenced -daemon. For details see README.nvidia-persistenced. - -Several useful utilities are included: nvidia-xsettings, nvidia-smi, and -nvidia-settings. Please refer to the Nvidia documentation and man pages -for details and usage. +Several useful utilities are included: nvidia-xsettings, nvidia-smi, +and nvidia-settings. Please refer to the Nvidia documentation and man +pages for details and usage. For CUDA/OpenCL to work after reboot, and for utilites such as nvidia-smi, you might need to include the following line in your -/etc/rc.d/rc.local: (this is REQUIRED for nvidia-persistenced to work -properly) +/etc/rc.d/rc.local: - # Create missing nvidia device nodes after reboot - /usr/bin/nvidia-modprobe -c 0 -u - -Included is a script called nvidia-switch, which is used to switch -between the xorg and nvidia drivers, but it will not edit xorg.conf for -you; you have to do that manually. The nvidia-switch script is -installed to /usr/sbin. - -Usage of nvidia-switch: - nvidia-switch --install <--> save the stock xorg files and - install the nvidia files and symlinks. - nvidia-switch --remove <--> remove the nvidia files and symlinks and - restore the stock xorg files. +# Create missing nvidia device nodes after reboot +if [ -x /usr/bin/nvidia-modprobe ]; then + /usr/bin/nvidia-modprobe -c 0 -u +fi NOTES: Since nvidia-legacy390-driver conflicts with some files of xorg, it's a @@ -51,22 +30,27 @@ the nvidia-legacy390-driver package backs up the conflicting files and puts the nvidia-specific files into place by automatically running nvidia-switch --install in doinst.sh. -Before uninstalling or upgrading this package, it is IMPORTANT that -you execute 'nvidia-switch --remove', which will switch back to the -stock xorg files and remove all links created by nvidia-switch during -installation. If you forget to do this, you might have to do the switch -manually, since 'nvidia-switch --install' may fail, resulting in xorg -not working. Here are the affected files (and their packages): - - /usr/lib[64]/libGL.so.1.2 (mesa) - /usr/lib[64]/libGL.la (mesa) - /usr/lib[64]/libGLESv1_CM.so.1.0.0 (mesa) - /usr/lib[64]/libGLESv2.so.2.0.0 (mesa) - /usr/lib[64]/libEGL.so.1.0.0 (mesa) - /usr/lib[64]/xorg/modules/libwfb.so (xorg-server) - /usr/lib[64]/xorg/modules/extensions/libglx.so (xorg-server) - -Simply remove the dead nvidia symlinks and and reinstall the mesa and -xorg-server packages. (In current, if libglx.so is a dead symlink, -it MUST be removed before reinstalling xorg-server.) +This package now includes a douninst.sh script, so it is no longer +necessary to run nvidia-switch --remove before uninstalling or +upgrading. However, nvidia-switch is still included for use when +xorg-server is upgraded. Usage of nvidia-switch: + nvidia-switch --install <--> save the stock xorg files and + install the nvidia symlinks. + nvidia-switch --remove <--> remove the nvidia symlinks + and restore the stock xorg files. +The affected files are: +/usr/lib[64]/xorg/modules/extensions/libglx.so (xorg-server) +/usr/lib[64]/xorg/modules/libnvidia-wfb.so.1 (nvidia-specific symlink) + +If you forget to run nvidia-switch --remove before upgrading +xorg-server, all you need to do is run nvidia-switch --install and all +should be well. + +CAUTION! Please DO NOT USE this script for Slackware(64) versions 14.2 +or older as it WILL corrupt the mesa and xorg installations. +Please use the script from those repos instead. + +BIG FAT NOTE: The Nvidia 390.xx series is EOL as of December 2022. +Because of the ABI change from xorg-server 1.20 to 1.21, the Nvidia 390 +driver will no longer work on Slackware versions later than 15.0. diff --git a/system/nvidia-legacy390-driver/README.nvidia-persistenced b/system/nvidia-legacy390-driver/README.nvidia-persistenced index 38e8937cde..8bdb77aa5f 100644 --- a/system/nvidia-legacy390-driver/README.nvidia-persistenced +++ b/system/nvidia-legacy390-driver/README.nvidia-persistenced @@ -1,12 +1,12 @@ The NVIDIA Persistence Daemon is a userspace daemon on Linux to support -persistence of driver state across Cuda job runs. The daemon targets all -current Tesla, Quadro and GRID GPUs. For further information, see +persistence of driver state across Cuda job runs. The daemon targets +all current Tesla, Quadro and GRID GPUs. For further information, see https://docs.nvidia.com/deploy/driver-persistence/index.html -The driver now includes rc.nvidia-persistenced as an option. While it can -be run as root, it is more secure to run it as an unpriveleged user, so we -run it as user nvidia. +The driver now includes rc.nvidia-persistenced as an option. While it +can be run as root, it is more secure to run it as an unpriveleged +user, so we run it as user nvidia. To install it, Pass PERSISTENCED=yes to the script. It will create the user and group nvidia, and install rc.nvidia-persistenced to /etc/rc.d. @@ -18,7 +18,8 @@ if [ -x /etc/rc.d/rc.nvidia-persistenced ]; then /etc/rc.d/rc.nvidia-persistenced start fi -and then 'chmod +x /etc/rc.d/rc.nvidia-persistenced' to make it executable. +and then 'chmod +x /etc/rc.d/rc.nvidia-persistenced' to make it +executable. Add the following to /etc/rc.d/rc.local_shutdown: diff --git a/system/nvidia-legacy390-driver/douninst.sh b/system/nvidia-legacy390-driver/douninst.sh new file mode 100644 index 0000000000..1bf7bd2edf --- /dev/null +++ b/system/nvidia-legacy390-driver/douninst.sh @@ -0,0 +1,14 @@ +( cd usr/libSUFFIX/xorg/modules/extensions + if [ -f libglx.so-xorg ]; then + mv libglx.so-xorg libglx.so + else + if [ ! -e libglx.so ]; then + echo -e "WARNING: libglx.so not found! Please reinstall xorg-server!\n" + fi + fi + ) +echo "The Nvidia legacy390 driver is removed. Make sure the Nvidia driver is" +echo "DISABLED in /etc/X11/xorg.conf as well as /etc/X11/xorg.conf.d/ and" +echo "/usr/share/X11/xorg.conf.d/. Otherwise, this may lead to improperly" +echo -e "working drivers.\n" + diff --git a/system/nvidia-legacy390-driver/nvidia-installer-removed-sysctl-h.patch b/system/nvidia-legacy390-driver/nvidia-installer-removed-sysctl-h.patch new file mode 100644 index 0000000000..df61dfa85d --- /dev/null +++ b/system/nvidia-legacy390-driver/nvidia-installer-removed-sysctl-h.patch @@ -0,0 +1,58 @@ +diff -Nur nvidia-installer-390.143.orig/kernel.c nvidia-installer-390.143/kernel.c +--- nvidia-installer-390.143.orig/kernel.c 2021-03-12 02:29:56.000000000 -0500 ++++ nvidia-installer-390.143/kernel.c 2021-06-23 11:15:12.813980616 -0400 +@@ -23,7 +23,6 @@ + #include <sys/utsname.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <sys/sysctl.h> + #include <ctype.h> + #include <stdlib.h> + #include <dirent.h> +@@ -1055,9 +1050,9 @@ + #define PRINTK_LOGLEVEL_KERN_ALERT 1 + + /* +- * Attempt to set the printk loglevel, first using the /proc/sys interface, +- * and falling back to the deprecated sysctl if that fails. Pass the previous +- * loglevel back to the caller and return TRUE on success, or FALSE on failure. ++ * Attempt to set the printk loglevel using the /proc/sys interface. ++ * Pass the previous loglevel back to the caller and return TRUE on success, ++ * or FALSE on failure. + */ + static int set_loglevel(int level, int *old_level) + { +@@ -1067,6 +1062,9 @@ + fp = fopen("/proc/sys/kernel/printk", "r+"); + if (fp) { + if (!old_level || fscanf(fp, "%d ", old_level) == 1) { ++ /* Use a dynamic buffer for the string: the kernel does not range ++ * check the loglevel, so the value reported by the procfs file ++ * may have an unknown number of digits. */ + char *strlevel = nvasprintf("%d", level); + + fseek(fp, 0, SEEK_SET); +@@ -1079,23 +1077,6 @@ + fclose(fp); + } + +- if (!loglevel_set) { +- /* +- * Explicitly initialize the value of len, even though it looks like the +- * syscall should do that, since in practice it doesn't always actually +- * set the value of the pointed-to length parameter. +- */ +- size_t len = sizeof(int); +- int name[] = { CTL_KERN, KERN_PRINTK }; +- +- if (!old_level || +- sysctl(name, ARRAY_LEN(name), old_level, &len, NULL, 0) == 0) { +- if (sysctl(name, ARRAY_LEN(name), NULL, 0, &level, len) == 0) { +- loglevel_set = TRUE; +- } +- } +- } +- + return loglevel_set; + } + diff --git a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild index b984a32580..278a5ed9f7 100644 --- a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild +++ b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for nvidia-legacy390-driver # Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, USA -# Copyright 2020 Lenard Spencer, Orlando, FL, USA +# Copyright 2020-2023 Lenard Spencer, Orlando, FL, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,14 +23,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# see changelog.txt +cd $(dirname $0) ; CWD=$(pwd) PRGNAM=nvidia-legacy390-driver -VERSION=${VERSION:-390.141} -BUILD=${BUILD:-1} +VERSION=${VERSION:-390.157} +BUILD=${BUILD:-7} TAG=${TAG:-_SBo} - -CURRENT=${CURRENT:-no} +PKGTYPE=${PKGTYPE:-tgz} set -e @@ -42,7 +41,6 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -69,11 +67,26 @@ else COMPAT32=no fi -# Abort if an Nvidia driver is still installed: -if [ -x /usr/bin/nvidia-installer ]; then - echo -e "\n A previous Nvidia installation has been detected!" - echo -e " Please remove the installed driver and rerun this script.\n" - exit 1 +if [ "$COMPAT32" = "yes" ]; then + MULTI="_multilib" +else + MULTI="" +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION$MULTI-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +if [ "${PERSISTENCED:-no}" = "yes" ]; then + if [ `getent group nvidia /dev/null` -o `getent passwd nvidia > /dev/null` ]; then + echo "User and/or group nvidia do not exist!" + echo "Please create user and group nvidia and rerun this script." + exit 1 + fi fi SRCNAM=NVIDIA-Linux-$TARGET-${VERSION} @@ -85,7 +98,6 @@ mkdir -p $TMP $PKG $OUTPUT $PKG/install mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \ $PKG/etc/OpenCL/vendors/ $PKG/usr/{bin,doc,man/man1} \ $PKG/usr/share/{applications,nvidia,pixmaps,egl/egl_external_platform.d} \ - $PKG/usr/include/GL $PKG/etc/vulkan/icd.d $PKG/etc/X11/xorg.conf.d \ $PKG/etc/X11/glvnd/egl_vendor.d $PKG/var/log @@ -108,13 +120,27 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# If you are building in a 32-bit chroot on 64-bit, +# this is now necessary or the utilities will not build: +export TARGET_ARCH=$TARGET + +# Compiling the various open source apps instead of using the precompiled binaries # Compiling nvidia-installer from source -if [ "$CURRENT" = "no" ]; then - cd $TMP/nvidia-installer-$VERSION +cd $TMP/nvidia-installer-$VERSION + +# First, patch for the removed sys/sysctl.h: + patch -p1 < $CWD/nvidia-installer-removed-sysctl-h.patch # Let's try to remove the conflicting files and GPU detection patch -p0 < $CWD/skip_conflict-GPU_detect.patch +# Install various files in $PKG instead of the root filesystem: + sed -i "s|/etc/vulkan|$PKG/etc/vulkan|" files.c + sed -i "s|\"/etc\"|\"$PKG/etc\"|" nvidia-installer.h + sed -i "s|/var/lib/nvidia|$PKG/var/lib/nvidia|" backup.c + sed -i "s|\"/usr/lib/\"|\"$PKG/usr/lib/\"|" files.c + sed -i "s|/usr/lib/nvidia|$PKG/usr/lib/nvidia|" misc.c + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -127,24 +153,20 @@ if [ "$CURRENT" = "no" ]; then install -m 755 _out/Linux_$TARGET/nvidia-installer $PKG/usr/bin/ install -m 644 _out/Linux_$TARGET/nvidia-installer.1.gz $PKG/usr/man/man1/ - cd - +cd - # Now we need to copy the newly patched and compiled nvidia-installer # to the driver source tree for use - mv -f $PKG/usr/bin/nvidia-installer $TMP/$SRCNAM - mv -f $PKG/usr/man/man1/nvidia-installer.1.gz $TMP/$SRCNAM -fi +mv -f $PKG/usr/bin/nvidia-installer $TMP/$SRCNAM +mv -f $PKG/usr/man/man1/nvidia-installer.1.gz $TMP/$SRCNAM if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then COMP32="--install-compat32-libs --compat32-prefix=$PKG/usr" - MULTI="_multilib" - mkdir $PKG/usr/lib else if [ ! "$ARCH" = "x86_64" ]; then COMP32="" else COMP32="--no-install-compat32-libs" - MULTI="" fi fi @@ -167,19 +189,17 @@ cd $TMP/$SRCNAM --log-file-name=$PKG/var/log/nvidia-installer.log \ --egl-external-platform-config-path=$PKG/usr/share/egl/egl_external_platform.d \ --no-nvidia-modprobe \ + --no-install-libglvnd \ $COMP32 -# Move ICDs to $PKG and cleanup (no switch option in installer?) -mv /etc/OpenCL/vendors/nvidia.icd $PKG/etc/OpenCL/vendors/nvidia.icd -mv /etc/vulkan/icd.d/nvidia_icd.json $PKG/etc/vulkan/icd.d/nvidia_icd.json -# In current, mesa now puts an entry into this directory, so we -# leave it alone if it is not empty -if [ -z "$(ls -A /etc/OpenCL/vendors)" ]; then - rm -rf /etc/OpenCL -fi -# just in case any other programs make an entry here -if [ -z "$(ls -A /etc/vulkan)" ]; then - rm -rf /etc/vulkan +# Remove a /var/lib/nvidia entry installed by nvidia-installer but +# no longer needed (caused the "failed to remove some directories" +# warning message): +rm -rf $PKG/var/lib + +# if not multilib, remove the unneeded /usr/lib folder: +if [ "$ARCH" = "x86_64" -a "${COMPAT32}" != "yes" ]; then + rm -rf $PKG/usr/lib || true fi # Compile utilites from source, replacing the precompiled versions @@ -253,13 +273,6 @@ mkdir -p $PKG/usr/sbin install -m 0755 $CWD/nvidia-switch $PKG/usr/sbin/ sed -i s/PKGVERSION/$VERSION/g $PKG/usr/sbin/nvidia-switch sed -i s/LIBDIRSUFFIX/$LIBDIRSUFFIX/g $PKG/usr/sbin/nvidia-switch -if [ "$CURRENT" = "no" ]; then - sed -i s/GLVNDFLAG/yes/g $PKG/usr/sbin/nvidia-switch - sed -i s/GLVERSION/1.2.0/g $PKG/usr/sbin/nvidia-switch -else - sed -i s/GLVNDFLAG/no/g $PKG/usr/sbin/nvidia-switch - sed -i s/GLVERSION/1.7.0/g $PKG/usr/sbin/nvidia-switch -fi if [ ${COMPAT32} = "yes" ]; then sed -i s/LIB32FLAG/yes/g $PKG/usr/sbin/nvidia-switch else @@ -267,78 +280,35 @@ else fi # These add or correct wrong paths -if [ "$CURRENT" = "no" ]; then - sed -i "s|$TMP/package-$PRGNAM/usr|/usr|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la - sed -i "s|/usr/X11R6/lib|/usr/lib$LIBDIRSUFFIX|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la - - if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then - sed -i "s|$TMP/package-$PRGNAM/usr|/usr|" $PKG/usr/lib/libGL.la - sed -i "s|/usr/X11R6/lib|/usr/lib|" $PKG/usr/lib/libGL.la - sed -i "s|'/usr/'|'/usr/lib'|" $PKG/usr/lib/libGL.la - fi -fi sed -i "s|__UTILS_PATH__|/usr/bin|" $PKG/usr/share/applications/nvidia-settings.desktop sed -i "s|__PIXMAP_PATH__|/usr/share/pixmaps|" $PKG/usr/share/applications/nvidia-settings.desktop -sed -i "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Application;Settings;|" $PKG/usr/share/applications/nvidia-settings.desktop +sed -i "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Settings;|" $PKG/usr/share/applications/nvidia-settings.desktop +# Remove depcrecated entry in nvidia-settings.desktop +sed -i '/Encoding/d' $PKG/usr/share/applications/nvidia-settings.desktop # rename wrong/conficting files as needed; remove conflicting symlinks created by installer cd $PKG/usr/lib$LIBDIRSUFFIX - if [ "$CURRENT" = "no" ]; then - mv libEGL.so.1.1.0 libEGL.so.1.1.0-nvidia - mv libGL.la libGL.la-nvidia - mv libGL.so.1.7.0 libGL.so.1.7.0-nvidia - mv libGLESv1_CM.so.1.2.0 libGLESv1_CM.so.1.2.0-nvidia - mv libGLESv2.so.2.1.0 libGLESv2.so.2.1.0-nvidia - rm -f libEGL.so - rm -f libGL.so - rm -f libGL.so.1 - rm -f libGLESv1_CM.so - rm -f libGLESv2.so - else - rm libGL.la - rm libOpenCL.so.1.0.0 - fi - rm -f xorg/modules/libwfb.so - if [ -e xorg/modules/extensions/libglx.so ]; then - (cd xorg/modules/extensions - rm libglx.so - ) - fi + rm libGL.la + rm libOpenCL.so* + rm -f xorg/modules/libwfb.so + if [ -e xorg/modules/extensions/libglx.so ]; then + rm -f xorg/modules/extensions/libglx.so + fi cd - if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then - cd $PKG/usr/lib - if [ "$CURRENT" = "no" ]; then - mv libEGL.so.1.1.0 libEGL.so.1.1.0-nvidia - mv libGL.la libGL.la-nvidia - mv libGLESv1_CM.so.1.2.0 libGLESv1_CM.so.1.2.0-nvidia - mv libGLESv2.so.2.1.0 libGLESv2.so.2.1.0-nvidia - rm -f libEGL.so - rm -f libGL.so - rm -f libGL.so.1 - rm -f libGLESv1_CM.so - rm -f libGLESv2.so - else - rm libGL.la - rm libOpenCL.so.1.0.0 - fi - cd - + cd $PKG/usr/lib + rm libGL.la + rm libOpenCL.so.1.0.0 + cd - # FIXME With COMPAT32=yes on pure x86_64, a weird /usr/lib/libGL.so.1 # symlink to $PKG/usr/lib64/libGL.so.1 appears? Who would do this, # so ignoring for now. fi -# Remove xorg conf file since we handle that in nvidia-legacy390-kernel +# Remove xorg.conf.d file since we handle that in nvidia-legacy390-kernel rm -rf $PKG/etc/X11/xorg.conf.d -if [ "$CURRENT" = "no" ]; then - mkdir -p $PKG/var/log/nvidia/{32,64} - cat <<EOF > $PKG/var/log/nvidia/README.txt -Do NOT delete this directory! -nvidia-switch will backup the original X.org libraries here. -EOF -fi - cd $TMP/$SRCNAM # put docs in the right place mv $PKG/usr/share/man/man1/nvidia-* $PKG/usr/man/man1 @@ -352,13 +322,16 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild sed "s/PKGVERSION/$VERSION/g" $CWD/slack-desc > $PKG/install/slack-desc if [ "$COMPAT32" = "yes" ]; then - sed -i "s|@MULTILIB@|This package includes the 32-bit compatibility libraries.|" $PKG/install/slack-desc + sed -i "s|@MULTILIB@| This package includes the 32-bit compatibility libraries.|" $PKG/install/slack-desc else sed -i "s|@MULTILIB@||" $PKG/install/slack-desc fi cat $CWD/doinst.sh > $PKG/install/doinst.sh +# Add new douninst.sh script: +sed "s/SUFFIX/$LIBDIRSUFFIX/g" $CWD/douninst.sh > $PKG/install/douninst.sh + # Add rc.nvidia-persistenced: if [ "${PERSISTENCED:-no}" = "yes" ]; then cd $TMP @@ -366,6 +339,8 @@ if [ "${PERSISTENCED:-no}" = "yes" ]; then tar xvf $CWD/nvidia-persistenced-$VERSION.tar.bz2 # Compiling nvidia-persistenced cd $TMP/nvidia-persistenced-$VERSION +# Patch for tirpc (backport from 470.xx): + patch -p1 < $CWD/nvidia-persistenced-390-tirpc.patch chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -376,34 +351,14 @@ if [ "${PERSISTENCED:-no}" = "yes" ]; then CFLAGS="$SLKCFLAGS" make install -m 755 _out/Linux_$TARGET/nvidia-persistenced $PKG/usr/bin/ install -m 644 _out/Linux_$TARGET/nvidia-persistenced.1.gz $PKG/usr/man/man1/ - - if ! getent group nvidia > /dev/null 2>&1; then - echo "Creating the group nvidia:" - groupadd -g 365 nvidia || exit 1 - fi - if ! getent passwd nvidia > /dev/null 2>&1; then - echo "Creating the user nvidia:" - useradd -u 365 -g 365 -c "Nvidia" -d /dev/null -s /bin/false nvidia || exit 1 - fi - mkdir -p $PKG/var/run/nvidia-persistenced - chown nvidia:nvidia $PKG/var/run/nvidia-persistenced - mkdir -p $PKG/etc/rc.d +# install rc.nvidia-perstistenced: + mkdir -p $PKG/etc/rc.d $PKG/var/run/nvidia-persistenced install -m 755 $CWD/rc.nvidia-persistenced $PKG/etc/rc.d/rc.nvidia-persistenced sed -i "s|__USER__|nvidia|" $PKG/etc/rc.d/rc.nvidia-persistenced - cat <<EOF >> $PKG/install/doinst.sh -# Create group and user nvidia if they don't already exist -if ! getent group nvidia > /dev/null 2>&1; then - echo "Creating the group nvidia:" - groupadd -g 365 nvidia || exit 1 -fi -if ! getent passwd nvidia > /dev/null 2>&1; then - echo "Creating the user nvidia:" - useradd -u 365 -g 365 -c "Nvidia" -d /dev/null -s /bin/false nvidia || exit 1 + chown nvidia:nvidia $PKG/var/run/nvidia-persistenced fi -EOF -fi # Flag multlib as needed and build package. cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.info b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.info index 110f8ab193..e1520ab0aa 100644 --- a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.info +++ b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.info @@ -1,30 +1,30 @@ PRGNAM="nvidia-legacy390-driver" -VERSION="390.141" -HOMEPAGE="http://www.nvidia.com" -DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.141/NVIDIA-Linux-x86-390.141.run \ - https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.141.tar.bz2" -MD5SUM="f3e6660ffe5338b17b7e643d0eceb57e \ - ff1c359809225ac9fc3562a16bc302bd \ - baa8df62e2449ec6dd55c3d27cf23490 \ - 24c4e151626dc920525966d4bd3a2dbd \ - 61be9b85fd9b2198cdbc555a3625d39b \ - 94c281d2704d87809176e3084102bfee" -DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.141/NVIDIA-Linux-x86_64-390.141.run \ - https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-390.141.tar.bz2 \ - https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.141.tar.bz2" -MD5SUM_x86_64="0c7fc061349bbb2f0d7e26af9f1b082a \ - ff1c359809225ac9fc3562a16bc302bd \ - baa8df62e2449ec6dd55c3d27cf23490 \ - 24c4e151626dc920525966d4bd3a2dbd \ - 61be9b85fd9b2198cdbc555a3625d39b \ - 94c281d2704d87809176e3084102bfee" +VERSION="390.157" +HOMEPAGE="https://www.nvidia.com" +DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.157/NVIDIA-Linux-x86-390.157.run \ + https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.157.tar.bz2" +MD5SUM="0975ee17f9c690555dfb2a342a0138b8 \ + b5d9a2036637cb2292d513caf38c6471 \ + bebac9781d1b307abdb6c183054fdd82 \ + ec1ef1ce2d619d14b60f1ebbf22db674 \ + 70c481fc124052d0c20907c4dd0e57ec \ + 3ff8e45fa66fd00ef824c3e8d297c3e6" +DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run \ + https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-390.157.tar.bz2 \ + https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-390.157.tar.bz2" +MD5SUM_x86_64="d564c4a0f57eb7715a5f11ed8da17b6c \ + b5d9a2036637cb2292d513caf38c6471 \ + bebac9781d1b307abdb6c183054fdd82 \ + ec1ef1ce2d619d14b60f1ebbf22db674 \ + 70c481fc124052d0c20907c4dd0e57ec \ + 3ff8e45fa66fd00ef824c3e8d297c3e6" REQUIRES="nvidia-legacy390-kernel" MAINTAINER="Lenard Spencer" EMAIL="lenardrspencer@gmail.com" diff --git a/system/nvidia-legacy390-driver/nvidia-persistenced-390-tirpc.patch b/system/nvidia-legacy390-driver/nvidia-persistenced-390-tirpc.patch new file mode 100644 index 0000000000..e92a31a716 --- /dev/null +++ b/system/nvidia-legacy390-driver/nvidia-persistenced-390-tirpc.patch @@ -0,0 +1,21 @@ +diff -Nur nvidia-persistenced-390.157.orig/Makefile nvidia-persistenced-390.157/Makefile +--- nvidia-persistenced-390.157.orig/Makefile 2022-10-12 05:30:58.000000000 -0400 ++++ nvidia-persistenced-390.157/Makefile 2023-05-21 17:17:39.137443544 -0400 +@@ -104,6 +104,17 @@ + LIBS += -ldl + endif + ++PKG_CONFIG ?= pkg-config ++ ++USE_TIRPC ?= $(shell $(PKG_CONFIG) --exists libtirpc && echo 1) ++ ++ifeq ($(USE_TIRPC),1) ++ TIRPC_LDFLAGS ?= $(shell $(PKG_CONFIG) --libs libtirpc) ++ TIRPC_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags libtirpc) ++ $(call BUILD_OBJECT_LIST,$(SRC)): CFLAGS += $(TIRPC_CFLAGS) ++ LIBS += $(TIRPC_LDFLAGS) ++endif ++ + ############################################################################## + # build rules + ############################################################################## diff --git a/system/nvidia-legacy390-driver/nvidia-switch b/system/nvidia-legacy390-driver/nvidia-switch index 2f57366cfd..8ba674a6e7 100644 --- a/system/nvidia-legacy390-driver/nvidia-switch +++ b/system/nvidia-legacy390-driver/nvidia-switch @@ -39,93 +39,31 @@ else ROOT="${ROOT}/" fi CWD=$(pwd) -COMPAT32="LIB32FLAG" # This will be replaced in the build script (yes | no) LIBSUFFIX="LIBDIRSUFFIX" # This will be replaced in the build script INC="${ROOT}usr/include/GL" LIB="${ROOT}usr/lib${LIBSUFFIX}" -LIB32="${ROOT}usr/lib" XMOD="${LIB}/xorg/modules" XLIB="$XMOD/extensions" NV_VERSION="PKGVERSION" # This will be replaced in the build script -GL_VERSION="GLVERSION" -GLVND="GLVNDFLAG" # This will be replaced in the build script (yes | no) -SAVELIBS="${ROOT}var/log/nvidia" - -save_GL(){ -# backup original mesa and xorg conflicts to /var/log/nvidia - cd $2 - # Need to make sure save path is reset incase of multilib - SAVELIBS="${ROOT}var/log/nvidia" - if [ "$2" = "$LIB32" ]; then - SAVELIBS="${SAVELIBS}/32" - elif [ "$2" = "$LIB" ]; then - SAVELIBS="${SAVELIBS}/64" - fi - - case "$1" in - "nvidia") - - if [ "$GLVND" = "yes" ]; then - mv libGL.so.$GL_VERSION $SAVELIBS - mv libGL.la $SAVELIBS - mv libEGL.so.1.?.0 $SAVELIBS - mv libGLESv1_CM.so.1.1.0 $SAVELIBS - mv libGLESv2.so.2.0.0 $SAVELIBS - mv libGL.la-nvidia libGL.la - ln -sf libGL.so.1.7.0-nvidia libGL.so.1 - ln -sf libGL.so.1 libGL.so - ln -sf libEGL.so.1.1.0-nvidia libEGL.so.1.1.0 - ln -sf libEGL.so.1 libEGL.so - ln -sf libGLESv1_CM.so.1.2.0-nvidia libGLESv1_CM.libGLESv1_CM.so.1 - ln -sf libGLESv1_CM.so.1 libGLESv1_CM.so - ln -sf libGLESv2.so.2.1.0-nvidia libGLESv2.so.2 - ln -sf libGLESv2.so.2 libGLESv2.so - fi - ;; - - "xorg") - if [ -e libGL.la ]; then - mv libGL.la libGL.la-nvidia - fi - if [ "$GLVND" = "yes" ]; then - mv $SAVELIBS/* . - ln -sf libGL.so.$GL_VERSION libGL.so.1 - ln -sf libGL.so.1 libGL.so - ln -sf libEGL.so.1.0.0 libEGL.so.1 - ln -sf libEGL.so.1 libEGL.so - ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 - ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so - ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 - ln -sf libGLESv2.so.2.0.0 libGLESv2.so - fi - ;; - - *) - echo "nothing to do for save_gl?" - exit 1 - ;; - esac - cd "$CWD" -} save_glx(){ cd "$XLIB" case "$1" in "nvidia") - if [ -e libglx.so ]; then - cp -a libglx.so libglx.so-xorg + if [ -f libglx.so ]; then + mv libglx.so libglx.so-xorg fi ln -sf libglx.so.$NV_VERSION libglx.so ;; "xorg") - if [ -e libglx.so-xorg ]; then + if [ -f libglx.so-xorg ]; then rm -f libglx.so mv libglx.so-xorg libglx.so else if [ ! -e libglx.so ]; then - echo -e "WARNING: libglx.so not found! Please reinstall xorg-server!\n" + echo -e "WARNING: libglx.so not found! Please reinstall xorg-server!\n" else - if [ -L libglx.so ]; then + if [ -h libglx.so ]; then rm libglx.so echo -e "WARNING: removed dead symlink libglx.so! Please reinstall xorg-server!\n" fi @@ -152,22 +90,13 @@ save_wfb(){ } nvidia_install(){ - if [ ! -d $SAVELIBS ]; then - echo "Creating missing $SAVELIB ..." - mkdir -p $SAVELIBS - fi echo $'Installing to nvidia-legacy390-driver files:\n' echo "Make sure the nvidia driver is ENABLED in /etc/X11/xorg.conf" echo "and in /etc/X11/xorg.conf.d. Otherwise, this may lead to" echo -e "improperly working drivers.\n" save_glx "nvidia" - save_GL "nvidia" $LIB save_wfb "nvidia" -# Check for multilib configuration - if [ "$COMPAT32" = "yes" ]; then - save_GL "nvidia" $LIB32 - fi } nvidia_remove(){ @@ -175,17 +104,8 @@ nvidia_remove(){ echo "Make sure the nvidia driver is DISABLED in /usr/share/X11/xorg.conf.d" echo "/etc/X11/xorg.conf and in /etc/X11/xorg.conf.d." echo -e "Otherwise, this may lead to improperly working drivers.\n" - if [ "$GLVND" = "yes" ]; then - echo -e "Be sure to run /sbin/ldconfig after removing nvidia-legacy390-driver.\n" - fi save_glx "xorg" - save_GL "xorg" $LIB save_wfb "xorg" - -# Check for multilib configuration - if [ "$COMPAT32" = "yes" ]; then - save_GL "xorg" $LIB32 - fi } if [ "$LIBSUFFIX" = "64" ]; then diff --git a/system/nvidia-legacy390-driver/rc.nvidia-persistenced b/system/nvidia-legacy390-driver/rc.nvidia-persistenced index 59bdf18d11..b95480a4e0 100644 --- a/system/nvidia-legacy390-driver/rc.nvidia-persistenced +++ b/system/nvidia-legacy390-driver/rc.nvidia-persistenced @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e # # NVIDIA Persistence Daemon Init Script # |