Skip to content

Commit

Permalink
Switch to use edk2-pytool-library UefiVariableSupportLib. (#362)
Browse files Browse the repository at this point in the history
## Description

There are multiple copies of VariableSupportLib floating across repos,
mostly only supporting Windows.
Functionality has been consolidated into edk2-pytool-library version
0.21.7. Support for Linux has been added.

Switch ReadUefiVarsToConfVarList.py, PyRobotRemote.py, WrapAndSetSvd.py
and WriteConfVarListToUefiVars.py to use consolidated version from
edk2-pytool-library.

Removed local copies of VariableSupportLib.py

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested


## Integration Instructions

N/A
  • Loading branch information
apop5 committed Aug 7, 2024
1 parent 5552edc commit 377d984
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 361 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"nochange",
"headerRef",
"modea",
"modeb"
"modeb",
"uefivariablesupport"
]
}
3 changes: 2 additions & 1 deletion SetupDataPkg/SetupDataPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"prettyname",
"efivars",
"efivarfs",
"chattr"
"chattr",
"uefivariablesupport"
], # words to extend to the dictionary for this package
"IgnoreStandardPaths": [], # Standard Plugin defined paths that should be ignore
"AdditionalIncludePaths": [] # Additional paths to spell check (wildcards supported)
Expand Down
5 changes: 1 addition & 4 deletions SetupDataPkg/Tools/ReadUefiVarsToConfVarList.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
import struct
import uuid
import ctypes
if os.name == 'nt':
from SettingSupport.UefiVariablesSupportLib import UefiVariable
else:
from SettingSupport.UefiVariablesSupportLinuxLib import UefiVariable
from edk2toollib.os.uefivariablesupport import UefiVariable
from VariableList import Schema, UEFIVariable, create_vlist_buffer


Expand Down
7 changes: 3 additions & 4 deletions SetupDataPkg/Tools/SettingSupport/PyRobotRemote.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,17 @@ def Run_Command_And_Return_Output(self, cmdline):
def GetUefiVariable(self, name, guid, trim):
UefiVar = UefiVariable()
logging.info("Calling GetUefiVar(name='%s', GUID='%s')" % (name, "{%s}" % guid))
(rc, var, error_string) = UefiVar.GetUefiVar(name, guid)
(rc, var) = UefiVar.GetUefiVar(name, guid)
var2 = var
if (var is not None) and (trim == 'trim'):
varlen = len(var)
if varlen > 1:
var2 = var[0: varlen - 1]
return (rc, var2, error_string)
return (rc, var2, "")

def SetUefiVariable(self, name, guid, attrs=None, contents=None):
UefiVar = UefiVariable()
(rc, err, error_string) = UefiVar.SetUefiVar(name, guid, contents, attrs)
return rc
return UefiVar.SetUefiVar(name, guid, contents, attrs)

def remote_ack(self):
return True
Expand Down
201 changes: 0 additions & 201 deletions SetupDataPkg/Tools/SettingSupport/UefiVariablesSupportLib.py

This file was deleted.

143 changes: 0 additions & 143 deletions SetupDataPkg/Tools/SettingSupport/UefiVariablesSupportLinuxLib.py

This file was deleted.

Loading

0 comments on commit 377d984

Please sign in to comment.