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 ...
|
22c2fbd8 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-uppercase-literal-suffix check
cert-dcl16-c redirects here as an alias for this check. By default, only the suffixes that begin with l (l, ll, lu, llu, but not u, ul,
clang-tidy: Enable readability-uppercase-literal-suffix check
cert-dcl16-c redirects here as an alias for this check. By default, only the suffixes that begin with l (l, ll, lu, llu, but not u, ul, ull) are diagnosed by that alias.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I180ee3e3274899c63181f69a14f158319f178f0c
show more ...
|
71ae535c | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-make-member-function-const check
Finds non-static member functions that can be made const because the functions don’t use this in a non-const way.
Signed-off-by: Geor
clang-tidy: Enable readability-make-member-function-const check
Finds non-static member functions that can be made const because the functions don’t use this in a non-const way.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Iff3a367401d571f9fcff90539aaab59e2c66e627
show more ...
|
cb6bbfd4 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability checks on repo
The readability-* checks in Clang-Tidy focus on improving code readability by enforcing guidelines and suggesting improvements that can enhance the clar
clang-tidy: Enable readability checks on repo
The readability-* checks in Clang-Tidy focus on improving code readability by enforcing guidelines and suggesting improvements that can enhance the clarity and maintainability of C++ code.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: If69d468f6303df4ec782a3b7c7453a60ddae1e4e
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 ...
|
6c86e631 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Add performance checks
The checks are valuable for improving the runtime efficiency and resource utilization of your programs.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-
clang-tidy: Add performance checks
The checks are valuable for improving the runtime efficiency and resource utilization of your programs.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: If3750c67d40ce482e3f68bad384395b166ed07c9
show more ...
|
d9cc9399 | 23-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: clang-tidy: Add few misc checks
Checks that encompass various miscellaneous guidelines and rules that don't fall into more specific categories like readability, performance, or correctne
clang-tidy: clang-tidy: Add few misc checks
Checks that encompass various miscellaneous guidelines and rules that don't fall into more specific categories like readability, performance, or correctness. These checks often focus on code quality, stylistic preferences, or potential pitfalls that are not covered by other specific checks.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I4074c495a61e0804ed375e402756ac84abdfc598
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 ...
|
ca8a7d6e | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Add few cppcoreguidelines check
These checks cover a wide range of best practices and recommendations aimed at improving the safety, readability, maintainability, and performance of our
clang-tidy: Add few cppcoreguidelines check
These checks cover a wide range of best practices and recommendations aimed at improving the safety, readability, maintainability, and performance of our C++ codebase according to the C++ Core Guidelines.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I605971bfa0c8126e9b5f7bfa9591e26b09f27460
show more ...
|
dcb01109 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Add clang-analyzer checks
This checks primary purpose is to identify potential bugs,security vulnerabilities, and adherence to coding standards by examining the source code without execu
clang-tidy: Add clang-analyzer checks
This checks primary purpose is to identify potential bugs,security vulnerabilities, and adherence to coding standards by examining the source code without executing it.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I20e57618262f337886d191d092d8f3606fe70641
show more ...
|
3e35b501 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Add cert checks
clang-tidy provides a wide range of checks, including those that cover CERT guidelines, through various modules and checks specifically designed to catch potential securi
clang-tidy: Add cert checks
clang-tidy provides a wide range of checks, including those that cover CERT guidelines, through various modules and checks specifically designed to catch potential security vulnerabilities and non-compliance with secure coding standards.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: If349a29226649524cfef0123f8e306ab22e63e67
show more ...
|
489554a1 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Add clang-tidy to phosphor-psu-code-mgmt
This commit enables clang-tidy and adds few tidy checks.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I27e675411b172482a12de45c
clang-tidy: Add clang-tidy to phosphor-psu-code-mgmt
This commit enables clang-tidy and adds few tidy checks.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I27e675411b172482a12de45c7bc3f352f9b3a038
show more ...
|
b971f958 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
vendor-example: Remove unused variables
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Ied841ed523faf8a51b9f4dd991e122a029278df8 |
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 ...
|
7b8a1ef0 | 29-Jul-2024 |
George Liu <liuxiwei@ieisystem.com> |
README.md: Fix MD031 warnings
The following warnings are generated by using markdownlint analysis: ``` MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "``
README.md: Fix MD031 warnings
The following warnings are generated by using markdownlint analysis: ``` MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```text"] ``` Refer to markdown-lint [1] to fix MD031 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/031-blanks-around-fences.md
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I2aa71ac5f54645acbb6343b1c83ff0ce332bc83f
show more ...
|
4638e449 | 29-Jul-2024 |
George Liu <liuxiwei@ieisystem.com> |
README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] ``` Refer to markdown-lint [1] to fix MD040 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/040-fenced-code-language.md
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Ia972149545434ca0bf601f4b45b4792e8cdb8304
show more ...
|
935f551c | 29-Jul-2024 |
Rashmica Gupta <rashmica@linux.ibm.com> |
generate-psu-tar: Update private signing key
Updating from 1024 bits to 4096 bits for a more secure key
Change-Id: Idba3bcd11e55edaf75c4711da04bd57d5dd2522c Signed-off-by: Rashmica Gupta <rashmica@
generate-psu-tar: Update private signing key
Updating from 1024 bits to 4096 bits for a more secure key
Change-Id: Idba3bcd11e55edaf75c4711da04bd57d5dd2522c Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
show more ...
|