system/nvidia-driver: Fix issue with .la handling.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Lenard Spencer 2020-11-14 08:21:21 +07:00 committed by Willy Sudiarto Raharjo
parent ce472bac6d
commit 5711a98156
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
4 changed files with 50 additions and 30 deletions

View File

@ -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.)

View File

@ -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

View File

@ -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
}

View File

@ -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@