Skip to content

Commit 81908c8

Browse files
committed
Search custom firmware paths first
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent d3d41a3 commit 81908c8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Add option to create device nodes when creating `/dev/char` symlinks
1616
* Create ouput folders if required when running `nvidia-ctk runtime configure`
1717
* Generate default config as post-install step.
18+
* Added support for detecting GSP firmware at custom paths when generating CDI specifications.
1819

1920
* [libnvidia-container] Support OpenSSL 3 with the Encrypt/Decrypt library
2021

pkg/nvcdi/driver-nvml.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,26 @@ func getUTSRelease() (string, error) {
110110
}
111111

112112
func getFirmwareSearchPaths(logger logger.Interface) ([]string, error) {
113+
114+
var firmwarePaths []string
115+
if p := getCustomFirmwareClassPath(logger); p != "" {
116+
logger.Debugf("using custom firmware class path: %s", p)
117+
firmwarePaths = append(firmwarePaths, p)
118+
}
119+
113120
utsRelease, err := getUTSRelease()
114121
if err != nil {
115122
return nil, fmt.Errorf("failed to get UTS_RELEASE: %v", err)
116123
}
117124

118-
firmwarePaths := []string{
125+
standardPaths := []string{
119126
filepath.Join("/lib/firmware/updates/", utsRelease),
120127
filepath.Join("/lib/firmware/updates/"),
121128
filepath.Join("/lib/firmware/", utsRelease),
122129
filepath.Join("/lib/firmware/"),
123130
}
124131

125-
if p := getCustomFirmwareClassPath(logger); p != "" {
126-
logger.Debugf("using custom firmware class path: %s", p)
127-
firmwarePaths = append(firmwarePaths, p)
128-
}
129-
return firmwarePaths, nil
132+
return append(firmwarePaths, standardPaths...), nil
130133
}
131134

132135
// getCustomFirmwareClassPath returns the custom firmware class path if it exists.

0 commit comments

Comments
 (0)