mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add support for NVIDIA_REQUIRE_JETPACK envvar
This change ensures that by default, the CSV discovery only considers the base CSV files (l4t.csv, drivers.csv, devices.csv) and skips the rest unless the NVIDIA_REQUIRE_JETPACK is set to "csv-mounts=all", in which case, all CSV files in the specified folder are considered. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -62,6 +62,25 @@ func GetFileList(root string) ([]string, error) {
|
||||
return csvFilePaths, nil
|
||||
}
|
||||
|
||||
// BaseFilesOnly filters out non-base CSV files from the list of CSV files.
|
||||
func BaseFilesOnly(filenames []string) []string {
|
||||
filter := map[string]bool{
|
||||
"l4t.csv": true,
|
||||
"drivers.csv": true,
|
||||
"devices.csv": true,
|
||||
}
|
||||
|
||||
var selected []string
|
||||
for _, file := range filenames {
|
||||
base := filepath.Base(file)
|
||||
if filter[base] {
|
||||
selected = append(selected, file)
|
||||
}
|
||||
}
|
||||
|
||||
return selected
|
||||
}
|
||||
|
||||
// ParseFile parses the specified file and returns a list of required jetson mounts
|
||||
func ParseFile(logger *logrus.Logger, filename string) ([]*MountSpec, error) {
|
||||
csvFile, err := os.Open(filename)
|
||||
|
||||
Reference in New Issue
Block a user