62f3820b | 29-Sep-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Update u-boot if needed
Calculate a hash over the u-boot image file and the mmc device where u-boot is stored to determine if it needs to be updated.
Tested: Verified that after the mmc device
mmc: Update u-boot if needed
Calculate a hash over the u-boot image file and the mmc device where u-boot is stored to determine if it needs to be updated.
Tested: Verified that after the mmc device is updated, an update to the same image does not rewrite the device where u-boot is.
Change-Id: I9f3cb8cc639512c02030b7be34845a67f3e15319 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
34077dc9 | 11-Sep-2020 |
Gunnar Mills <gmills@us.ibm.com> |
Fix flash-layout.md link
31de159f moved flash-layout.md to architecture/
Change-Id: I023e0a8c061b5efa74a7c850a6249627f03bf536 Signed-off-by: Gunnar Mills <gmills@us.ibm.com> |
d148b4f0 | 27-Aug-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Remove hostfw patches on update
Remove the hostfw patch for the alternate side during code update since that's the side that's been updated and the patches may not be compatible with the new fi
mmc: Remove hostfw patches on update
Remove the hostfw patch for the alternate side during code update since that's the side that's been updated and the patches may not be compatible with the new firmware level.
Change-Id: I95eda772334673890b772587bfc89698fefbd4c6 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
13e09911 | 31-Aug-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
image_manager: Delete image dir if same version exists
If the uploaded version already exists, no version D-Bus object is created, but the directory in /tmp/ with the image files remain even though
image_manager: Delete image dir if same version exists
If the uploaded version already exists, no version D-Bus object is created, but the directory in /tmp/ with the image files remain even though there is no use for it, also there is no way for the user to delete it except rebooting the BMC. This takes up space and may cause subsequent uploads to fail with out-of-space. Delete it if the version already exists.
Tested: Uploading the same image deletes the dir in /tmp.
Change-Id: I9518f8132c18c2e7a20e330e8f894caa7bab6236 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
c31943e1 | 29-Jul-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Remove: Sleep to allow service to finish
There's not currently a good solution for waiting for systemd service files before returning from a function. The way to achieve this is to add a sleep
mmc: Remove: Sleep to allow service to finish
There's not currently a good solution for waiting for systemd service files before returning from a function. The way to achieve this is to add a sleep before returning.
Need to add a sleep for the mmc remove function to allow the device to be erased before the update, otherwise the delete and update may run at the same time causing corruption.
This race condition is not seeing in ubi because the update creates a new volume for the image, while in the background the old volume is being erased, although this could still cause issues if space is tight and the delete is not finished by the time the new image is written, but this issue hasn't been seen so focusing on mmc only for this commit.
Tested: Verified no corruption was seen on the tacoma system where the issue was reported.
Change-Id: I89eeb97b357cc6a0eb0bf01aa9ac4147cab6168a Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
8e9ccfe7 | 18-Nov-2019 |
Bright Cheng <bright_cheng@wiwynn.com> |
Add support for full BMC FW flash image
Add BMC flash file name list for full flash image. Save the information for which images are being updated.
Tested: Update '.static.mtd.all.tar' with redfish
Add support for full BMC FW flash image
Add BMC flash file name list for full flash image. Save the information for which images are being updated.
Tested: Update '.static.mtd.all.tar' with redfish API ( UpdateService.SimpleUpdate). Verified the code update works well.
Change-Id: Icb47e518db61a8d17998179aed328d0cf56db6f5 Signed-off-by: Bright Cheng <bright_cheng@wiwynn.com> Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
21dad047 | 26-Jun-2020 |
Miguel Gomez <mgomez@mx1.ibm.com> |
BMC Minimum ship Level
This code compares the BMC_MSL defined at compile time, It will parse the new fw (explicit at MANIFEST file) and use regex to evaluate it and compare BMC_MSL against version
BMC Minimum ship Level
This code compares the BMC_MSL defined at compile time, It will parse the new fw (explicit at MANIFEST file) and use regex to evaluate it and compare BMC_MSL against version from MANIFEST. If newer or equal it will apply, otherwise it will fail, preventing activation operation.
Tested: regex-bmc-msl="([a-z]+[0-9]{2})+([0-9]+).([0-9]+).([0-9]+)" fw-package="version=fw1010.00-28.4-0-ge611abca21" bmc-msl="fw1010.00-27" proceeds with activation... bmc-msl="fw1010.00-29" returns:
Jul 15 20:35:45 tacoma1z-w81 phosphor-image-updater[766]: BMC Minimum Ship Level NOT met
Jul 15 20:35:45 tacoma1z-w81 phosphor-image-updater[766]: A system component has a software version that is incompatible as determined by the implementation and needs to be updated....
Signed-off-by: Miguel Gomez <mgomez@mx1.ibm.com> Change-Id: I0ab0eba7c7c89f38ca698aa3e369aa50797edb07
show more ...
|
5312d854 | 18-Jul-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Enhance get running partition label function
The mount -l command may not show the filesystem label after a code update since the this filesystem label is part of the image when it gets built.
mmc: Enhance get running partition label function
The mount -l command may not show the filesystem label after a code update since the this filesystem label is part of the image when it gets built. Therefore determine the running partition via the device then map it to the partition label (partlabel) which doesn't change. Also return the label only if found, don't assume that because 'a' didn't match that the device should be 'b'.
Tested: Verified the right label was found.
Change-Id: Id50223e21e9c6cc280f98f2b928d37a36de48cc9 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
8c5209d3 | 12-Jul-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Add support for update/delete hostfw
The hostfw image file can be delivered in the code update tarball. If it is, then update it (copy the file to the hostfw partition directory.
To delete it,
mmc: Add support for update/delete hostfw
The hostfw image file can be delivered in the code update tarball. If it is, then update it (copy the file to the hostfw partition directory.
To delete it, need to first unmount the secondary (non- running) hostfw mount, then delete the file.
Change-Id: I352dd017114d58b79f9e624983841eafce5badf1 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
73609bb5 | 18-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
Add support for optional images
Add support to allow optional image files in the BMC tarball. This can be used for example to add a host bios file in a "System" image, or for elements that as best p
Add support for optional images
Add support to allow optional image files in the BMC tarball. This can be used for example to add a host bios file in a "System" image, or for elements that as best practice should not be updated unless necessary like for a bug fix, such as the U-Boot SPL.
This commit provides the ability to add these optional images from a list of pre-defined names. These files will then go through the same checks as the default image files such as checking the files exist and the signature verification (if enabled) passes.
Change-Id: I304b4e28c776db4a51537613888b4e11824cab88 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
d7fbc1e3 | 06-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Add mount services
The iterm updater relies on the versions being mounted in the MEDIA_DIR in order to create the D-Bus objects when the BMC first starts up.
Create two services: one to mount
mmc: Add mount services
The iterm updater relies on the versions being mounted in the MEDIA_DIR in order to create the D-Bus objects when the BMC first starts up.
Create two services: one to mount the emmc rootfs partitions so that the version D-Bus objects get created, and another one to unmount them after the item updater has run because there's no need to keep the mounts around, actually they shouldn't be mounted during a code update. The UBI layout does an unmount at the start of an update, but it's less risky to just unmount once the mount is no longer needed in case the update is done manually by starting the update service file or directly calling obmc-flash-bmc.
These services get started automatically by adding a dependency to the item updater service: "WantedBy=xyz.openbmc_project.Software.BMC.Updater.service" The mount has a "Before" directive and the unmount has an "After" directive. This allows the item updater to have the mounts available for processing and they are unmounted once the processing is complete.
Also add a dash "-" to ExecStart to ignore errors: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= This is needed since the non-running filesystem may had been invalidated during a Delete operation. This directive still logs an error but does not put the service file in Failed state: Ex:
Jul 11 16:36:07 rainier systemd[1]: Starting Mount BMC rofs volumes after a reboot... Jul 11 16:36:07 rainier sh[423]: mount: /media/rofs-b: wrong fs type, bad option, bad superblock on /dev/mmcblk0p5, missing codepage or helper program, or other error. Jul 11 16:36:07 rainier systemd[1]: obmc-flash-mmc-mount.service: Succeeded. Jul 11 16:36:07 rainier systemd[1]: Finished Mount BMC rofs volumes after a reboot. Jul 11 16:36:07 rainier systemd[1]: Started OpenBMC Software Update Manager. Jul 11 16:36:07 rainier systemd[1]: Starting Unmount BMC rofs volumes... Jul 11 16:36:08 rainier umount[427]: umount: /media/rofs-b: no mount point specified. Jul 11 16:36:08 rainier systemd[1]: obmc-flash-mmc-umount.service: Succeeded. Jul 11 16:36:08 rainier systemd[1]: Finished Unmount BMC rofs volumes.
Tested: Verified the D-Bus version objects are created after BMC reboot, and the item updater service starts successfully after a Delete operation.
Change-Id: Ic0c83391a2879b8508bf5aa9f18941590d96352d Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
34124351 | 22-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Set updated version to primary
Once the update is successful, mark the version as primary so that it boots from the updated version upon BMC reboot.
Add a sleep to wait for the service file to
mmc: Set updated version to primary
Once the update is successful, mark the version as primary so that it boots from the updated version upon BMC reboot.
Add a sleep to wait for the service file to complete setting the primary version. Otherwise, the BMC could mark a Delete or Priority value change as complete and the service is not done yet, and if the BMC is rebooted it could try to boot from a non-existent version.
As backgroung, reference issue openbmc/openbmc#2857 that attempted to create a 'wait for service' function but was not successful. This could be investigated further at a later time, which would benefit other functions like Factory Reset that are also using sleep as a workaround to wait for systemd service files.
Tested: Verified the version was set to primary during code update and delete, and that 3s passed (service file finished in about 1s) before the delete/update continued.
Change-Id: I4f9afdb020d8cc7c18cfdafe468dbff2dc8046c1 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
70f5bc04 | 13-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Update and remove functions for the kernel and rootfs
Add support for update and remove of eMMC images.
The code update tarball contains an image-kernel and image-rofs files. These can be flas
mmc: Update and remove functions for the kernel and rootfs
Add support for update and remove of eMMC images.
The code update tarball contains an image-kernel and image-rofs files. These can be flashed directly to the eMMC partitions since they're filesystem files compressed with zstd:
https://gerrit.openbmc-project.xyz/c/openbmc/meta-phosphor/+/30781 https://gerrit.openbmc-project.xyz/c/openbmc/meta-phosphor/+/34334
The image-rofs contains the BMC rootfs files, and the image-kernel contains the fitImage file which is loaded by U-Boot.
Tested: Verified the non-running rofs and kernel partitions were updated.
Change-Id: Ic983dec1df389d56f11f12dc2e82589d1a2b9dcc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
d1a55adc | 11-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
item_updater: erase: Call resetUbootEnvVars() first
During erase, move the resetUbootEnvVars() call from the end to the beginning so that the BMC points to a valid image to boot from. If resetUbootE
item_updater: erase: Call resetUbootEnvVars() first
During erase, move the resetUbootEnvVars() call from the end to the beginning so that the BMC points to a valid image to boot from. If resetUbootEnvVars() is called after the image is actually deleted from the BMC flash, there'd be a time window where the BMC would be pointing to a non-existent image to boot from.
Change-Id: I98c69033ee0e9c6e8752200f65f54cfe0f56d130 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
f383d27a | 16-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
item_updater: Ignore duplicate version ids
If the partitions or devices where the BMC images reside are flashed with the same image file, for example during manufacturing process, we'd end up with d
item_updater: Ignore duplicate version ids
If the partitions or devices where the BMC images reside are flashed with the same image file, for example during manufacturing process, we'd end up with duplicate version ids. Ignore that version for now and treat it as non-existent. A subsequent code update would rewrite that partition.
There is a request about being able to support an Accept/Commit operation which would write the current version to the other BMC versions, so that for example a system with versions that contain a security vulnerability can be updated to the fixed version but also overwrite any other old versions to prevent the system from booting from an old version. So eventually we'll add support to show the system with 2 BMC versions that are the same.
Tested: Flashed an eMMC with the same image on both BMC partitions and verified only one d-bus object was created and the software updater didn't crash.
Change-Id: I95c5ed968df074ff56da3f80c07a95505fbdf2cd Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
716cd78d | 08-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
processBMCImage: Dynamically calculate version id
With the UBI layout, the name of the mount directories have the version id because the UBI volume names have the id so it's easy to get.
With other
processBMCImage: Dynamically calculate version id
With the UBI layout, the name of the mount directories have the version id because the UBI volume names have the id so it's easy to get.
With other layouts where static partition names are used, the id is not part of the partition name so it can only be calculated from the version string, which requires to mount the filesystem to read it from the os-release file.
Change the logic to have processBMCImage() calculate the id from the version string for each mounted filesystem instead of the mount directory name, as long as the mount directory name starts with BMC_ROFS_PREFIX, ex: /media/rofs-a. The current UBI mount directory names rofs-<id> continue to work, just the directory name is not used anymore to get the id.
If the os-release file is not found or does not contain a version string, assume it's corrupted and attempt to get the id from the mount directory name.
Tested: Verified in witherspoon that the d-bus objects are created with the expected version ids.
Change-Id: Iff0103c9cbd060c7fb49ff29c48a72f2873f0f32 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
436be816 | 17-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
build: Rename .service files to service.in
Rename the .service files to .service.in to allow service files to support config variable substitution. Ex, this line in .in: ExecStart=/usr/bin/obmc-fl
build: Rename .service files to service.in
Rename the .service files to .service.in to allow service files to support config variable substitution. Ex, this line in .in: ExecStart=/usr/bin/obmc-flash-bmc ubiro @IMG_UPLOAD_DIR@ would become this in .service file: ExecStart=/usr/bin/obmc-flash-bmc ubiro "/tmp/images"
This allows the service files to use the user defined config values instead of making assumptions that the default is used.
This commit only renames the service files. The subsequent commit will make use of this feature.
In addition, the subdir meson.build files were deleted with this commit. The reason is that the service files need to be moved to the main meson.build to be able to read the conf file, and without the service files, the subdir meson.build files are just a couple lines long so there's not really a reason to have a separate meson.build file.
Tested: Verified the service files were installed as before.
Change-Id: I29190d1f0664352fbee8a0ada9de959fd0269d6e Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
ebcc1940 | 22-Jun-2020 |
James Feist <james.feist@linux.intel.com> |
Add new error types
Add ImageFailure and BusyFailure for error reporting. Rerun elog-errors script to generate error data.
Change-Id: I1f9ec4766d510abe612db2453dcf36325c7dd2f4 Signed-off-by: James
Add new error types
Add ImageFailure and BusyFailure for error reporting. Rerun elog-errors script to generate error data.
Change-Id: I1f9ec4766d510abe612db2453dcf36325c7dd2f4 Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
f7a69e1a | 15-Jun-2020 |
Gunnar Mills <gmills@us.ibm.com> |
meson: Set default buildtype to debugoptimized
In general, turning on optimization tends to find more code issues and is closer to how Yocto builds the code. Set 'debugoptimized' as the default bui
meson: Set default buildtype to debugoptimized
In general, turning on optimization tends to find more code issues and is closer to how Yocto builds the code. Set 'debugoptimized' as the default buildtype.
debugoptimized will compile slightly slower, but developers won't encounter issues where it works on their system but doesn't work on CI as often.
Done in sdbusplus here: https://github.com/openbmc/sdbusplus/commit/feb4847245830ad41878851987b59ba837434e3a
Put default_options in alphabetical order for easier scanning.
Tested: Built the code in an sdk. Change-Id: I790f32a0ceb1c1cc2464bbb2ad818007b4ed1944 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
86013f39 | 13-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
Add initial support for eMMC layout
Initial commit to add an mmc layout option to update eMMC chips.
Tested: Compiled with each of the three supported options: 'meson build -Dbmc-layout=<op
Add initial support for eMMC layout
Initial commit to add an mmc layout option to update eMMC chips.
Tested: Compiled with each of the three supported options: 'meson build -Dbmc-layout=<option>' and verified a build/<option> subdir was created.
Change-Id: Idfc9c7f0380daff2d865663dacba23c919386d4f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
24a8d83d | 10-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
item_updater: Use relative path to append OS_RELEASE_FILE
The path append behavior changed between std::experimental and std::filesystem where appending an absolute path replaces the path instead of
item_updater: Use relative path to append OS_RELEASE_FILE
The path append behavior changed between std::experimental and std::filesystem where appending an absolute path replaces the path instead of appending, therefore need to use .relative_path().
This was causing the item updater to recreate the d-bus objects with version OS_RELEASE_FILE instead of MEDIA_DIR/rofs-x/OS_RELEASE_FILE marking the 2 versions of the system functional and with the same version string.
Fixes openbmc/phosphor-bmc-code-mgmt#5
Tested: Verified with debug logs that the path was just OS_RELEASE_FILE without this change, and it was MEDIA_DIR/rofs-x/OS_RELEASE_FILE after this change, the version strings were correct, and only 1 functional BMC association was created.
Change-Id: I2f81942d7fbb24e839e8f712cd2d84a80b7cd125 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
58aa7508 | 08-Jun-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
clang-format: update to latest from docs repo
The openbmc/docs/style/cpp/.clang-format has been updated to support clang-format10, take this opportunity to update it in this repo.
Change-Id: I9e6b9
clang-format: update to latest from docs repo
The openbmc/docs/style/cpp/.clang-format has been updated to support clang-format10, take this opportunity to update it in this repo.
Change-Id: I9e6b9853bf4cd7399b1ae504ea3be5093d763fee Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
5a43b373 | 06-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
meson: build: Remove automake files and update READMEs
Tested: Ran CI and code update on witherspoon.
Change-Id: I4d9695cdddf48e4a4d884fb9b8e30108ee6dfe6c Signed-off-by: Adriana Kobylak <anoo@us.ib
meson: build: Remove automake files and update READMEs
Tested: Ran CI and code update on witherspoon.
Change-Id: I4d9695cdddf48e4a4d884fb9b8e30108ee6dfe6c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
78e72d91 | 05-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
meson: build: Add support for unit tests
Tested: Verified unit test ran successfully: $ meson -Doe-sdk=enabled -Dtests=enabled build $ ninja -C build test ninja: Entering directory `build' [25/26] R
meson: build: Add support for unit tests
Tested: Verified unit test ran successfully: $ meson -Doe-sdk=enabled -Dtests=enabled build $ ninja -C build test ninja: Entering directory `build' [25/26] Running all tests. 1/1 utest OK 3.00 s
Change-Id: I46acccec5b3c1837ead707e4e4610eb61a023148 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
b824b2f4 | 14-May-2020 |
Adriana Kobylak <anoo@us.ibm.com> |
activation: Make activation flow common
The activation flow has a lot of duplicate code such as checking the digital signatures and creating associations, with a few differences depending on the cho
activation: Make activation flow common
The activation flow has a lot of duplicate code such as checking the digital signatures and creating associations, with a few differences depending on the choice of bmc layout configuration.
This makes the code hard to maintain since changes and additions to the activation flow need to be done on more than one place, and also the function becomes bigger and harder to follow. This would be made worse when additional layout supports are added such as eMMC code update support.
Make the flow common and move the specific code to its subdirectory. This requires create a new function to handle the end of the update so that we support implementations that are async (need to wait for systemd service files to finish).
Still need an if/else statement to differentiate the implementations that are synchronous like the static layout and the async ones like the ubi layout since the async ones have the flash write function return immediately and can call the flash write success later on, for the sync ones need to set the activation value to Active after calling flash write success: Async (ubi): activation(Activating) flashWrite() return Activating onFlashWriteSuccess() activation(Active)
Synchronous (static): activation(Activating) flashWrite() onFlashWriteSuccess() activation(Active) return Active
By making the code common, the static layout gains some additional features which may not be of consequence due to the short duration of the update, but does not hurt and allow us to remove the if/else blocks: - Progress interface - Blocks transition interface - Updatable association before reboot is done
The static layout will also subscribe to systemd signals even though they're not used, but again this is to keep the code as common as possible.
Tested: Verified code update worked and expected d-bus interfaces and values were set during ubi and static update.
Change-Id: I20a0b752fe3905cca5b6220c88f65eb64d155d75 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|