Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nvidia-patch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
nvidia-patch
Commits
62a8c89b
Commit
62a8c89b
authored
Mar 12, 2019
by
Vladislav Yarmak
Committed by
GitHub
Mar 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #80 from Snawoot/drv_path_list
Introduce search list for driver location
parents
3067fb4b
8f88cd60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
patch.sh
patch.sh
+16
-4
No files found.
patch.sh
View file @
62a8c89b
...
...
@@ -7,7 +7,6 @@ set -euo pipefail ; # <- this semicolon and comment make options apply
backup_path
=
"/opt/nvidia/libnvidia-encode-backup"
silent_flag
=
''
rollback_flag
=
''
driver_dir
=
'/usr/lib/x86_64-linux-gnu'
print_usage
()
{
printf
'
SYNOPSIS
...
...
@@ -36,9 +35,6 @@ if [[ $silent_flag ]]; then
exec
1> /dev/null
fi
test
-d
"
$driver_dir
"
||
driver_dir
=
"/usr/lib64"
# ..centos
test
-d
"
$driver_dir
"
||
{
echo
"ERROR: cannot detect driver directory"
;
exit
1
;
}
declare
-A
patch_list
=(
[
"375.39"
]=
's/\x85\xC0\x89\xC5\x75\x18/\x29\xC0\x89\xC5\x90\x90/g'
[
"390.77"
]=
's/\x85\xC0\x89\xC5\x75\x18/\x29\xC0\x89\xC5\x90\x90/g'
...
...
@@ -106,6 +102,22 @@ fi
patch
=
"
${
patch_list
[
$driver_version
]
}
"
object
=
"
${
object_list
[
$driver_version
]
}
"
declare
-a
driver_locations
=(
'/usr/lib/x86_64-linux-gnu'
'/usr/lib64'
"/usr/lib/nvidia-
${
driver_version
%%.*
}
"
)
dir_found
=
''
for
driver_dir
in
"
${
driver_locations
[@]
}
"
;
do
if
[[
-e
"
$driver_dir
/
$object
.
$driver_version
"
]]
;
then
dir_found
=
'true'
break
fi
done
[[
"
$dir_found
"
]]
||
{
echo
"ERROR: cannot detect driver directory"
;
exit
1
;
}
if
[[
$rollback_flag
]]
;
then
if
[[
-f
"
$backup_path
/
$object
.
$driver_version
"
]]
;
then
cp
-p
"
$backup_path
/
$object
.
$driver_version
"
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment