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
8f88cd60
Commit
8f88cd60
authored
Mar 12, 2019
by
Vladislav Yarmak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce search list for driver location
parent
780cfa3d
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 @
8f88cd60
...
@@ -7,7 +7,6 @@ set -euo pipefail ; # <- this semicolon and comment make options apply
...
@@ -7,7 +7,6 @@ set -euo pipefail ; # <- this semicolon and comment make options apply
backup_path
=
"/opt/nvidia/libnvidia-encode-backup"
backup_path
=
"/opt/nvidia/libnvidia-encode-backup"
silent_flag
=
''
silent_flag
=
''
rollback_flag
=
''
rollback_flag
=
''
driver_dir
=
'/usr/lib/x86_64-linux-gnu'
print_usage
()
{
printf
'
print_usage
()
{
printf
'
SYNOPSIS
SYNOPSIS
...
@@ -36,9 +35,6 @@ if [[ $silent_flag ]]; then
...
@@ -36,9 +35,6 @@ if [[ $silent_flag ]]; then
exec
1> /dev/null
exec
1> /dev/null
fi
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
=(
declare
-A
patch_list
=(
[
"375.39"
]=
's/\x85\xC0\x89\xC5\x75\x18/\x29\xC0\x89\xC5\x90\x90/g'
[
"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'
[
"390.77"
]=
's/\x85\xC0\x89\xC5\x75\x18/\x29\xC0\x89\xC5\x90\x90/g'
...
@@ -106,6 +102,22 @@ fi
...
@@ -106,6 +102,22 @@ fi
patch
=
"
${
patch_list
[
$driver_version
]
}
"
patch
=
"
${
patch_list
[
$driver_version
]
}
"
object
=
"
${
object_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
[[
$rollback_flag
]]
;
then
if
[[
-f
"
$backup_path
/
$object
.
$driver_version
"
]]
;
then
if
[[
-f
"
$backup_path
/
$object
.
$driver_version
"
]]
;
then
cp
-p
"
$backup_path
/
$object
.
$driver_version
"
\
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