summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch FWD and REV association namesGunnar Mills2017-09-051-2/+2
| | | | | | | | The forward association should be inventory. The reverse association should be activation. Change-Id: I86f84eed4b5d3488dbd495d7502f134da25caae2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create active associationGunnar Mills2017-09-055-1/+55
| | | | | | | | | | 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>
* Style changes in download_manager.cppGunnar Mills2017-08-311-10/+8
| | | | | Change-Id: Ib7f26fc620301439768095d8d18965e3daa914e3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* download: Check for empty filenameBrad Bishop2017-08-311-3/+6
| | | | | | | | Avoid an unhandled std::out_of_range exception if the client provides an empty filename. Change-Id: Ibfc99eee9adada255052375581bb308f7afa9da4 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* BMC: Restore version and activation dbus objects on BMC reboot.Saqib Khan2017-08-306-32/+155
| | | | | | | | | | | - Read the /media/ dir for active bmc versions. Each active version has a /etc/os-release inside /media/ which is used to recreate the version and activation objects. Resolves openbmc/openbmc#2137 Change-Id: I40e97396b0912095868172a5a6566e2189a3446b Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Create an association to BMC inventory itemGunnar Mills2017-08-294-3/+88
| | | | | | | | | | 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 nodist_noinst and nobase_nodist_includeGunnar Mills2017-08-291-6/+0
| | | | | | | | | | | | nodist_noinst_HEADER is not needed for org/openbmc/Associations/server.hpp. The header file by default is not installed. xyz/openbmc_project/Software/Version/error.hpp does not need to be included, so remove nobase_nodist_include. Change-Id: Ie268ff17aeef2a341842b124e8653f725993fabc Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add "noinst" to generated headerGunnar Mills2017-08-291-3/+7
| | | | | | | Resolves openbmc/openbmc#2221 Change-Id: I16333d013ea76921ab16c7660103433ddc85eb0e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Generate sdbusplus bindings for Associations.Gunnar Mills2017-08-283-4/+30
| | | | | | | | | - Generate sdbusplus server bindings for the org.openbmc.Associations interface in makefile. - Add YAML file that describes the org.openbmc.Associations interface. Change-Id: Ibb83e4828280f0a5383e901b914e40257eb4a7ff Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* style changes to item_updater.cppGunnar Mills2017-08-241-22/+22
| | | | | | | Style changes only Change-Id: I3e518e0d203b862566ad0c54bfa024818a88cf32 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove rw ubi volume delete as part of bmc version delete.Saqib Khan2017-08-222-24/+1
| | | | | Change-Id: Ied7b803219ccc4686c1316e8b7049538bd52c5ff Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add field mode to BMC updaterMichael Tritz2017-08-212-3/+70
| | | | | | | | | | 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>
* BMC: Store RedundancyPriority on System.Saqib Khan2017-08-206-1/+92
| | | | | | | | | | | | | | | 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>
* Check if BMC tarball has all required files during image verifcationMichael Tritz2017-08-181-9/+19
| | | | | | | | | | | In this commit, the image verification process upon BMC image upload is extended such that the existence of all four image files is verified. Previously, only the "image-rofs" file was checked. Resolves openbmc/openbmc#2143 Change-Id: Ieaf774ab12e41a46da53095609d00e007e01421a Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* item_updater: Add a log to indicate duplicate image upload.Saqib Khan2017-08-161-0/+5
| | | | | | | | | | Added a log to indicate that a user tried to upload a BMC version that already exists on the system. Thus no additional software objects were created as one already exists. Change-Id: Ibbc37bf24cd653324d29518ccaff542a13bdc07f Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* BMC: Call emit_interfaces signal for temporary interfacesSaqib Khan2017-08-071-6/+56
| | | | | | | | | | | | | | | | | When an interface is removed, all the interfaces on that dbus object are removed because the object class calls object_removed. The code will be enhanced to handle the removal of interfaces with openbmc/openbmc#1975 . In the mean time, for interfaces that are temporary and removed in the course of the code update flow, do not call emit_object_added and call emit_interfaces_added and removed when they are created and destroyed. Resolves openbmc/openbmc#2096 Change-Id: I2d022e77015b84e2900b2392d4ac97da02478cdf Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add repo description to READMEGunnar Mills2017-08-021-0/+5
| | | | | Change-Id: Ied74251f760ed2127dfbf7c46dec249d9ff10cc6 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* BMC Activation: Implement ActivationProgress interfaceMichael Tritz2017-08-012-0/+45
| | | | | | | | | | | | | | 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>
* Miscellaneous improvements to activation/item updaterMichael Tritz2017-08-014-15/+40
| | | | | | | | | | | | | | | | | | | 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>
* item_updater: Added erase methodLeonel Gonzalez2017-07-264-4/+102
| | | | | | | | | | | 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>
* image_manager: Added erase methodLeonel Gonzalez2017-07-262-0/+24
| | | | | | | | Image manager deletes image, image directory, and the version from its map. Change-Id: Ica128927b706257eb8c4b28d3b9d2ac9ca397b91 Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* version: Added erase callback and delete methodLeonel Gonzalez2017-07-263-0/+28
| | | | | | | | | Added erase callback, and delete method as part of implementing image Object.Delete to delete images. Change-Id: If3251138c79e05693217fa3ae3f5b238e9c61df4 Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Activation: Start service files and wait for completionMichael Tritz2017-07-212-19/+142
| | | | | | | | | | | | 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>
* Item Updater: Implement BMC factory resetMichael Tritz2017-07-183-10/+32
| | | | | | | | | 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-134-0/+117
| | | | | | | | | | | | | - 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: style simplificationSaqib Khan2017-07-052-14/+19
| | | | | | | Resolves openbmc/openbmc#1715 Change-Id: I99bc8cfc96c791c602f807cfb6ba274be82ecc9f Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* item_updater: Use Common.FilePath to locate imagesSaqib Khan2017-06-303-20/+22
| | | | | | | | | 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>
* Change image_manager.cpp to accept the correct purposeLeonel Gonzalez2017-06-261-17/+4
| | | | | Change-Id: If8961a8582f1d25fa4275d915795beb50366060f Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Move Active BMC version object to item_updater.Saqib Khan2017-06-2611-133/+71
| | | | | | | | | - 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-153-20/+42
| | | | | | | | | 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-052-9/+74
| | | | | | | | | | | | - 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>
* Create Constructor for BMC ActivationSaqib Khan2017-06-023-2/+99
| | | | | | | | | | | | - 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>
* item_updater: match activations on Purpose::SystemPatrick Williams2017-05-301-1/+3
| | | | | | | | | item_updater was only matching on Purpose::BMC, but Purpose::System is full-system images (BMC + Host) so match on those as well. Change-Id: Ic20b13df246949224840b26f1fae6f9eac6d5e29 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* use new sdbusplus match constructorsPatrick Williams2017-05-302-38/+31
| | | | | Change-Id: Ib2dc2b482448422c8497da3af269047288f2159a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Remove unnecessary namespaceGunnar Mills2017-05-241-1/+1
| | | | | Change-Id: I69123c1c3ea66595d0a1deafbf2f8705fe58660e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add check for image dirGunnar Mills2017-05-241-0/+4
| | | | | | | If the image dir exists already, delete it. Change-Id: I36242ee50d8af828784efa54a46f92ca3e3c971f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create activation interface on BMC version dbus creationGunnar Mills2017-05-244-18/+97
| | | | | | | | | Create an activation interface on BMC version dbus creation. For now, set all versions with a purpose of "BMC" to Active. Resolves openbmc/openbmc#1532 Change-Id: Ia253c5744bf7808191f2f1814734dab426edc1a5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create initial BMC Item UpdaterGunnar Mills2017-05-247-2/+169
| | | | | | | This is the initial BMC Item Updater. Change-Id: I1c4f8ec94d7d35a0e03a363007b79414b20058ac Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create error log on failGunnar Mills2017-05-246-0/+346
| | | | | | | | Use elog to create error log on fail. Resolves openbmc/openbmc#1352 Change-Id: I1c362390110c5b3fcae3335a0bd0a7dd11540883 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create version dbus objectGunnar Mills2017-05-245-26/+110
| | | | | | | | | | Read the version and purpose from the manifest. Compute the id from the version. Create the image dir, <IMAGE_UPLOAD_DIR>/<id>/. Create the version object with the version, purpose, id and image dir path. Change-Id: I6d2d710fb8eeeda085af8ab116f2dafc720a2ade Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Untar tarballGunnar Mills2017-05-243-0/+161
| | | | | | | | | Untar the tarball to the image dir. The image dir is <IMG_UPLOAD_DIR>/<id>/. The MANIFEST is first extracted, the version is read from the MANIFEST and used to compute the id. Change-Id: Ifed01e980202404e104ce7c20beb85ab23527913 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Check if image upload dir existsGunnar Mills2017-05-241-0/+12
| | | | | | | | The inotify doesn't work if the image upload dir doesn't exist. If the image dir doesn't exist log an error. Change-Id: I2b8c49182f2f19b8343587f4723575b6f6fc8781 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Rename class Version to BMCVersionGunnar Mills2017-05-115-17/+21
| | | | | | | | | | | The class Version is renamed to BMCVersion. This is needed so there is not 2 classes with the same name, Version, under namespace phosphor software manager. This name is more appropriate for the BMC Version Class that handles the active BMC code. Change-Id: I9eef4f5240f6cac90a31d6c31aa7f518213830e3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Move version gtests to phosphor-bmc-code-mgmtGunnar Mills2017-05-116-5/+131
| | | | | | | | | | | Moving the version gtests from openpower-pnor-code-mgmt to phosphor-bmc-code-mgmt. This code has been reviewed before, the only changes are renaming to "namespace phosphor", changes related to renaming the files, and changes related to renaming function getVersion to getValue. Change-Id: Id799fcfff8effbb4c63f1f4e7169aa425567dd41 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Call processImage from inotifyGunnar Mills2017-05-114-7/+55
| | | | | Change-Id: I0b748f93f8e34552cef67616317c28660284ac99 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Change inotify to look at IN_CLOSE_WRITE flagGunnar Mills2017-04-271-2/+2
| | | | | | | | | The inotify is triggering before the image is done downloading. This leads to a corrupted tar. Look at the IN_CLOSE_WRITE flag instead. Change-Id: Ib9d3f97ae3c48960a0bdf84250a66d1f8254a7f5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Sanitize FileName stringGunnar Mills2017-04-272-4/+11
| | | | | | | | For security reasons, the FileName string must be sanitized. Resolves openbmc/openbmc#1331 Change-Id: I90aeda32421caf16e6919cffb71dd0450e4cf868 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create image dir if neededGunnar Mills2017-04-272-1/+11
| | | | | Change-Id: If1c1a62292027ae98d1ba1c6d62bd72d0ae8a307 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create error log on failGunnar Mills2017-04-271-0/+14
| | | | | | | Use elog to create error log on fail. Change-Id: I27863f5102f56fa04defbab1831c462bf152f771 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Call tftpGunnar Mills2017-04-271-0/+40
| | | | | | | | | Call tftp using fork/exec. The file is downloaded to /tmp/images/ which the inotify daemon will monitor. Change-Id: Id69fea183503dd95181acb9bcdb57c1e6d7bb070 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
OpenPOWER on IntegriCloud