fru-device: Own the bus list copy to prevent crash

_i2cBuses was a reference to the caller's local bus list. This list is
gone as soon as the caller returns, but the retry runs almost 5s later
on a timer, so it ends up using memory that no longer exists and cause
fru-device crashes.

Fix this by changing the reference into an owned copy.

Tested:
Before:
sometimes fru-device will core-dumps within 15 loops ac cycle:
```
Jun 08 03:37:51 bmc systemd[1]: xyz.openbmc_project.FruDevice.service: Main process exited, code=dumped, status=11/SEGV
Jun 08 03:37:51 bmc systemd[1]: xyz.openbmc_project.FruDevice.service: Failed with result 'core-dump'.
Jun 08 03:37:51 bmc systemd[1]: xyz.openbmc_project.FruDevice.service: Consumed 1.551s CPU time.
Jun 08 03:37:56 bmc systemd[1]: xyz.openbmc_project.FruDevice.service: Scheduled restart job, restart counter is at 1.
```
After:
fru-device will not core-dumps within 235 loops ac cycle.

Google-Bug-Id: 518601929
Google-Bug-Id: 515874892
Change-Id: Iddd049ed4247be4abb9043c6af589cde6e80b581
Signed-off-by: Jeff Lin <jefflin2@quanta.corp-partner.google.com>
2 files changed
tree: a2f6ced432245646cef404d1cf56ffa06a0c8060
  1. classes/
  2. conf/
  3. dynamic-layers/
  4. recipes-bsp/
  5. recipes-connectivity/
  6. recipes-core/
  7. recipes-devtools/
  8. recipes-extended/
  9. recipes-google/
  10. recipes-kernel/
  11. recipes-phosphor/
  12. recipes-support/
  13. recipes-tpm1/
  14. recipes-tpm2/
  15. LICENSE
  16. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.