diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2018-08-02 22:49:57 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-21 22:19:16 +0300 |
commit | bbbc7fa29444e31201701f4f08c53cff265073ea (patch) | |
tree | 9394d677d168b88d235b2ce13b4e97a5623888dc /meta-openbmc-machines | |
parent | bb3592fc96940a50a9bd8c617a8f5209420a531b (diff) | |
download | openbmc-bbbc7fa29444e31201701f4f08c53cff265073ea.tar.xz |
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>
Diffstat (limited to 'meta-openbmc-machines')
-rw-r--r-- | meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios index 298a9c41a9..ff88185184 100644 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios @@ -155,8 +155,9 @@ umount_ubi() { fi vol="$(findubi "${name}")" - if [ -n "${vol}" ]; then - ubirmvol "${ubidev}" -N "${name}" + id="${vol##*_}" + if [ -n "${id}" ]; then + ubirmvol "${ubidev}" -n "${id}" fi if [ -d "${mountdir}" ]; then |