Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpd-tool take keyword value from file #502

Draft
wants to merge 3 commits into
base: 1110
Choose a base branch
from

Conversation

branupama
Copy link

No description provided.

@branupama branupama marked this pull request as draft November 25, 2024 04:46
This commit only enables user to choose write keyword in vpd-tool
application but actual implementation of write keyword is not added.

Result:
‘’’
root@rain104bmctest:/tmp# ./vpd-tool
VPD Command Line Tool
Usage: ./vpd-tool [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  -O,--object TEXT            File path
  -R,--record TEXT            Record name
  -K,--keyword TEXT           Keyword name
  --file TEXT                 Absolute file path
  -V,--value TEXT             Keyword value in ascii/hex format. ascii ex: 01234; hex ex: 0x30313233
  -H,--Hardware               CAUTION: Developer only option.
  -r,--readKeyword Needs: --object --record --keyword
                              Read keyword
  -w,--writeKeyword Needs: --object --record --keyword
                              Write keyword, Note: Irrespective of dbus or hardware path provided, both DBus and hardware paths will get updated with given key value

Read:
    IPZ Format:
        From dbus to console: vpd-tool -r -O <DBus Object Path> -R <Record Name> -K <Keyword Name>
        From dbus to file: vpd-tool -r -O <DBus Object Path> -R <Record Name> -K <Keyword Name> --file <File Path>
        From hardware to console: vpd-tool -r -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name>
        From hardware to file: vpd-tool -r -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name> --file <File Path>
Write:
    IPZ Format:
        On dbus: vpd-tool -w -O <DBus Object Path> -R <Record Name> -K <Keyword Name> -V <Keyword Value>
        On dbus, Take keyword value from file:
              vpd-tool -w -O <DBus Object Path> -R <Record Name> -K <Keyword Name> --file <File Path>
        On hardware: vpd-tool -w -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name> -V <Keyword Value>
        On hardware, Take keyword value from file:
              vpd-tool -w -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name> --file <File Path>
'''

Signed-off-by: Anupama B R <[email protected]>
This commit implements VpdTool class writeKeyword API, which send Dbus
request to vpd-manager Dbus service, who hosts the writeKeyword
interface to update keyword's value.

Whether the user gives Dbus object path or hardware path internally
both primary and backup paths gets updated.

Testing:
Tested for both DBus object path and EEPROM path’s, observed that
keyword’s values get updated in both primary and secondary paths.

Signed-off-by: Anupama B R <[email protected]>
This commit adds code to read keyword’s value from the local file to
update keyword’s value. User can provide file path where the value
exists using --file option.

Signed-off-by: Anupama B R <[email protected]>
@branupama branupama force-pushed the vpd-tool_WR_input_file branch from 5875003 to 8cd83d4 Compare December 9, 2024 12:02
@branupama branupama changed the base branch from P11_Dev to 1110 December 9, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant