diff options
author | Lenard Spencer <lenardrspencer@gmail.com> | 2023-05-23 18:40:51 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-05-25 11:50:53 +0700 |
commit | e32c6e572132adfc9b9a109304c34752062e55d9 (patch) | |
tree | 568efc02fed73762b9739cf188c9306555f19638 /system/nvidia-legacy390-driver | |
parent | a1fef0a4ae1ad5be0f8021b743cdecc12551be2f (diff) |
system/nvidia-legacy390-driver: Update script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-legacy390-driver')
3 files changed, 46 insertions, 36 deletions
diff --git a/system/nvidia-legacy390-driver/README b/system/nvidia-legacy390-driver/README index 671061016757c..e3936f377163e 100644 --- a/system/nvidia-legacy390-driver/README +++ b/system/nvidia-legacy390-driver/README @@ -2,12 +2,13 @@ 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. -Installing the 32-bit compatibility libraries in 64-bit multilib is -available. If desired, do: +Installing the 32-bit compatibility libraries is available: +if desired, do: COMPAT32="yes" ./nvidia-legacy390-driver.SlackBuild -This script now gives the option of installing the nvidia-persistenced -daemon. For details see README.nvidia-persistenced. +This script now gives the option of installing the nvidia-persitenced +daemon. PLEASE read README.nvidia-persitenced before building with +perstistenced. Several useful utilities are included: nvidia-xsettings, nvidia-smi, and nvidia-settings. Please refer to the Nvidia documentation and man @@ -15,16 +16,14 @@ 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 +# Create missing nvidia device nodes after reboot +if [ -x /usr/bin/nvidia-modprobe ]; then + /usr/bin/nvidia-modprobe -c 0 -u +fi NOTES: -It is now no longer required to remove the old driver before running -this script. - Since nvidia-legacy390-driver conflicts with some files of xorg, it's a bit complex to install/uninstall the driver. However, installation of the nvidia-legacy390-driver package backs up the conflicting files and diff --git a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild index 972f0f9496d64..0acbdfa03784a 100644 --- a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild +++ b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild @@ -27,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=nvidia-legacy390-driver VERSION=${VERSION:-390.157} -BUILD=${BUILD:-4} +BUILD=${BUILD:-5} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -81,6 +81,14 @@ if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then 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} # make a clean package directory tree @@ -319,6 +327,7 @@ 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 @@ -326,6 +335,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 \ @@ -336,33 +347,12 @@ 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 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 0000000000000..e92a31a716d33 --- /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 + ############################################################################## |