d48ae5fb | 01-Jan-2020 |
Chicago Duan <duanzhijia01@inspur.com> |
generate-psu-tar: Add machine name and remove single "-" options
Remove single "-" options because there are too many similar options.
The openbmc image manager expects "MachineName" in MANIFEST th
generate-psu-tar: Add machine name and remove single "-" options
Remove single "-" options because there are too many similar options.
The openbmc image manager expects "MachineName" in MANIFEST that matches the BMC's OPENBMC_TARGET_MACHINE in /etc/os-release. * If there is no MachineName in MANIFEST, it logs a warning for now; * If they do not match, an error is reported and the version is deleted.
Add --machineName argument for generate-psu-tar to make it support the "MachineName".
Tested: Verify that when a correct machine name is given, the tarball is processed by image manager correctly; And if an invalid machine name is given, the tarball uploaded will get "Machine name doesn't match" error and is deleted.
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: Ie39e01ae7e4a48fade3459a7eb82da214e0400e9
show more ...
|
617c0b71 | 10-Feb-2020 |
Lei YU <mine260309@gmail.com> |
Install example psu-update@.service
The repo needs an example psu-update@.service, it was expected to be installed by a bitbake recipe, but during the recipe review it turns out that the repo is bet
Install example psu-update@.service
The repo needs an example psu-update@.service, it was expected to be installed by a bitbake recipe, but during the recipe review it turns out that the repo is better to install a default one and it could be overriden by a bbappend.
Move the psu-update@.service from vendor-example to services directory and install it.
Tested: Verify the service is installed.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I105b201972b32ca3d9e14878b92c9d038a41cbdb
show more ...
|
090ce11a | 03-Feb-2020 |
Lei YU <mine260309@gmail.com> |
Set the service busname correctly
The BusName in the service unit file was {BUSNAME}, and it depends on the tools in obmc-phosphor-dbus-service.bbclass to translate the {BUSNAME} to the D-Bus servic
Set the service busname correctly
The BusName in the service unit file was {BUSNAME}, and it depends on the tools in obmc-phosphor-dbus-service.bbclass to translate the {BUSNAME} to the D-Bus service name.
Change it to the D-Bus service name specifically so that it does not depend on such tools to install the service.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I1705de25a3244078963847e5c122a4bcb9eda75e
show more ...
|
c6db1142 | 23-Dec-2019 |
Lei YU <mine260309@gmail.com> |
README: Add description about the usage of this repo
Add the description of several usage of this repo: * How to generate a PSU image tarball; * How to update the PSU image; * How the version is upd
README: Add description about the usage of this repo
Add the description of several usage of this repo: * How to generate a PSU image tarball; * How to update the PSU image; * How the version is updated when PSU is replaced.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I8727a27be138e03e6feecc26205f1c4b0adf8fbe
show more ...
|
8ccc653e | 23-Dec-2019 |
Lei YU <mine260309@gmail.com> |
README: Introduce vendor-specific tools
Add detailed description about what the vendor-specific tools shall do, and how to configure meson to specify the vendor-specific tools.
It also updates meso
README: Introduce vendor-specific tools
Add detailed description about what the vendor-specific tools shall do, and how to configure meson to specify the vendor-specific tools.
It also updates meson_options.txt to use updated psutils from phosphor-power by default.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I17a508b675a754e76645d08d49547f669385813e
show more ...
|
99ac18a7 | 12-Dec-2019 |
Chicago Duan <duanzhijia01@inspur.com> |
Tools: add script to create an update tarball
This script is used to generate the tarball using the PSU image and MANIFEST usage: generate-psu-tar [OPTION] <parameter>... Options: -i, --image
Tools: add script to create an update tarball
This script is used to generate the tarball using the PSU image and MANIFEST usage: generate-psu-tar [OPTION] <parameter>... Options: -i, --image <file> PSU FW image -v, --version <version> PSU FW version -model, --model <model> PSU FW model -mf, --manufacture <version> PSU FW manufacture -o, --outfile <filename> Outfile name For example : -o psufw.tar The default outfile name is image.tar,and "image" is what you input. -s, --sign <path> Sign the image. The optional path argument specifies the private key file. Defaults to the bash variable PRIVATE_KEY_PATH if available, or else uses the open-source private key in this script. -h, --help Display this help text and exit.
Tested: Use this script to generate the tarball for PSU update. for example : ./generate-psu-tar -i PSU.hex -v 12-34 -model 432-1 -mf LITEON -o test.tar -s /home/chicago/test/private_key
./generate-psu-tar -i PSU.hex -v 12-34 -model 432-1 -mf LITEON -o test.tar -s test/private_key
./generate-psu-tar -i PSU.hex -v 12-34 -model 432-1 -mf LITEON -o test.tar -s
./generate-psu-tar -i PSU.hex -v 12-34 -model 432-1 -mf LITEON -o test.tar
./generate-psu-tar -i PSU.hex -v 12-34 -model 432-1 -mf LITEON
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Change-Id: I50ea116bc6e1e49d7fea3e0974453c442784fbe1
show more ...
|
8afeee56 | 21-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Activation: add BMC reboot guard
BMC shall not reboot during PSU update, otherwise it has the risk of putting the PSU in a bad state. So add BMC reboot guard in ActivationBlocksTransition to enable
Activation: add BMC reboot guard
BMC shall not reboot during PSU update, otherwise it has the risk of putting the PSU in a bad state. So add BMC reboot guard in ActivationBlocksTransition to enable reboot guard when PSU update is started, and disable it when it's finished or failed.
During test, it's found that the ActivationBlocksTransition is created too early before checking the PSU compatibility, it is fixed by constructing ActivationBlocksTransition after the check.
Tested: Verify the BMC guard is enabled and disabled during PSU update.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I405fe640929aa91ecbcb3d48e19309d38b6849e5
show more ...
|
d0f8bbb3 | 18-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Version: support CRLF line feed in MANIFEST
When a MANIFEST is generated from Windows and it contains CRLF as line feed, the code was getting each line with '\r' at the end, and thus the parsed stri
Version: support CRLF line feed in MANIFEST
When a MANIFEST is generated from Windows and it contains CRLF as line feed, the code was getting each line with '\r' at the end, and thus the parsed string contains '\r' and it incorrectly parses the string.
Add a piece of code to support CRLF line feed so support such MANIFEST files.
Tested: Added a unit test case to verify CRLF is correctly handled.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I99e146717b815e3e40c232376555b2b48d77bc56
show more ...
|
2d156252 | 17-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Fix an incorrect logging
It was incorrectly using "%d" to log a "METHOD" string. Fix it.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I792f82feb894f5d5a83c4d4f60f52135f6d08dd0 |
1517f5f6 | 14-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Check and sync PSU image when PSU is plugged in
When a PSU is plugged out and in, the service shall check the version and do update if it is with an old software. When the PSU is plugged in, the mod
Check and sync PSU image when PSU is plugged in
When a PSU is plugged out and in, the service shall check the version and do update if it is with an old software. When the PSU is plugged in, the model is not available for a while, so the service subscribe the model property as well, and only create the software object when both present and model properties are set.
Tested: With dummy update service, verify on Witherspoon that when PSU is plugged out (by setting "Present" property in inventory), the software object is removed, and when it's pluggd int (by setting "Present" property), the software object is created after the model is got, and is upgraded by a newer image stored in BMC filesystem.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ia7516e5bc9c642158b216036bcddf404157f9204
show more ...
|
ffb36539 | 15-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Activation: remove old objects after update done
The update on PSUs is one-by-one, after each PSU is updated, notify ItemUpdater by onUpdateDone() so that the old object for the PSU is removed.
Tes
Activation: remove old objects after update done
The update on PSUs is one-by-one, after each PSU is updated, notify ItemUpdater by onUpdateDone() so that the old object for the PSU is removed.
Tested: With dummy PSU image and update service, verify the old objects are removed on Witherspoon.
Change-Id: I212b8cba9570ad96083d362bf57691fdabb4e42f
show more ...
|
63f9e712 | 12-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Sync PSU images on service startup
On service startup, it shall check the PSU images, find a latest version, and update to the PSUs that are not with this version.
Tested: With dummy image and serv
Sync PSU images on service startup
On service startup, it shall check the PSU images, find a latest version, and update to the PSUs that are not with this version.
Tested: With dummy image and service, test on Witherspoon with 2 different running PSU software: * When startup without stored image, the serive tries to update an older PSU but it does not have PSU image, so it's skipped with below journal log: Automatically update PSU No image for the activation, skipped * When startup with an older image stored in BMC, it behaves the same as above. * When startup with a new image stored in BMC, it updates the PSUs, with below example journal log: Automatically update PSU Starting Update PSU /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 /var/lib/obmc/psu/2B1D... Started Update PSU /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 /var/lib/obmc/psu/2B1D. Starting Update PSU /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 /var/lib/obmc/psu/2B1D... Started Update PSU /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 /var/lib/obmc/psu/2B1D.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I6d676c5a4441685fb2b5920455f439c00f6097af
show more ...
|
4b9ac392 | 11-Oct-2019 |
Lei YU <mine260309@gmail.com> |
utils: Add function to check if PSU is associated
Add a helper function to check if a PSU is in an association list, which will be used in future commits to check if a PSU is running a software imag
utils: Add function to check if PSU is associated
Add a helper function to check if a PSU is in an association list, which will be used in future commits to check if a PSU is running a software image.
Tested: added unit test case and verify it passes.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I99b5d3d8d09f8e09a1eb42ba104a4804b7214cf1
show more ...
|
6520748d | 11-Oct-2019 |
Lei YU <mine260309@gmail.com> |
utils: Add function to get the latest version
This repo does not know which PSU version is the latest, and it lets the vendor tool to decide which one is the latest.
This commit defines PSU_VERSION
utils: Add function to get the latest version
This repo does not know which PSU version is the latest, and it lets the vendor tool to decide which one is the latest.
This commit defines PSU_VERSION_COMPARE_UTIL which is expected to be a tool that accepts arguments of a list of versions, and returns the latest version string.
Tested: Put and configure to use the example get_latest_version on Witherspoon, verify the versionId with a larger version string is returned.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ic5a10d3724cf6a98b3979486c72d54f8deac7038
show more ...
|
c09155bb | 11-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Test: Use unique mocked utils for each test
The mocked utils object was shared between the tests because it's a static object. This causes problems on expecting the number of called the mocked funct
Test: Use unique mocked utils for each test
The mocked utils object was shared between the tests because it's a static object. This causes problems on expecting the number of called the mocked functions.
Add a freeUtils() in mocked_utils.hpp, and call it in test fixture's destructor, so that each test case will use a different mocked object.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I2622c678012d30b2bd75dc37a2bc3a663f40d86c
show more ...
|
e8945ea6 | 29-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: support updating PSU from stored image
The previous code assume the image to update is from IMG_DIR. Now it needs to update PSU from pre-built or stored images.
This commit adds the sup
Activation: support updating PSU from stored image
The previous code assume the image to update is from IMG_DIR. Now it needs to update PSU from pre-built or stored images.
This commit adds the support, by constructing the systemd unit based on Activation's Path property instead of IMG_DIR.
Tested: Verify on Witherspoon that it is able to activate a stored image.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I0936bb921b22c7f67aee9689e3695e6b21703a29
show more ...
|
58c26e3f | 27-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Scan directories that store PSU images on start
When the service starts, scan the directories that store PSU images, including the built-in images, and the saved images during PSU update.
When the
Scan directories that store PSU images on start
When the service starts, scan the directories that store PSU images, including the built-in images, and the saved images during PSU update.
When the scanned image is different than the running images, create activation/version object; When the scanned image is the same as the running images, update the version object's path to indicate the PSU image path, so it could be used for future update in case a PSU is replaced with a different software.
Tested: On Witherspoon, fake create a dummy PSU image with a different version than running PSU, verify a new object is created on restart; fake creating a dummy PSU image with a same version as a running PSU, verify no new object is created, but the "Path" property is set to the PSU image directory.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I860b978250a718eb82d948a1c88bd8f41bb2b2e3
show more ...
|
2e0e2de5 | 26-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: store PSU image in persistent storage
When an activation succeeds, store the PSU image into persistent storage, which will be used in future in case a PSU is replaced, and the BMC will n
Activation: store PSU image in persistent storage
When an activation succeeds, store the PSU image into persistent storage, which will be used in future in case a PSU is replaced, and the BMC will need to update the replaced PSU's firmware. Only the latest image is saved, and old ones are removed for each model.
Tested: On witherspoon, verify the PSU image is saved in persistent storage after a successful activation with dummy service, and the FilePath inteface is updated with the stored path. And after another successful activation, the new image is saved and the old one is removed in persistent storage.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I11f3d4a91d045d2316242d8eef968f05250d862e
show more ...
|
9930137b | 29-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Refactor: Make Activation inherit FilePath interface
Previously Version inherits FilePath interface to provide the information of the file path property of a software, and Activation was using pre-d
Refactor: Make Activation inherit FilePath interface
Previously Version inherits FilePath interface to provide the information of the file path property of a software, and Activation was using pre-defined location to find the image path (IMG_DIR / versionId).
Now the code is going to support pre-built image and stored image during update, the Activation class needs to know the file path to perform the update.
So this commit "moves" the FilePath from Version to Activation.
Tested: Verify the "Path" property on FilePath still exists on the DBus object after uploading a tarball.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I37b41eaa93cd239ab7732f6fac9400410995ca71
show more ...
|
a5c47bb3 | 28-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Refactor: remove DeleteAll interface
There is no need for ItemUpdater to implement DeleteAll interface, remove it.
Also make Activation::versionId private and provide a public getVersionId() method
Refactor: remove DeleteAll interface
There is no need for ItemUpdater to implement DeleteAll interface, remove it.
Also make Activation::versionId private and provide a public getVersionId() method; Make ItemUpdater::erase() to pass const reference.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ifd6c61fc21b2967d6c83f1df7aaa3b2e94cae86c
show more ...
|
9edb7330 | 19-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: check compatiblity of uploaded software
Before activation, check if the PSU inventory's manufacturer and model matches the uploaded software, to make sure the software is not updated to
Activation: check compatiblity of uploaded software
Before activation, check if the PSU inventory's manufacturer and model matches the uploaded software, to make sure the software is not updated to a incompatible PSU.
The model check is mandatory, and if the PSU manufacturer is empty, ignore the manufacturer check.
Tested: Upload a dummy tarball with incompatible model, verify the activation fails; Upload a dummy tarball with compatible model, verify the activation succeeds with a dummy update service. Also added unit tests for several cases: * Update on a PSU that model is incompatible; * Update on a PSU that the manufacture is incompatible; * Update on a PSU that the menufacture is empty; * Update on 4 PSUs that the second one is incompatible.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Ia1b6a3fa6c98cdea1ea93c917c0938d4a60f0911
show more ...
|
fda15a33 | 19-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Refactor Version::getValue()
Rename the function to getValues() and change the parameter and return value types, and add a test case for it. It will be used in future commits.
Tested: Verify the un
Refactor Version::getValue()
Rename the function to getValues() and change the parameter and return value types, and add a test case for it. It will be used in future commits.
Tested: Verify the unit test case passes.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I57ccf857737ef13f4e2f27c5f2fb7400a2170e91
show more ...
|
7f2a2152 | 16-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: create associations
Create activation, functional, activate associations during PSU update.
Tested: With dummy psu update service, verify the assocations are created when the PS
Activation: create associations
Create activation, functional, activate associations during PSU update.
Tested: With dummy psu update service, verify the assocations are created when the PSU update is completed, and not created when PSU update fails.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I3d457e65b55066b93f7fc9a3311093dcec05d020
show more ...
|
ff83c2a0 | 12-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: Support to update multiple PSUs
Queue the update on multiple PSUs, and do the update one-by-one.
Tested: Write unit test cases and verify the cases pass. On witherspoon, verify
Activation: Support to update multiple PSUs
Queue the update on multiple PSUs, and do the update one-by-one.
Tested: Write unit test cases and verify the cases pass. On witherspoon, verify the dummy update services are run on all PSUs.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Icfe0f6e74623e54840df8d731d852d53d6071768
show more ...
|
90c8a8b9 | 11-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Activation: Add activationProgress
Use ActivationProgress to provide the PSU update progress.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I92d8c1425cf5ec1d0ff192a822a60f0c59bd8110 |