-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implement vpd-tool mfgClean #573
Implement vpd-tool mfgClean #573
Conversation
0a0fe28
to
27ab26f
Compare
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" Data updated successfully Data updated successfully Data updated successfully The critical keywords from system backplane VPD has been reset successfully. root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" The critical keywords from system backplane VPD has been reset successfully. ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
27ab26f
to
a45585e
Compare
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" Data updated successfully Data updated successfully Data updated successfully The critical keywords from system backplane VPD has been reset successfully. root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" The critical keywords from system backplane VPD has been reset successfully. ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
a45585e
to
53ec284
Compare
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" Data updated successfully Data updated successfully Data updated successfully The critical keywords from system backplane VPD has been reset successfully. root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" The critical keywords from system backplane VPD has been reset successfully. ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
53ec284
to
933e808
Compare
vpd-tool/src/vpd_tool.cpp
Outdated
@@ -197,21 +197,128 @@ int VpdTool::cleanSystemVpd() const noexcept | |||
int l_rc{constants::FAILURE}; | |||
try | |||
{ | |||
// TODO: | |||
// get the keyword map from backup_restore json | |||
// iterate through the keyword map get default value of | |||
// l_keywordName. | |||
// use readKeyword API to read hardware value from hardware. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read is not required, write directly to clear the mfg values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed read.
vpd-tool/src/vpd_tool.cpp
Outdated
.get<types::BinaryVector>(); | ||
|
||
// get the value on hardware | ||
const auto& l_keywordValue = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skip the read check and go ahead with the write check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed read check.
vpd-tool/src/vpd_tool.cpp
Outdated
{ | ||
l_rc = constants::SUCCESS; | ||
std::cout | ||
<< "\n The critical keywords from system backplane VPD has " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why system backplane ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the string the old vpd-tool prints out on success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to fix that now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the success/failure message.
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" Data updated successfully Data updated successfully Data updated successfully The critical keywords from system backplane VPD has been reset successfully. root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Cleaning System VPD... Hardware path: "/sys/bus/i2c/drivers/at24/8-0050/eeprom" The critical keywords from system backplane VPD has been reset successfully. ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
933e808
to
afc67ee
Compare
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Manufacturing clean is successful root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Manufacturing clean is successful ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
afc67ee
to
f62f345
Compare
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Manufacturing clean is successful root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Manufacturing clean is successful ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
f62f345
to
aa4c745
Compare
vpd-tool/src/vpd_tool.cpp
Outdated
else | ||
{ | ||
std::cerr | ||
<< "Invalid keyword entry in Backup Restore JSON backup map" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep this statement generic like below
"Unrecognized Entry Record [l_srcRecordName] Keyword [l_srcKeywordName]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
vpd-tool/src/vpd_tool.cpp
Outdated
getBackupRestoreCfgJsonObj(); | ||
|
||
// flag to track any failure | ||
bool l_anyFailure{false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this even needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to detemine the status message printed to console
"Manufacturing clean is success" or
"Manufacturing clean has failed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still confused on when this will be false on the final print. if I have a single backup map with a single entry and mfgclean is not required what will the end display be ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the flag.
vpd-tool/src/vpd_tool.cpp
Outdated
} | ||
return l_rc; | ||
return constants::SUCCESS; // keeping rc=0 always for consistency with old | ||
// 1060 mfgClean implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment need not be there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the comment.
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Manufacturing clean is successful root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Manufacturing clean is successful ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
aa4c745
to
5583167
Compare
vpd-tool/src/vpd_tool.cpp
Outdated
getBackupRestoreCfgJsonObj(); | ||
|
||
// flag to track any failure | ||
bool l_anyFailure{false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still confused on when this will be false on the final print. if I have a single backup map with a single entry and mfgclean is not required what will the end display be ?
This commit implements vpd-tool --mfgClean option. This API resets specific System VPD keywords to default value. The System VPD keywords are fetched from backup_restore.json. The specified keyword values are reset on: - Primary EEPROM path. - Redundant EEPROM path(if any) - D-Bus cache. - Backup path. Test: ``` root@p10bmc:~# ./vpd-tool --mfgClean --yes Manufacturing clean is successful root@p10bmc:~# ./vpd-tool --mfgClean This option resets some of the system VPD keywords to their default values. Do you really wish to proceed further?[yes/no]:yes Manufacturing clean is successful ``` Change-Id: I55862fc4122a188e3e522dd64ed6bd1fa94335e8 Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
5583167
to
2bbb54d
Compare
his commit implements vpd-tool --mfgClean option.
This API resets specific System VPD keywords to default value.
The specified keyword values are reset on:
- Primary EEPROM path.
- Redundant EEPROM path(if any)
- D-Bus cache.
- Backup path.