aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorLenard Spencer <lenardrspencer@gmail.com>2020-11-14 08:21:21 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-11-14 08:21:21 +0700
commit5711a98156e12f1c04fca8f1a782e2af9f218f76 (patch)
treeaff8bbfb636334be8ac252748aab353a368caf53 /system
parentce472bac6d683a95cd582a1976df21ccee298896 (diff)
system/nvidia-driver: Fix issue with .la handling.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/nvidia-driver/README27
-rw-r--r--system/nvidia-driver/nvidia-driver.SlackBuild6
-rw-r--r--system/nvidia-driver/nvidia-switch45
-rw-r--r--system/nvidia-driver/slack-desc2
4 files changed, 50 insertions, 30 deletions
diff --git a/system/nvidia-driver/README b/system/nvidia-driver/README
index a3897e2aa22d..f4e14f8b397b 100644
--- a/system/nvidia-driver/README
+++ b/system/nvidia-driver/README
@@ -21,8 +21,7 @@ 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 if you plan on using
-nvidia-persistenced)
+/etc/rc.d/rc.local (This is REQUIRED for nvidia-persistenced to work):
# Create missing nvidia device nodes after reboot
if [ -x /usr/bin/nvidia-modprobe ]; then
@@ -39,9 +38,25 @@ Notes:
the kernel module).
3. As of version 450.xx, Nvidia no longer includes libGL.la in their
- distribution package. On 14.2 ONLY, if you want to revert back to
+ distribution package. On 14.2 ONLY, nvidia-switch saves these
+ files to /var/log/nvidia/{32,64}:
+
+ libGL{,ESv1_CM,ESv2}.la
+ libGL.so.1.2.0
+ libGLESv1_cm.so.1.1.0
+ libGLESv2.so.2.0.0
+
+ It then modifies the .la files in /usr/lib{,64} to point to the
+ nvidia versions of these libraries. If you want to revert back to
the open source drivers, run 'nvidia-switch --remove' to restore
- the original libGL.la and then 'removepkg nvidia-driver' "should"
- work in most cases. If not, just go into /usr/lib{,64} (as root of
- course) and rename libGL.la-xorg to libGL.la.
+ the original mesa librarieslibGL.la and then
+ 'removepkg nvidia-driver' "should" work in most cases. If you
+ forget to run nvidia-switch --remove, just copy the original files
+ saved in /var/log/nvidia/{32,64} back to /usr/lib{,64}.
(THIS STEP IS NO LONGER NECESSARY ON CURRENT.)
+
+4. (IMPORTANT ON 14.2) When it comes time to remove this package with
+ 'removepkg' (or just about any other package for that matter), you
+ MUST run '/sbin/ldconfig' to restore any symlinks. This is due to
+ an omission in removepkg that failed to run ldconfig after removing
+ the package. (This has been corrected in current/15.0.)
diff --git a/system/nvidia-driver/nvidia-driver.SlackBuild b/system/nvidia-driver/nvidia-driver.SlackBuild
index e6ed65d42c8b..db69c43f7c57 100644
--- a/system/nvidia-driver/nvidia-driver.SlackBuild
+++ b/system/nvidia-driver/nvidia-driver.SlackBuild
@@ -28,7 +28,7 @@
PRGNAM=nvidia-driver
VERSION=${VERSION:-450.80.02}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
CURRENT=${CURRENT:-no}
@@ -276,9 +276,9 @@ 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 libraries.|" $PKG/install/slack-desc
+ sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver: This package includes the 32-bit libraries.|" $PKG/install/slack-desc
else
- sed -i "s|@MULTILIB@||" $PKG/install/slack-desc
+ sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver:|" $PKG/install/slack-desc
fi
cat $CWD/doinst.sh > $PKG/install/doinst.sh
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index e6d268f4bd95..9196cf7b8a8d 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -43,22 +43,20 @@ LIB="${ROOT}usr/lib${LIBSUFFIX}"
LIB32="${ROOT}usr/lib"
save_GL(){
-# backup original mesa conflict
+# backup original mesa conflicts
cd $2
case "$1" in
"nvidia")
- if [ -e libGL.la ]; then
- mv libGL.la libGL.la-xorg
- fi
- /sbin/ldconfig
+ cp libGL{,ES*}.la /var/log/nvidia/$3
+ mv libGL{.so.1.2.0,ESv1_CM.so.1.1.0,ESv2.so.2.0.0} /var/log/nvidia/$3
+ sed -i s/1.2.0/1.7.0/g libGL.la
+ sed -i s/1.1.0/1.2.0/g libGLESv1_CM.la
+ sed -i s/2.0.0/2.1.0/g libGLESv2.la
;;
"xorg")
- if [ -e libGL.la-xorg ]; then
- mv libGL.la-xorg libGL.la
- fi
- /sbin/ldconfig
- ;;
+ mv /var/log/nvidia/$3/* .
+ ;;
*)
echo "nothing to do for save_gl?"
@@ -75,11 +73,14 @@ nvidia_install(){
echo "/etc/X11/xorg.conf.d. Otherwise, this may lead to improperly"
echo -e "working drivers.\n"
- save_GL "nvidia" $LIB
-
-# Check for multilib configuration
- if [ "$COMPAT32" = "yes" ]; then
- save_GL "nvidia" $LIB32
+ if [ "$LIBSUFFIX" = "64" ]; then
+ save_GL "nvidia" $LIB "64"
+ # Check for multilib configuration
+ if [ "$COMPAT32" = "yes" ]; then
+ save_GL "nvidia" $LIB32 "32"
+ fi
+ else
+ save_GL "nvidia" $LIB "32"
fi
}
@@ -88,12 +89,16 @@ nvidia_remove(){
echo "Make sure the nvidia driver is DISABLED in /etc/X11/xorg.conf"
echo "and in /usr/share/X11/xorg.conf.d and /etc/X11/xorg.conf.d."
echo "Otherwise, this may lead to improperly working drivers."
- echo -e "\nPlease run /sbin/ldconfing after removing nvidia-driver.\n"
+ echo -e "\nPLEASE run /sbin/ldconfing after removing nvidia-driver.\n"
- save_GL "xorg" $LIB
-# Check for multilib configuration
- if [ "$COMPAT32" = "yes" ]; then
- save_GL "xorg" $LIB32
+ if [ "$LIBSUFFIX" = "64" ]; then
+ save_GL "xorg" $LIB "64"
+ # Check for multilib configuration
+ if [ "$COMPAT32" = "yes" ]; then
+ save_GL "xorg" $LIB32 "32"
+ fi
+ else
+ save_GL "xorg" $LIB "32"
fi
}
diff --git a/system/nvidia-driver/slack-desc b/system/nvidia-driver/slack-desc
index 7b63dee80eff..165da729373f 100644
--- a/system/nvidia-driver/slack-desc
+++ b/system/nvidia-driver/slack-desc
@@ -16,4 +16,4 @@ nvidia-driver: See /usr/doc/nvidia-driver-PKGVERSION/README.Slackware
nvidia-driver: for more information.
nvidia-driver:
nvidia-driver: https://www.nvidia.com
-nvidia-driver:
+nvidia-driver: @MULTILIB@