fru-parser: Remove the use of mktime

mktime get the time in localtime and will mess up the time if the
timezone != UTC. The FRU data should be the raw data in UTC and the
reader will convert to localtime at their end.

This issue is detected when we change the timezone to PST/PDT with
https://gerrit.openbmc.org/c/openbmc/openbmc/+/58293
and the FRU EEPROM time does not match the expected Mfg Date anymore.

Used the timestamp of 1/1/1996 UTC directly.

Data Reader:
https://gerrit.openbmc.org/c/openbmc/phosphor-host-ipmid/+/58466

Tested:
Fru EEPROM Mfg Time now is in the same (after timezone conversion)
between the raw data and FRU output.

Change-Id: I9d2d045f037d1976e45ed4e0c1857bb8d5ebc06d
Signed-off-by: Willy Tu <wltu@google.com>
1 file changed
tree: 3abbe8465dbc98dd496b93b96f367007dd4e4e07
  1. scripts/
  2. .clang-format
  3. .gitignore
  4. bootstrap.sh
  5. configure.ac
  6. fru_area.cpp
  7. fru_area.hpp
  8. frup.cpp
  9. frup.hpp
  10. LICENSE
  11. Makefile.am
  12. OWNERS
  13. readeeprom.cpp
  14. README.md
  15. strgfnhandler.cpp
  16. types.hpp
  17. writefrudata.cpp
  18. writefrudata.hpp
README.md

ipmi-fru-parser

To Build

To build this package, do the following steps:

  1. ./bootstrap.sh
  2. ./configure ${CONFIGURE_FLAGS}
  3. make

To full clean the repository again run ./bootstrap.sh clean.