1e9a5f1a | 23-Aug-2023 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: use non-deprecated namespaces
The sdbusplus repository has deprecated some namespaces and they are currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE guard. Switch to the
sdbus++: use non-deprecated namespaces
The sdbusplus repository has deprecated some namespaces and they are currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE guard. Switch to the new namespace names.
Change-Id: Iaab6df118eb4dc65139e759dcb22851422f88389 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
dcfadad5 | 23-May-2023 |
Adriana Kobylak <anoo@us.ibm.com> |
mmc: Run fsck on the alternate image and hostfw
Before mounting the alternate image, run fsck on it to determine if the filesystem is corrupted, this could happen if the BMC rebooted in the middle o
mmc: Run fsck on the alternate image and hostfw
Before mounting the alternate image, run fsck on it to determine if the filesystem is corrupted, this could happen if the BMC rebooted in the middle of a code update for example. Invalidate the image if it's found to be corrupted.
Run fsck on the hostfw partition too, this is a writable partition that can benefit from autocorrection. The mmc initramfs runs fsck on the rwfs partition already. It's a good practice to run fsck on writable partitions. Do not fail if fsck fails on the hostfw partition, if it's corrupted, an error would occur during the power on.
Tested: Verified there were no errors with this change. This change adds about 1s to the execution of the mount service, from 5s to 6s to start:
May 24 19:07:27 p10bmc systemd[1]: Starting Mount BMC rofs volumes after a reboot... May 24 19:07:27 p10bmc obmc-flash-bmc[328]: /dev/disk/by-partlabel/rofs-a: clean, 6430/68816 files, 192421/275012 blocks May 24 19:07:27 p10bmc kernel: EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Quota mode: disabled. May 24 19:07:33 p10bmc fsck.ext4[474]: hostfw: clean, 247/655360 files, 196363/1310720 blocks May 24 19:07:34 p10bmc kernel: EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Quota mode: disabled. May 24 19:07:34 p10bmc systemd[1]: obmc-flash-mmc-mount.service: Deactivated successfully. May 24 19:07:34 p10bmc systemd[1]: Finished Mount BMC rofs volumes after a reboot.
Change-Id: I0efedb6d72e1d0d6018974598c4b361eafe7441b Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
87c5b5bd | 15-Nov-2022 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
u-boot mirroring support
Design is at the link below. https://gerrit.openbmc.org/c/openbmc/docs/+/58025
Tested: Tested all "Test Scenarios" specified in the design.
Signed-off-by: Lakshmi Yadlap
u-boot mirroring support
Design is at the link below. https://gerrit.openbmc.org/c/openbmc/docs/+/58025
Tested: Tested all "Test Scenarios" specified in the design.
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com> Change-Id: I064115ee1e966a0a1b3ce7ec246c1f88f0bd87f7
show more ...
|
bf2bb2b1 | 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I96286490697ce5d7fecc1c9c358f5f1d054137ec
show more ...
|
1e81f23c | 18-Jan-2022 |
Adriana Kobylak <anoo@us.ibm.com> |
Determine functional versions from mount directory
In order to support the same version on the primary and backup flash locations, the version string is not enough to determine which version is func
Determine functional versions from mount directory
In order to support the same version on the primary and backup flash locations, the version string is not enough to determine which version is functional. Therefore add a functional suffix to the mount directory of the functional and use that to set the Version as functional.
Tested: The mount directories indicate which version is functional, associations look correct.
- static: root@romulus:~# ls -l /run/media/rofs-79139bc0-functional/etc/ lrwxrwxrwx 1 root root 15 Jan 22 20:11 os-release -> /etc/os-release
root@romulus:~# busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/software/functional org.freedesktop.DBus.Properties Get ss xyz.openbmc_project.Association endpoints v as 1 "/xyz/openbmc_project/software/79139bc0"
- ubi root@witherspoon:~# df /dev/ubiblock0_0 18816 18816 0 100% /media/rofs-cfb85943-functional /dev/ubiblock4_0 18816 18816 0 100% /media/rofs-26085328
- mmc: Verified functional association is correct, the rofs directories are still unmounted after the bmc updater starts.
Change-Id: I8114a86b36ca1c6b1634b01fcce3cef0a2369eca Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
25773a7e | 21-Jan-2022 |
Adriana Kobylak <anoo@us.ibm.com> |
Use flash id to write image to flash
Update the item updater helper functions to take the flash id instead of the version id since flash id is the name of the volumes/partitions.
The flash id was b
Use flash id to write image to flash
Update the item updater helper functions to take the flash id instead of the version id since flash id is the name of the volumes/partitions.
The flash id was being persisted for the mmc layout with the name of "partlabel". This is not needed anymore since the flash id is now being passed by the service files.
The write functions/service files still use the version id to know where the image files are located in /tmp/. They then set the value of flash id (Path property) which is then used by the other functions such as Delete and setting the u-boot environment variables.
Tested: Code update and Delete functions work on ubi and mmc.
Change-Id: I87c5b8ae2e24af30256dc3b436859835f14cda05 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
7eebeaac | 15-Jun-2021 |
Isaac Kurth <isaac.kurth@ibm.com> |
item_updater_helper: implement factoryReset
helper::factoryReset in the mmc item_updater_helper needs to set the environment variable rwreset to true so that upon reboot, the mmc initrd scripts can
item_updater_helper: implement factoryReset
helper::factoryReset in the mmc item_updater_helper needs to set the environment variable rwreset to true so that upon reboot, the mmc initrd scripts can perform a factory reset by recreating all r/w volumes.
Tested: Use busctl to call the Reset method. Verify with fw_printenv that rwreset is set to true.
Signed-off-by: Isaac Kurth <isaac.kurth@ibm.com> Change-Id: Iea8aa5c359e5f332105b915f58aef7472eae260b
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 ...
|
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 ...
|
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 ...
|
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 ...
|
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 ...
|