73a6f0d8 | 30-Oct-2024 |
Shawn McCarney <shawnmm@us.ibm.com> |
Update PSU if version cannot be obtained
Currently this application will ignore a PSU if the PSU code version cannot be obtained.
However, there are several scenarios where this could occur: * A co
Update PSU if version cannot be obtained
Currently this application will ignore a PSU if the PSU code version cannot be obtained.
However, there are several scenarios where this could occur: * A code update was previously attempted on the PSU, and the update failed. The PSU is now in a bad state, and the update needs to be performed again. * The PSU is running old code that does not support reading the code version.
In these scenarios performing a code update on the PSU is desired.
Enhance this application so that a PSU with an unknown code version will be updated provided that it is the correct model.
Tested: * Verified code update was still performed if version could not be obtained. * Tested where PSU information is found at start of application * Tested where PSU information is found from InterfacesAdded event * Tested where PSU information is found from PropertiesChanged event * For the complete test plan, see https://gist.github.com/smccarney/3846a97fef590eb69181edc669555a00
Change-Id: I6e60761fa20eeb4500529c00f33de16d69a8d84d Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
ddf525f2 | 27-Sep-2024 |
Shawn McCarney <shawnmm@us.ibm.com> |
Only store images from IMG_DIR
New PSU images are uploaded/downloaded to IMG_DIR (normally /tmp/images). After all PSUs have been updated with the new image, the image is copied to IMG_DIR_PERSIST
Only store images from IMG_DIR
New PSU images are uploaded/downloaded to IMG_DIR (normally /tmp/images). After all PSUs have been updated with the new image, the image is copied to IMG_DIR_PERSIST (normally /var/lib/obmc/psu). This stores the image in a persistent location that will exist beyond a BMC reboot. If a PSU is replaced in the future, and the new PSU has old code, the PSU image from IMG_DIR_PERSIST is used to update it.
The application currently also copies PSU images from IMG_DIR_BUILTIN (normally /usr/share/obmc/psu) to IMG_DIR_PERSIST. This is undesirable for two reasons: * Wastes flash space since IMG_DIR_BUILTIN is already persistent. * IMG_DIR_PERSIST is located in a directory that is shared between both BMC images ("A" side and "B" side). This means the PSU image will be found by both BMC images. This may be undesirable behavior, such as if the other BMC image has not been tested with this PSU image.
Modify the storing logic so that only PSU images from IMG_DIR are copied to IMG_DIR_PERSIST.
Tested: * Verified that a PSU image in IMG_DIR is copied to IMG_DIR_PERSIST * Verified that a PSU image in IMG_DIR_PERSIST is not copied to IMG_DIR_PERSIST * Verified that a PSU image in IMG_DIR_BUILTIN is not copied to IMG_DIR_PERSIST
Change-Id: I69fbbefffb08374cffcb86b9037780b7a312c459 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
799f5149 | 26-Sep-2024 |
Shawn McCarney <shawnmm@us.ibm.com> |
Support ALWAYS_USE_BUILTIN_IMG_DIR in IA handler
Support the new ALWAYS_USE_BUILTIN_IMG_DIR meson option in the InterfacesAdded handler for software versions.
This handler notifies the application
Support ALWAYS_USE_BUILTIN_IMG_DIR in IA handler
Support the new ALWAYS_USE_BUILTIN_IMG_DIR meson option in the InterfacesAdded handler for software versions.
This handler notifies the application when a new software version is created on D-Bus. When a new PSU image is uploaded to the IMG_DIR (/tmp/images) directory, the xyz.openbmc_project.Software.Version service creates a new D-Bus object with the Version interface.
If the ALWAYS_USE_BUILTIN_IMG_DIR option is specified, the new PSU image in IMG_DIR should be ignored. Only PSU images stored in IMG_DIR_BUILTIN (/usr/share/obmc/psu) are used to update PSUs.
Tested: * Built with ALWAYS_USE_BUILTIN_IMG_DIR set to false (the default) * Verified that a new PSU image uploaded to /tmp/images is installed on all PSUs. * Verified new PSU image is copied to /var/lib/obmc/psu * Verified new PSU image is removed from /tmp/images * Verified that after BMC is rebooted new PSU image still exists in /var/lib/obmc/psu * Built with ALWAYS_USE_BUILTIN_IMG_DIR set to true * Verified that a new PSU image uploaded to /tmp/images is ignored and no PSUs are updated. * Verified new PSU image is not copied to /var/lib/obmc/psu * Verified new PSU image is not removed from /tmp/images * Verified that after BMC is rebooted new PSU image no longer exists in /tmp/images
Change-Id: I2f71593f786eac86bdf6f484cc0220e0e6b0f4b7 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
fb86e794 | 11-Sep-2024 |
Faisal Awada <faisal@us.ibm.com> |
Retrieve FW version from IMG_BUILTIN_DIR
Added method to retrieve firmware level found in IMG_BUILTIN_DIR. This is required behavior on some systems types.
Tested: Installed openbmc image on syst
Retrieve FW version from IMG_BUILTIN_DIR
Added method to retrieve firmware level found in IMG_BUILTIN_DIR. This is required behavior on some systems types.
Tested: Installed openbmc image on system and verified the function returns the version available in IMG_BUILT_DIR.
Change-Id: I10166a1412fb9de421bd304c40916a81c1ca0558 Signed-off-by: Faisal Awada <faisal@us.ibm.com>
show more ...
|
80c2daae | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-convert-member-functions-to-static
This check finds non-static member functions that can be made static because the functions don’t use this. This check also triggers
clang-tidy: Enable readability-convert-member-functions-to-static
This check finds non-static member functions that can be made static because the functions don’t use this. This check also triggers readability-static-accessed-through -instance check as we are trying to access a static member function through an instance.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I6c06c61e8f199247e74aca3443741683e3853274
show more ...
|
a5205e40 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-string-compare check
This check finds string comparisons using the compare method. A common mistake is to use the string’s compare method instead of using the equality
clang-tidy: Enable readability-string-compare check
This check finds string comparisons using the compare method. A common mistake is to use the string’s compare method instead of using the equality or inequality operators.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I9d4b8aad27fa34345d08d2ba326b8a31cd3d99c6
show more ...
|
a31e568e | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable performance-unnecessary-value-param check
This check flags value parameter declarations of expensive to copy types that are copied for each invocation but it would suffice to pass
clang-tidy: Enable performance-unnecessary-value-param check
This check flags value parameter declarations of expensive to copy types that are copied for each invocation but it would suffice to pass them by const reference.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Ia287488c3bbe1a64e05760cbece119456d8f82f3
show more ...
|
af025bcf | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable performance-inefficient-vector-operation check
Finds possible inefficient std::vector operations (e.g. push_back, emplace_back) that may cause unnecessary memory reallocations.
I
clang-tidy: Enable performance-inefficient-vector-operation check
Finds possible inefficient std::vector operations (e.g. push_back, emplace_back) that may cause unnecessary memory reallocations.
It can also find calls that add element to protobuf repeated field in a loop without calling Reserve() before the loop. Calling Reserve() first can avoid unnecessary memory reallocations.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I442c3aac7e3c71abbb125ae6bcdbe3f8995d14e9
show more ...
|
a0f2cf7d | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable performance-faster-string-find check
This check optimizes the calls to std::string::find() when the input passed is a single character string literal. The character literal overlo
clang-tidy: Enable performance-faster-string-find check
This check optimizes the calls to std::string::find() when the input passed is a single character string literal. The character literal overload is more efficient.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I72ae6f1506d2298a067e6463bd3718d64d23fdb2
show more ...
|
66a54ad4 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable cppcoreguidelines-special-member-functions
The check finds classes where some but not all of the special member functions are defined.
By default the compiler defines a copy cons
clang-tidy: Enable cppcoreguidelines-special-member-functions
The check finds classes where some but not all of the special member functions are defined.
By default the compiler defines a copy constructor, copy assignment operator, move constructor, move assignment operator and destructor. The default can be suppressed by explicit user-definitions. The relationship between which functions will be suppressed by definitions of other functions is complicated and it is advised that all five are defaulted or explicitly defined.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Icbfd448b2bf78ebf99ec07b55220871e093cb899
show more ...
|
047d9944 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable cppcoreguidelines-explicit-virtual-functions
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.
v
clang-tidy: Enable cppcoreguidelines-explicit-virtual-functions
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overridden function.
In C++11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.
This can be useful as compilers can generate a compile time error when: - The base class implementation function signature changes. - The user has not created the override with the correct signature.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I428f69c11b071a1a50e7f93f7bcc29c8300dcddb
show more ...
|
bab5ed99 | 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I08efc0671773edfae814ebcda5c01389155e2cac Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
e183edcc | 09-Jul-2024 |
Matt Spinler <spinler@us.ibm.com> |
Catch GetSubTreePaths exception
The mapper will throw an exception if the root path passed into it doesn't exist. Catch that exception instead of crashing and just return an empty list of PSU paths
Catch GetSubTreePaths exception
The mapper will throw an exception if the root path passed into it doesn't exist. Catch that exception instead of crashing and just return an empty list of PSU paths from the getPSUInventoryPath() function when /xyz/openbmc_project/inventory doesn't exist.
This showed up due to some timing changes on an IBM system where there aren't any /xyz/openbmc_project/inventory paths yet when this application starts.
Tested: When /xyz/openbmc_project/inventory isn't on D-Bus, the application no longer crashes.
Change-Id: I45fdc5cd80d7386bb0f8db25474ae53d223bd218 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
760053d8 | 16-May-2024 |
Faisal Awada <faisal@us.ibm.com> |
Waiting for PSUs to be available during startup
Modified the Software PSU Updater Service to wait until inventory service available. Updated ItemUpdater::scanDirectory to search for the installed PS
Waiting for PSUs to be available during startup
Modified the Software PSU Updater Service to wait until inventory service available. Updated ItemUpdater::scanDirectory to search for the installed PSU model directory. For example, the PSU model 2B1E should have a directory named /usr/share/obmc/psu/2B1E. The firmware file and the MANIFEST reside in the model directory.
Added a new function, `onInterfacesAdded`, processes D-Bus messages to update the internal state of PSU devices. It performs the following steps: - Read D-Bus message to extract the object path and interfaces. - Check for PSU Interface. - Retrieve all PSUs inventory paths from the D-Bus. - Update PSU present status and model. If the PSU is present and has valid version, process FW update to latest version.
Fixed the issue with version comparison when there is no firmware to compare with.
Tested: Tested the code in simulation module and verified it waits for all PSUs to be discovered. Verified phosphor-psu-code-manager invokes psutils to get the PSU version, compare and update.
Change-Id: Ic26e215baffd56fc070cc0cf6d3fff92fdfb914c Signed-off-by: Faisal Awada <faisal@us.ibm.com>
show more ...
|
33cf9f08 | 17-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://githu
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://github.com/codespell-project/codespell
Change-Id: Icafafe827d67c9b6cc5c3f6bfb204fe425e91a32 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
3f6c12b8 | 20-Oct-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I732e5e7e4a76173d0018b1cd540c3b9b4adee83e Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
5670b188 | 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: Idb72665dbadfa8afd569a2e0e254d84f0a2108d3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
374fae56 | 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie530f2c63000bbfac7c5fbbc74ebe6bc8c07fb1a
show more ...
|
b5f9b829 | 16-Jun-2022 |
Patrick Williams <patrick@stwcx.xyz> |
remove std::experimental usage
The bug previously referenced that instigated the usage of std::experimental::any instead of std::any has long been fixed in GCC/libstdc++. Switch back to use the non
remove std::experimental usage
The bug previously referenced that instigated the usage of std::experimental::any instead of std::any has long been fixed in GCC/libstdc++. Switch back to use the non-experimental library.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Icb162fd24105b32196993c319ddf232ab1b8c50e
show more ...
|
434ae483 | 16-Apr-2022 |
Tang Yiwei <tangyiwei.2022@bytedance.com> |
sdbusplus: object: don't use 'bool' argument constructor
`sdbusplus::server::object_t` has long had an enum-based parameter for signal action, but maintained a backwards compatible boolean mapping.
sdbusplus: object: don't use 'bool' argument constructor
`sdbusplus::server::object_t` has long had an enum-based parameter for signal action, but maintained a backwards compatible boolean mapping. It is time to remove this boolean to make it more observable which actions are being used in applications. Map all `true` occurrences to `action::defer_emit` or `action::emit_interface_added`.
Signed-off-by: Tang Yiwei <tangyiwei.2022@bytedance.com> Change-Id: Ibb77315bca56d6cebfb540976f44ee362534f942
show more ...
|
0b7c7b3a | 07-Feb-2022 |
George Liu <liuxiwei@inspur.com> |
openssl: stop using deprecated SHA512_* functions
The openssl/sha.h header is deprecated for OpenSSL 3 along with all the functions in it. Switch to use the EVP_MD interfaces.
Signed-off-by: Georg
openssl: stop using deprecated SHA512_* functions
The openssl/sha.h header is deprecated for OpenSSL 3 along with all the functions in it. Switch to use the EVP_MD interfaces.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I17f9cd3652d92caab1baf29829e8e0cd6f781142
show more ...
|
6d62ceb3 | 02-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
exception: switch to public sdbus exception
SdBusError was intended to be a private error type inside sdbusplus. Switch all catch locations to use the general sdbusplus::exception type.
Signed-off-
exception: switch to public sdbus exception
SdBusError was intended to be a private error type inside sdbusplus. Switch all catch locations to use the general sdbusplus::exception type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I3f173e46d23ab9a21f37356df848f5226ccf7962
show more ...
|
de270293 | 12-Jun-2020 |
George Liu <liuxiwei@inspur.com> |
sdbusplus: replace message::variant with std::variant
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Id94a72c3195a2ffefac9b47eb77cd7748f4e61bc |
bfa8d16f | 13-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: replace message::variant with std::variant
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia0910c101ca50cbfee460f0476562b9c66e4c5d1 |
2e9a3b29 | 13-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: remove deprecated variant_ns
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie341309b8c1811fe3960dc25aaa9c7f6a9e7aafb |