-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from martin-belanger/nbft-v4
nbft: Add NbftConf() object to retrieve and cache NBFT data
- Loading branch information
Showing
11 changed files
with
217 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) 2023, Dell Inc. or its subsidiaries. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# See the LICENSE file for details. | ||
# | ||
# This file is part of NVMe STorage Appliance Services (nvme-stas). | ||
# | ||
# Authors: Martin Belanger <Martin.Belanger@dell.com> | ||
# | ||
'''Code used to access the NVMe Boot Firmware Tables''' | ||
|
||
import os | ||
import glob | ||
import logging | ||
from libnvme import nvme | ||
from staslib import defs | ||
|
||
|
||
def get_nbft_files(root_dir=defs.NBFT_SYSFS_PATH): | ||
"""Return a dictionary containing the NBFT data for all the NBFT binary files located in @root_dir""" | ||
if not defs.HAS_NBFT_SUPPORT: | ||
logging.warning( | ||
"libnvme-%s does not have NBFT support. Please upgrade libnvme.", | ||
defs.LIBNVME_VERSION, | ||
) | ||
return {} | ||
|
||
pathname = os.path.join(root_dir, defs.NBFT_SYSFS_FILENAME) | ||
return {fname: nvme.nbft_get(fname) for fname in glob.iglob(pathname=pathname)} # pylint: disable=no-member |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.