obmc-flash-bios: Remove UBI vols by id instead of name

If the name of the volume is passed to ubirmvol to be removed,
ubirmvol searches and stores the information for the available
UBI volumes, such as id, type, name, etc. If a volume is
deleted by another process while this search is in process,
ubirmvol would fail, which is the case when removing a PNOR
version since 2 separate systemd service files remove the
read-only and read-write volumes.

Instead pass ubirmvol the volume id instead of the name, so
that the ubirmvol doesn't need to do any searches and instead
knows which volume to delete.

Closes openbmc/openbmc#2863

Tested:
Verified a Delete operation does not fail with a
ubirmvol error leaving the rw volume behind. Ex:
Aug 01 16:43:03 witherspoon systemd[1]: Starting Remove UBIFS volume pnor-rw-5ac20d5d...
Aug 01 16:43:04 witherspoon systemd[1]: Starting Remove UBIFS volume pnor-ro-5ac20d5d...
Aug 01 16:43:05 witherspoon obmc-flash-bios[1458]: libubi: error!: cannot read "/sys/class/ubi/ubi8_0/type"
Aug 01 16:43:05 witherspoon obmc-flash-bios[1458]:         error 19 (No such device)
Aug 01 16:43:05 witherspoon obmc-flash-bios[1458]: ubirmvol: error!: cannot find UBI volume "pnor-rw-5ac20d5d"
Aug 01 16:43:05 witherspoon obmc-flash-bios[1458]:           error 19 (No such device)

Change-Id: Ib9aaeef4bfc268f3dac29288a469256bc771e195
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed
tree: 8ccc9fa43a389896cfa21163cd70b06c15efc2ba
  1. classes/
  2. common/
  3. conf/
  4. meta-ibm/
  5. meta-ingrasys/
  6. meta-inventec/
  7. meta-rackspace/
  8. COPYING.apache-2.0
  9. COPYING.MIT
  10. LICENSE
  11. MAINTAINERS
  12. README.md
README.md

OpenPOWER

meta-openpower is the OpenPOWER layer and should be included in all OpenPOWER systems' bblayers.conf. More information on OpenPOWER can be found here.