Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phosphor-software-manager: Not removing old priority on static flash layout #3363

Closed
mine260309 opened this issue Aug 20, 2018 · 3 comments
Closed

Comments

@mine260309
Copy link
Contributor

phosphor-software-manager now supports flashing tarball of static flash layout build, and it saves the priority file in persistent storage (e.g. /var/lib/obmc/phosphor-bmc-code-mgmt).
When doing code update, the old priority file is expected to be removed.
However, due to the current code logic (ItemUpdater::freeSpace())only applying to the case that the BMC has two flash chips, it does not have a chance to remove the old priority file.

So eventually the old priority files are left on persistent storage and never get removed, e.g. on a Romulus machine:

# ls -l /var/lib/obmc/phosphor-bmc-code-mgmt
-rw-r--r--    1 root     root            21 Aug 20 07:21 0e7213e4
-rw-r--r--    1 root     root            21 Aug 16 05:40 37e01d35
-rw-r--r--    1 root     root            21 Aug  8 08:42 4565fb1e
-rw-r--r--    1 root     root            21 Aug 20 07:32 542bff4e
-rw-r--r--    1 root     root            21 Aug 20 07:35 693a4383
-rw-r--r--    1 root     root            21 Aug  8 08:18 cfeb6eb8
-rw-r--r--    1 root     root            21 Aug  8 08:51 f0f5f56c
@mine260309
Copy link
Contributor Author

The existing code in ItemUpdater::freeSpace() makes sure:

  1. It does not remove the BMC version which is functional;
  2. It keeps at most ACTIVE_BMC_MAX_ALLOWED versions.

For witherspoon, it has two BMC flash chips, and ACTIVE_BMC_MAX_ALLOWED is configured to 2, so it works fine:

  1. There are two BMC images, one is functional with high priority, and the other is backup with low priority;
  2. When update BMC, ItemUpdater::freeSpace() it removes the backup version, and added the updated version.

For static flash layout with only one flash chip, there is always only one BMC image which is functional.
So it will not have a chance to remove it, see code below:

    for (const auto& iter : activations)
    {
        if (...)
        {
            count++;
            // Don't put the functional version on the queue since we can't
            // remove the "running" BMC version.
            if (versions.find(iter.second->versionId)->second->isFunctional())
            {
                continue;
            }
            versionsPQ.push(std::make_pair(
                iter.second->redundancyPriority.get()->priority(),
                iter.second->versionId));
        }
    }

A possible fix could be changing the logic, if ACTIVE_BMC_MAX_ALLOWED is 1, then remove functional BMC version as well.

@geissonator
Copy link
Contributor

Per some recent community discussions, we're looking to have bugs assigned directly to the repo responsible.

@geissonator
Copy link
Contributor

Issue moved to openbmc/phosphor-bmc-code-mgmt #2 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants