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
134770c2
Commit
134770c2
authored
Apr 05, 2024
by
Robin Appelman
Committed by
GitHub
Apr 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to export patches as JSON (#779)
parent
e416c41e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
patch-fbc.sh
patch-fbc.sh
+13
-1
patch.sh
patch.sh
+13
-1
No files found.
patch-fbc.sh
View file @
134770c2
...
@@ -26,13 +26,14 @@ DESCRIPTION
...
@@ -26,13 +26,14 @@ DESCRIPTION
-d VERSION Use VERSION driver version when looking for libraries
-d VERSION Use VERSION driver version when looking for libraries
instead of using nvidia-smi to detect it.
instead of using nvidia-smi to detect it.
-f Enable support for Flatpak NVIDIA drivers.
-f Enable support for Flatpak NVIDIA drivers.
-j Output the patch list to stdout as JSON
'
'
}
}
# shellcheck disable=SC2209
# shellcheck disable=SC2209
opmode
=
"patch"
opmode
=
"patch"
while
getopts
'rshc:ld:f'
flag
;
do
while
getopts
'rsh
j
c:ld:f'
flag
;
do
case
"
${
flag
}
"
in
case
"
${
flag
}
"
in
r
)
opmode
=
"
${
opmode
}
rollback"
;;
r
)
opmode
=
"
${
opmode
}
rollback"
;;
s
)
silent_flag
=
'true'
;;
s
)
silent_flag
=
'true'
;;
...
@@ -41,6 +42,7 @@ while getopts 'rshc:ld:f' flag; do
...
@@ -41,6 +42,7 @@ while getopts 'rshc:ld:f' flag; do
l
)
opmode
=
"
${
opmode
}
listversions"
;;
l
)
opmode
=
"
${
opmode
}
listversions"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
f
)
flatpak_flag
=
'true'
;;
f
)
flatpak_flag
=
'true'
;;
j
)
opmode
=
"dump"
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
esac
esac
done
done
...
@@ -354,12 +356,22 @@ list_supported_versions () {
...
@@ -354,12 +356,22 @@ list_supported_versions () {
get_supported_versions
get_supported_versions
}
}
dump_patches
()
{
for
i
in
"
${
!patch_list[@]
}
"
do
echo
"
$i
"
echo
"
${
patch_list
[
$i
]
}
"
done
|
jq
--sort-keys
-n
-R
'reduce inputs as $i ({}; . + { ($i): (input|(tonumber? // .)) })'
}
case
"
${
opmode
}
"
in
case
"
${
opmode
}
"
in
patch
)
patch
;;
patch
)
patch
;;
patchrollback
)
rollback
;;
patchrollback
)
rollback
;;
patchhelp
)
print_usage
;
exit
2
;;
patchhelp
)
print_usage
;
exit
2
;;
patchcheckversion
)
query_version_support
;;
patchcheckversion
)
query_version_support
;;
patchlistversions
)
list_supported_versions
;;
patchlistversions
)
list_supported_versions
;;
dump
)
dump_patches
;;
*
)
echo
"Incorrect combination of flags. Use option -h to get help."
*
)
echo
"Incorrect combination of flags. Use option -h to get help."
exit
2
;;
exit
2
;;
esac
esac
patch.sh
View file @
134770c2
...
@@ -26,13 +26,14 @@ DESCRIPTION
...
@@ -26,13 +26,14 @@ DESCRIPTION
-d VERSION Use VERSION driver version when looking for libraries
-d VERSION Use VERSION driver version when looking for libraries
instead of using nvidia-smi to detect it.
instead of using nvidia-smi to detect it.
-f Enable support for Flatpak NVIDIA drivers.
-f Enable support for Flatpak NVIDIA drivers.
-j Output the patch list to stdout as JSON
'
'
}
}
# shellcheck disable=SC2209
# shellcheck disable=SC2209
opmode
=
"patch"
opmode
=
"patch"
while
getopts
'rshc:ld:f'
flag
;
do
while
getopts
'rsh
j
c:ld:f'
flag
;
do
case
"
${
flag
}
"
in
case
"
${
flag
}
"
in
r
)
opmode
=
"
${
opmode
}
rollback"
;;
r
)
opmode
=
"
${
opmode
}
rollback"
;;
s
)
silent_flag
=
'true'
;;
s
)
silent_flag
=
'true'
;;
...
@@ -41,6 +42,7 @@ while getopts 'rshc:ld:f' flag; do
...
@@ -41,6 +42,7 @@ while getopts 'rshc:ld:f' flag; do
l
)
opmode
=
"
${
opmode
}
listversions"
;;
l
)
opmode
=
"
${
opmode
}
listversions"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
f
)
flatpak_flag
=
'true'
;;
f
)
flatpak_flag
=
'true'
;;
j
)
opmode
=
"dump"
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
esac
esac
done
done
...
@@ -399,12 +401,22 @@ list_supported_versions () {
...
@@ -399,12 +401,22 @@ list_supported_versions () {
get_supported_versions
get_supported_versions
}
}
dump_patches
()
{
for
i
in
"
${
!patch_list[@]
}
"
do
echo
"
$i
"
echo
"
${
patch_list
[
$i
]
}
"
done
|
jq
--sort-keys
-n
-R
'reduce inputs as $i ({}; . + { ($i): (input|(tonumber? // .)) })'
}
case
"
${
opmode
}
"
in
case
"
${
opmode
}
"
in
patch
)
patch
;;
patch
)
patch
;;
patchrollback
)
rollback
;;
patchrollback
)
rollback
;;
patchhelp
)
print_usage
;
exit
2
;;
patchhelp
)
print_usage
;
exit
2
;;
patchcheckversion
)
query_version_support
;;
patchcheckversion
)
query_version_support
;;
patchlistversions
)
list_supported_versions
;;
patchlistversions
)
list_supported_versions
;;
dump
)
dump_patches
;;
*
)
echo
"Incorrect combination of flags. Use option -h to get help."
*
)
echo
"Incorrect combination of flags. Use option -h to get help."
exit
2
;;
exit
2
;;
esac
esac
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