commit | 59b640b07148c56e0a344dda198fcac0cd9af836 | [log] [tgz] |
---|---|---|
author | Adriana Kobylak <anoo@us.ibm.com> | Fri Jan 21 19:45:22 2022 +0000 |
committer | Lei YU <yulei.sh@bytedance.com> | Mon Feb 07 17:29:05 2022 +0800 |
tree | 09dace5d8b24c2e9e9fde24d2c64c4094964fb63 | |
parent | 1e81f23c40b5ee98b4451431d88692a632c33b2e [diff] |
Support uploading same image for multiple times The code was unable to upload the same image for multiple times because it has the same version ID. Add a salt when generating the version ID so that we could get different version IDs for the same image, and thus it is possible to upload the images for multiple times. Use a random generator with the time as seed to ensure uniqueness. When the image updater starts up, use the mount directory name or functional suffix as seeds to make the version ids unique. The version ID is then necessary in the version object because the Delete interface needs it when the version object is to be deleted. With this change, it is possible to upload and update the same image for multiple times, and systems with dual BMC chips could have the same image as well. Tested: Upload a same image for multiple times and verify all the uploads are OK and getting different DBus objects; Verify it is OK to delete the uploaded images by deleting the DBus objects. Verify the code update works on all layouts and that the flash id (Path property) was set. - static root@romulus:~# busctl --no-pager introspect \ xyz.openbmc_project.Software.BMC.Updater \ /xyz/openbmc_project/software/79139bc0 ... .Path property s "9e3b868e" root@romulus:~# ls -l /run/media/rofs-9e3b868e-functional/etc/ lrwxrwxrwx 1 root root 15 Jan 22 20:11 os-release -> /etc/os-release - ubi root@witherspoon:~# busctl --no-pager introspect \ xyz.openbmc_project.Software.BMC.Updater \ /xyz/openbmc_project/software/151bc3d8 ... .Path property s "cfb85943" root@witherspoon:~# df /dev/ubiblock0_0 18816 18816 0 100% /media/rofs-cfb85943-functional /dev/ubiblock4_0 18816 18816 0 100% /media/rofs-26085328 root@witherspoon:~# cat /var/lib/phosphor-bmc-code-mgmt/cfb85943/priority { "priority": 0 } - mmc root@p10bmc:~# busctl --no-pager introspect \ xyz.openbmc_project.Software.BMC.Updater \ /xyz/openbmc_project/software/cb5f99e2 ... .Path property s "b" root@p10bmc:~# df /dev/mmcblk0p5 202095 153782 33107 82% /media/rofs-b-functional root@p10bmc:~# cat /var/lib/phosphor-bmc-code-mgmt/b/priority { "priority": 0 } Signed-off-by: Lei YU <yulei.sh@bytedance.com> Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> Change-Id: I76842de4d5b7c5175acc43ed7c57e0deb4057be5
Phosphor BMC Code Management provides a set of system software management applications. More information can be found at Software Architecture
To build this package, do the following steps:
meson build
ninja -C build
To clean the repository run rm -r build
.