diff options
author | Lenard Spencer <lenardrspencer@gmail.com> | 2020-04-17 10:45:41 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-04-17 10:45:41 +0700 |
commit | 9a58d29c1a8ad1891a74ccd670fc7b23d2e1edf3 (patch) | |
tree | a0f064ab41506564d3545c1e8e27559924276a82 /system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild | |
parent | 8db865d339f9709e12b0911575dbe71d4dd47a60 (diff) |
system/nvidia-legacy390-driver: Fix nvidia-switch.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild')
-rw-r--r-- | system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild index c22fca04c228d..462e4f800a40f 100644 --- a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild +++ b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild @@ -173,12 +173,15 @@ cd $TMP/$SRCNAM # 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 -rm -rf /etc/vulkan # 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 +fi # Compile utilites from source, replacing the precompiled versions # @@ -371,14 +374,24 @@ else fi # Add rc.nvidia-persistenced: -mkdir -p $PKG/var/run/nvidia-persistenced -chown nvidia:nvidia $PKG/var/run/nvidia-persistenced -mkdir -p $PKG/etc/rc.d -cat $CWD/rc.nvidia-persistenced > $PKG/etc/rc.d/rc.nvidia-persistenced -sed -i "s|__USER__|nvidia|" $PKG/etc/rc.d/rc.nvidia-persistenced +if [ "${PERSISTENCED:-no}" = "yes" ]; then + 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 -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 +fi cat $CWD/doinst.sh > $PKG/install/doinst.sh -# Flag install as multlib as needed and build package. +# Flag multlib as needed and build package. cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz} |