user_mgmt: Recover corrupted nv files

For unknown reasons the nv file size become to 0.
To not affect the service, add this condition:
If the file is 0 in size, delete the file and returns EIO.

Resolves openbmc/phosphor-host-ipmid#185

Tested:

Step1: Manually create an empty size file

$ rm /var/lib/ipmi/channel_access_nv.json
$ touch /var/lib/ipmi/channel_access_nv.json

Step2: Restart ipmid and confirm the recovery was successful

$ systemctl restart phosphor-ipmi-host.service

Fusion-Link:
https://fusion2.corp.google.com/3ee7154b-5d58-3c69-b1fc-371aa9705613
https://fusion2.corp.google.com/77bcd09c-0dff-3636-878d-cb24f80d94db

Google-Bug-Id: 343233449
Change-Id: I710dd7c588ed811641266bf8178fb85610bd1609
Signed-off-by: Konda Reddy Kachana <kkachana@google.com>
(cherry picked from commit 46c5c3ac63acf5a69c2058665fc773902a3dfb64)
2 files changed
tree: 2a2cd707f3482a13556c10b0f42af1ee7dfdf10e
  1. conf/
  2. dynamic-layers/
  3. recipes-bsp/
  4. recipes-connectivity/
  5. recipes-core/
  6. recipes-devtools/
  7. recipes-extended/
  8. recipes-google/
  9. recipes-kernel/
  10. recipes-phosphor/
  11. recipes-tpm1/
  12. LICENSE
  13. 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.