| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The is_method_error() function is no longer needed, instead a
try-catch block should be used instead.
Reference:
https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html,
Change-Id: I1919ea33fc18be2b8afd51fb1f85ddef15041e7c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an activation fails, the version is marked as Failed.
On a subsequent activation, the bmc updater core dumps due
to 2 issues during the freeSpace call:
1. The Failed activation doesn't have a Priority object, so
default its priority to a large value.
2. If the subsequent activation is to the same version id,
then freeSpace should not do an erase on it, because that
removes the activations object that it's trying to activate.
Tested: Verified that doing an activation after a version
was marked as Failed did not core dump the updater anymore.
Change-Id: Iba36497b53738e00283cfec55e8c666f943cd5d5
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Update the .clang-format file.
Now includes header sorting and updating PointerAlignment.
Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The service that sets the priority value is unique to the ubi
layout because there is only one version at a time on the
static layout.
Move the calling of the service to the ubi implementation.
Tested:
- Witherspoon: Priorities are still set.
- Romulus: The BMC.Updater app does not core dump with the
latest sdbusplus changes due to calling a non-existent service.
Change-Id: Ica1c68f00d5cb43c51ee09c5a3851613edf941d5
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bmcImages were in image_verify.hpp but it is used not only in image
verification, but elsewhere.
Move it into a more generic header file, images.hpp, so it makes more
clear that users of bmcImages include images.hpp instead of
image_verify.hpp
Tested: Verify the code pass the build.
Change-Id: If9adf315eee9047d9d08ab93ed7c0ff3c97f7a1e
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable signature verification on non ubifs build.
The code is the same for ubifs and non ubifs, so move related code into
separated functions.
Tested: Verify that the signature check happens during code update, and
successfully updated the code when the image is valid;
verify it fails to update in field mode when the image is
modified.
Change-Id: I81a536fb7ea05d804fa592c57bbed8f32f07a559
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add ubifs_layout as config argument, so a build could select if it
needs ubifs_layout feature or not.
Add code to update non-ubifs layout image by
1. Putting the bmc image in /run/initramfs;
2. Set its state as Active when it is ready to update
3. Let user to initiate the reboot request
Tested: Generate a tarball with Romulus bmc image and manifest,
update it with REST API (image upload, activation, and reboot)
Verify the code update works well in WebUI.
Change-Id: I5b122211fafb7cb9d96ee67317db139ed0b7d0a7
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle exceptions from the sdbusplus method call_noreply API.
The Activation constructor was subscribing to systemd signals, which
would cause an "Already Subscribed" error when creating multiple
Activation instances because the bus is common.
There is no reason to subscribe to systemd signals in the constructor,
since the signals are only triggered during the activation process.
Move the Subscribe call to the activation process which calls
Unsubscribe at the end.
There's a scenario where there could still be an "Already Subscribed"
error if the activation fails, so add error handling there.
Tested: Verified code update worked with this change, and the app
would not core dump with the latest sdbusplus changes.
Change-Id: I065baca2586fa64c138d847187303464123cc01a
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the code that monitors for ubi services into the ubi
subdirectory. Other filesystem layouts can just ignore
the service monitoring by setting the *VolumeCreated
variables to true.
Tested: Verified code update on Witherspoon still worked.
Change-Id: I135e66225d0e8d692d430efd864252b822b069db
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the code that creates the ubi volumes into a separate
write flash function to make it easier to implement
different flash write functions for other flash layouts.
To implement a different write flash function:
1. Modify the Makefile.am file to include the desired code
location. Ex:
if UBI
include ubi/Makefile.am.include
else
include <other>/Makefile.am.include
2. Implement the Activation::flashWrite in <other>/flash.cpp
Tested: Verified code update still worked.
Change-Id: Ide4d135695dad27e0dc1b5a776a276dfb2ca9aa6
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit e24fd6f7deadddc2867b2c417590da0ff093e5e2.
The code that waits for the service file to complete causes
intermittent issues, so will be reverted.
Change-Id: I830f8a2e4914694889c3626bb67bd1fe422e984d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 4c3edc911ba880f7643f15679018c436aa94e0aa
The code now blocks until the updateubootvars service completes
(https://gerrit.openbmc-project.xyz/#/c/9418/) so there is no
need to monitor this service anymore.
Tested: Verified that the activation still waits for the env vars
to be upated before completing the activation process:
Apr 06 16:58:07 witherspoon systemd[1]: Started Store read-only images 84fb16be to BMC storage.
Apr 06 16:58:07 witherspoon systemd[1]: Starting Set U-Boot environment variable...
Apr 06 16:58:08 witherspoon systemd[1]: Started Set U-Boot environment variable.
Apr 06 16:58:08 witherspoon systemd[1]: Starting Updates the u-boot variable to point BMC version to 84fb16be...
Apr 06 16:58:11 witherspoon systemd[1]: Started Updates the u-boot variable to point BMC version to 84fb16be.
Apr 06 16:58:11 witherspoon phosphor-image-updater[1919]: BMC activation has ended - BMC reboots are re-enabled.
Change-Id: I6b98c2136948ddd251c4070f697ce1eda66214d6
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Added support to stop the codeupdate only for the fieldmode
enabled systems, for signature validation failures.
Change-Id: Icaea4c7c80eca42a22794bbb67d93b8a95058ab8
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Spelling errors found using github.com/lucasdemarchi/codespell
A tool to fix common misspellings.
This tool is licensed under GNU General Public License, version 2.
Tested: Built the repo
Change-Id: I4fb378699d436e0c41adf80978f7cdaec12c6404
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Added build level support to enable/disable signed
validation using WANT_SIGNATURE_VERIFY flag.
Change-Id: I93bc72a69b877baa9df27272c0b20426069b7557
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Ia899858c11cff6e4fa26b820b35b1e5dca1b57df
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Enable the service that blocks reboot within the constructor
of ActivationBlockTransition, so that the user can't reboot BMC
while code update is in progress.
- Once the code update is complete the destructor of
ActivationBlockTransition will disable any reboot guard that
prevents user from rebooting the BMC.
Tested: Verified that the user is unable to reboot during the activation
process and that journal logs are present to indicate why the user is
unable to reboot.
Resolves openbmc/openbmc#1944
Change-Id: Ia149a76bcf093b011fe243fc609ae83358a0f933
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new function to delete version objects as part of the Activation.
The code update service automatically removes the ubi volumes to make
space, but it does not remove the dbus object associated with the
removed volume. The side effect of leaving the dbus object is that
when freePriority() is called at the end of the Activation, a new
priority value is assigned to all version dbus objects (including the
deleted one) which fills up the u-boot environment variables.
Tested: Verified that after an Activation, there were only 2 priority
values in the u-boot env variables instead of 3, and they corresponded
to existing volumes.
Change-Id: I41a7ea95eeea1c8a2cb8ce4b41671e77f5c42cac
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- The logging interfaces don't support std::string, so need to pass
c-strings to the metadata fields, or the pointer address will be
the one added to the log.
- Log the name of the file uploaded to the BMC instead of the
manifest path when there is a manifest error. The manifest path
is always /tmp/imgXXXX/MANIFEST which doesn't help debug.
- Check the status of the child process after waitpid returns. The
execl call returns when there was an error executing execl, not
if the command executed failed. This will catch when tar returns
a non-0 return code.
Change-Id: Ia4bd2666fc6beec28dee7e821d959a336800d282
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The service file obmc-flash-bmc-updateubootvars@.service
updates the boot environment variables to point to the
newly updated image. Need to wait for this service to finish
before marking the update as complete. Otherwise the user may
reboot the system while the env vars are being updated thinking
that the update has completed because the Activation value would
be set to Active.
Resolves openbmc/openbmc#2764
Change-Id: Ic33cf62e46555c9925385bb5d9d28de9aeee85a1
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Activation code monitors the systemd service files that
create the volumes, and sets the value to Activating if the
services are running, or Failed if they fail.
This monitoring code checks the name of the service file for
when it fails, but it wasn't checking it for when it succeeds,
leading to any systemd file that finished to trigger calling
the Activation function multiple times.
Also avoid removing the Priority object if the requested
Activation value is Activating, since that's what the value
the monitoring code calls during the update.
Part of openbmc/openbmc#2764
Change-Id: Ib6681ce5d63d184a2ee9ffe05c083e1085efd2ac
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When deleting the updated image from the Version object,
the code would query the mapper to get the busname. This
call would return 2 busnames, the one for the Activation
object and the one for the Version object. Then the code
would call Delete on the first busname on the list which
would be the Activation one, causing an error because the
running image can't be deleted from the Activation object.
Instead of querying the mapper for all busnames of a path,
and adding logic to figure out which one is the Version one,
the updater already knows the Version busname, so just use
that directly.
Part of openbmc/openbmc#2764
Change-Id: Ia490e11c0fd312fe0c05279964c2cb0c4461ccb3
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Implement delete interface inside version class
so that both item_updater and image_manager can
share the same interface. This meant removing the
delete interface from inside the activation class.
- The delete is created as a separate object inside
version, only if the image is non-functional.
This helps remove the delete interface from a
running BMC/HOST image.
- As part of the activation process, the version from
inside the image_manager is deleted and so is the
version's tarfile from the image upload dir.
Partially resolves openbmc/openbmc#2490
Change-Id: Ib35bf188df85ebd2277d3d9ad04300e434965eea
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recursive nature of calling the free priority function
would trigger setting the u-boot env multiple times.
Make a change so that the priorities are sorted and
updated once.
- Create a non-overriden priority setter function to be called
by the free priority function and by the function that creates
the dbus objects after a bmc reboot. There's no need to call
to free the priorities after reboot since the priorities are
preserved on the bmc, and if they're not they default to 0 or 255.
- When a dbus request is made to update the priority, update
the value, then call the free priority function, which will
sort the versions by priority and bump the priority of any
duplicate ones.
Resolves openbmc/openbmc#2535
Change-Id: Ib92cc0ca6c4d5f6e986f3cde7156d63b53844b46
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit enhances the functionality of the BMC software updater.
Previously, each BMC version uploaded to the system would implement the
Object.Delete D-Bus interface, including the version currently running
on the BMC. In principle, this is a pretty major issue - at best, the
Delete would do nothing to the current version but throw an error, and
at worst, it could partially remove it and cause problems.
This commit fixes that problem by moving the Delete implementation into
a separate object for each activation and removing that interface for
the current version.
Resolves openbmc/openbmc#2335
Change-Id: I721b7455c9fb309ecbb50f807aaa44a16d51ba5a
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- If the new priority is the lowest then set the uboot to point
to that particular version
- Otherwise reset the Uboot environment variable to find the version
with the lowest priority and then set that in uboot.
Resolves openbmc/openbmc#2512
Change-Id: Id27e78a85662e0ff2e941515bb467a43c6076d96
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- We need to update the uboot env variables to point to the
version that has the lowest priority when
the version with lowest priority gets deleted or when
the version with lowest priority gets a higher priority
Resolves openbmc/openbmc#2372
Change-Id: If43105c9ee2c3ada8aeb19939a428eb05e621ee9
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
| |
Style changes only.
Change-Id: I29127c1fa45bbe24fd252fb7c0fe95fb229d0129
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- If a BMC is set to the lowest priority then update the u-boot
environment variables so that that system boots from that version
on the next reboot.
Resolves openbmc/openbmc#2284
Change-Id: If0b67b07496f602fa06607bd0685d6394cb8d9fd
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove Delete inheritance and method from Version object.
- Add Delete inheritance and method to Activation object.
- Add a listener in the image Manager for deleted Versions and remove
its 'backup' copy of the Version.
Resolves openbmc/openbmc#2086
Change-Id: If41783319cf1ff5b840b747ba457d0570bc52918
Signed-off-by: Eddie James <eajames@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Create an association between an active image
and the active image's version object.
Resolves openbmc/openbmc#2007
Change-Id: I4fd27235db97a3cee87d2da335245e00ec602fba
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit extends the functionality of the BMC software updater by
preserving RedundancyPriority values through any kind of reset.
This is accomplished by storing priority values in serial files in
/var/lib/obmc/phosphor-bmc-code-mgmt/ using the Cereal library. Each
time a priority value is modified, the value in the corresponding
version file is adjusted.
Resolves openbmc/openbmc#2125
Change-Id: Ie697279895bc5ff5fdef31fa88c78dc2bc63390a
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit extends the BMC activation progress by implementing the
generic ActivationProgress interface, in order to periodically update
the user with the current status of the process.
Dependent on openbmc/openbmc#2031 to avoid crashes in multiple image
scenarios.
Resolves openbmc/openbmc#2030
Change-Id: If52426ea1eae93f32166a255072f813d6a056172
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit slightly enhances and improves the item updater and the
activation process, addressing a few issues that were raised in code
review of openbmc/openbmc#1756
1.) Service file booleans used in activation are reset to false, to
avoid a BMC-flavored issue in the vein of openbmc/openbmc#1984
2.) systemd constants used in multiple places are moved to configure.ac
3.) Activation objects are unsubscribed from systemd signals at the end
of that process.
Resolves openbmc/openbmc#2031
Change-Id: I573645b16bca28ac6bf3b173d5b4845205224e07
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit, the BMC activation flow is implemented. When the user
starts an activation, two service files are called to create read-only
and read-write volumes. Once these service files are finished running,
activation is marked as complete.
Resolves openbmc/openbmc#1756
Change-Id: I3874c2d04a1a2b07eea4e34789ba5ece0ff6979c
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Create Redundancy Priority interface after a successful
PNOR update and set the priority.
- Remove Redundancy Priority interface once the activation
state changes from being Active.
- Create override function for RedundancyPriority.
Resolves openbmc/openbmc#1755
Change-Id: I160dc4a6cad243d58759c71bbeb218aab841cf7a
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
- Create Activation Block Transition
- Create override functions so that actions can be taken
based on the value that the properties are being set to.
- Create ActivationBlockTransition when the Activating
property is set to Activating. Remove it when the property
is set to anything else.
Change-Id: Id48d049cca54ae0bcbed6afe41e67e20e6a5e44c
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|