summaryrefslogtreecommitdiffstats
path: root/item_updater.hpp
Commit message (Collapse)AuthorAgeFilesLines
* item_updater: Call remove association on deleteAdriana Kobylak2018-12-111-3/+3
| | | | | | | | | | | | | | | The remove association function was supposed to be called on delete but was never implemented so if the associations are queried but the version has been deleted, that'd be false information, so call to remove the associations on delete, also rename it to delete all associations, because the delete function already determined if the requested version is functional. Tested: Verified the associations for the requested version are deleted with a DeleteAll and Delete call. Change-Id: Ia4fde01c9500b648660bc9a4c355d44a35af7cc5 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Fix being able to activate a Failed versionAdriana Kobylak2018-09-191-1/+3
| | | | | | | | | | | | | | | | | 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>
* clang-format: Update to match docs repoGunnar Mills2018-09-111-3/+4
| | | | | | | | Update the .clang-format file. Now includes header sorting and updating PointerAlignment. Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Move setting the priority U-Boot variable to ubiAdriana Kobylak2018-07-191-0/+9
| | | | | | | | | | | | | | | 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>
* item_updater: sort ubi specific codeLei YU2018-07-171-1/+5
| | | | | | | | | | Add item_updater_helper and implement it in ubi and static layouts. Tested: Build this repo on both Romulus and Witherspoon OK; Tested on Romulus and Witherspoon that code update works fine. Change-Id: I706cfe63900f89bb41672dcc745b3483e06838c7 Signed-off-by: Lei YU <mine260309@gmail.com>
* Perform uboot mirroring operation during BMC bootEddie James2018-05-031-0/+5
| | | | | | | | | | Add a function to call the "mirror u-boot" service when the BMC boots. Since the BMC is booting, we know we had a good u-boot and u-boot environment, so we can safely copy the current one to the alternate chip. Change-Id: Ib628ea4a5fc9ae8d80f1047bddf94eb3fa52cdba Signed-off-by: Eddie James <eajames@us.ibm.com>
* Enable clang code formatAdriana Kobylak2018-03-021-186/+182
| | | | | Change-Id: Ia899858c11cff6e4fa26b820b35b1e5dca1b57df Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Call freeSpace() function before updateAdriana Kobylak2018-02-161-0/+9
| | | | | | | | | | | | | | | | | 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>
* Call update u-boot env once when a priority is changedAdriana Kobylak2017-10-301-6/+15
| | | | | | | | | | | | | | | | | | | | | | 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>
* Update Uboot environment variables when a version is deleted or updatedSaqib Khan2017-10-231-0/+7
| | | | | | | | | | | | - 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 and comment changes in item_updater.hppGunnar Mills2017-10-081-68/+65
| | | | | | | | Style and comment changes only. A similar change was made in openpower-pnor-code-mgmt. Change-Id: I5ad5cb37267983a1749847599d379e437e818540 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* BMC Updater: Add function to delete all versionsMichael Tritz2017-09-291-1/+7
| | | | | | | | | | This commit extends the item updater with a function to delete all non-current versions uploaded to the machine. Resolves openbmc/openbmc#2264 Change-Id: I4d835d5020766f8bb5e9653b28535acfb191fe53 Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* BMC: Update u-boot environment variable based on lowest prioritySaqib Khan2017-09-281-2/+12
| | | | | | | | | | | - 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>
* Change to pass by referenceGunnar Mills2017-09-261-2/+2
| | | | | | | | removeActiveAssociation and createActiveAssociation should be pass by reference. Change-Id: If9396b4ab36fc4497db0cf0b6da7e04a2c6c4055 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create BMC functional AssociationGunnar Mills2017-09-261-0/+7
| | | | | | | Create a functional association for the "running" BMC image. Change-Id: Id254df06b4361b418e765cc5222b1e1ee0d348a3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create active associationGunnar Mills2017-09-051-1/+23
| | | | | | | | | | 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>
* Create an association to BMC inventory itemGunnar Mills2017-08-291-0/+8
| | | | | | | | | | Create an association from /xyz/openbmc_project/software/<id> to the BMC inventory item. To determine the BMC inventory item path, look for paths under /xyz/openbmc_project/inventory/system/chassis/ that end in /bmc. Change-Id: I8da748743368e3e607b30a76a6729829dcceec54 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove rw ubi volume delete as part of bmc version delete.Saqib Khan2017-08-221-8/+0
| | | | | Change-Id: Ied7b803219ccc4686c1316e8b7049538bd52c5ff Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add field mode to BMC updaterMichael Tritz2017-08-211-2/+18
| | | | | | | | | | In this commit, a "field mode" feature is added. When field mode is enabled, the PNOR patch path is unmounted, disabling host patches. Resolves openbmc/openbmc#1350 Change-Id: Ia207b1fe1cdeb1b4fbf9b2fbf77052d7191ea726 Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* item_updater: Added erase methodLeonel Gonzalez2017-07-261-0/+22
| | | | | | | | | | | Implements Object.Delete, so item_updater deletes ReadWrite, ReadOnly partitions, and removes Version, and Activation from maps. Resolves openbmc/openbmc#1550 Change-Id: If6d08bc7d380d043c28a26570e4698201cd7f5b0 Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Item Updater: Implement BMC factory resetMichael Tritz2017-07-181-9/+11
| | | | | | | | | This commit implements the generic factory reset interface for the BMC software updater. When the reset function is called, a service file is called which sets the environmental variable to reset the RW volume. Change-Id: Ic69b5d145edd654ed75295a9e9aeef9f53779dad Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* BMC: Implement Software RedundancyPriority.interfaceSaqib Khan2017-07-131-0/+9
| | | | | | | | | | | | | - 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>
* item_updater: Use Common.FilePath to locate imagesSaqib Khan2017-06-301-2/+2
| | | | | | | | | The image manager implements the Common.FilePath.Path interface, make use of it to find the image files instead of hardcoding the path, since the updater shouldn't know/care where the images are. Change-Id: Ieb9ad8e393a7f91645631db9f302095eb82d7f61 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Move Active BMC version object to item_updater.Saqib Khan2017-06-261-0/+6
| | | | | | | | | - There needs to be only one version class for both BMC and PNOR images. Thus removing the BMCVERSION class and moving the functionality to MANAGER class. Change-Id: I6dda818960588cfd9ed345fe93068531efc7a877 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* item_updater: Add version dbus object.Saqib Khan2017-06-151-0/+6
| | | | | | | | | Implementing the Version object under item_updater helps to retain the version of the active images after the bmc is rebooted and the image_dir no longer holds version file. Change-Id: I55349bbc62b212b4e034239f4f6743129c8b1070 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* ItemUpdater: Validate BMC squashfs imageSaqib Khan2017-06-051-0/+22
| | | | | | | | | | | | - Validate the image dir by checking its content. - Set Activation to "Active" if current image, "Ready" if validation passed and "Invalid" if validation fails Resolves openbmc/openbmc#1629 Change-Id: I5f1c42fb2ba93c849ea8653c9e81c737ae27c814 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* use new sdbusplus match constructorsPatrick Williams2017-05-301-12/+12
| | | | | Change-Id: Ib2dc2b482448422c8497da3af269047288f2159a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Create initial BMC Item UpdaterGunnar Mills2017-05-241-0/+69
This is the initial BMC Item Updater. Change-Id: I1c4f8ec94d7d35a0e03a363007b79414b20058ac Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
OpenPOWER on IntegriCloud