openbmc / phosphor-bmc-code-mgmt

Manage the BMC's code versions.
Apache License 2.0
15 stars 24 forks source link

static flash layout: version id not updated after code update #3

Closed mine260309 closed 6 years ago

mine260309 commented 6 years ago

The version id is generated by BMC's version sha512sum | cut -b 1-8.

However, on static flash layout systems, the version id is not updated after code update. Steps to reproduce:

  1. Do factory reset to ensure the environment is clean;
  2. Check the current BMC version id, e.g. 26ec4dcd;
  3. Do a code update with new BMC version id, e.g. 0e7213e4;
  4. After update and BMC reboot, check the BMC version id, it's still 26ec4dcd.
mine260309 commented 6 years ago

The root cause is because in above step 2, the version id is created at MEDIA_DIR, e.g. /media/rofs-26ec4dcd/etc/, and it is in rwfs, which means it is persistent.

After code update (where rwfs is not updated), the dir remains and thus is still used by processBMCImage(), and the version string in the path is used as the version id.

mine260309 commented 6 years ago

@anoo1 I believe the MEDIA_DIR is expected to be in tmpfs instead of rwfs, is it? If yes, the fix could be make MEDIA_DIR and BMC_ROFS_PREFIX as configure arguments, and configure them as tmpfs path for static flash layout.

anoo1 commented 6 years ago

@anoo1 I believe the MEDIA_DIR is expected to be in tmpfs instead of rwfs, is it?

Right, the directories in MEDIA_DIR are re-created every time the bmc boots based on volumes that are present on the bmc.