VPD Tool: Update Hardware
Vpd tool has --Hardware/-H flag which should be given along
with writeKeyword flags, if the user wants to write directly to "Hardware".
In general the user should give only the object path in
--path/-P value.
Only if --Hardware/-H flag is given, the user has an
option to give either eeprom path or the object path in
--path/-P value.
Test:
Tested on simics.
./vpd-tool --writeKeyword -H --path < hardware path/object path > -R < record name > -K < keyword > -V < value in hex/ascii >
CASE 1: <updating eeprom path> < update directly on hardware using -H.>
./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R VINI -K PN -V 0x717273
updation successful on both dbus and hardware.
CASE 2:
./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R DINF -K FL -V 0x717273
updation successful on hardware. <this wont get updated in dbus as the given record-keyword pair is not required to update in dbus(only those record keywords
present in dbus_properties.json are required to be updated in dbus).
CASE 3: <failure case - invalid eeprom path>
root@rainier:/tmp# ./vpd-tool -u -H -P /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a490.i2c-bus/i2c-8/8-0051/8-00510/nvmem -R VINI -K PN -V 0x717273
Invalid object path : /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a490.i2c-bus/i2c-8/8-0051/8-00510/nvmem. Unable to find the corresponding EEPROM path for the given object path : /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e7$
Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I6b893e699fe343c90c3a3fd2b07fd8b9a4711687
diff --git a/vpd-manager/editor_impl.cpp b/vpd-manager/editor_impl.cpp
index a20cd44..9ca68fc 100644
--- a/vpd-manager/editor_impl.cpp
+++ b/vpd-manager/editor_impl.cpp
@@ -578,7 +578,7 @@
}
}
-void EditorImpl::updateKeyword(const Binary& kwdData)
+void EditorImpl::updateKeyword(const Binary& kwdData, const bool& updCache)
{
startOffset = 0;
#ifndef ManagerTest
@@ -649,9 +649,13 @@
// update the ECC data for the record once data has been updated
updateRecordECC();
+
#ifndef ManagerTest
- // update the cache once data has been updated
- updateCache();
+ if (updCache)
+ {
+ // update the cache once data has been updated
+ updateCache();
+ }
#endif
}
catch (const std::exception& e)
@@ -665,7 +669,6 @@
return;
}
}
-
} // namespace editor
} // namespace manager
} // namespace vpd