updater: Introduce the concept of flash id

There is a desire to be able to upload and update the same image to the
BMC. This would require to generate different version ids for each, not
tied to the version string. In order to correlate a version with the
persistent data on flash, introduce the concept of flash id.

Flash id is the name or id of the flash location where the image was
flashed, it could be a volume name, partition name, mtd device name,
etc.

Use the updater version Path property for the flash id value. A d-bus
property is needed so that obmc-flash-bmc can save the value once it
determines the location to flash the new image. The version Path
property is empty when the BMC boots up, and it's set to the image path
in /tmp/ when an image is uploaded. This change will set the Path
property to the location where the image resides when the BMC boots up,
and it'll update the Path property from /tmp/ to the location on flash
for an uploaded image once that image was successfully written to flash.

The ubi volume names are based on the uploaded version id, keep this the
same for simplicity, the flash id would then be the version id of the
uploaded image (which would eventually be a random number). The mmc
partitions are named rofs-a/rofs-b, so the flash id would be "a" or "b".

Tested: Verified the Path property was set to the version id on ubi and
to "a" or "b" on mmc.

Change-Id: I11ccdb829c3c5204a58f24f3383db0045d8687ea
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2 files changed