Support IPMI Sync RTC time to BMC command
Implement the IPMI command to sync RTC time to BMC as follow:
- In the NTP mode, does not set the system time
- In the NTP mode is disabled, set the system time using hwclock
Tested:
1. Check the NTP mode is active
# timedatectl | grep "NTP service"
NTP service: active
2. Change time on Host
# date --set="20190601 17:30"
3. Sync the system time to RTC on Host
# hwclock --systohc
4. Run ipmi command to sync RTC to BMC
# ipmitool raw 0x3c 0xf9
Unable to send RAW command (channel=0x0 netfn=0x3c lun=0x0 cmd =
0xf9 rsp=0x1): Unknown (0x01)
5. Check the system time via IPMI/Webui or #date command in bmc console.
# date
# ipmitool sel time get
The system time does not change.
6. Disable NTP service and repeat test cases #4, #5
# systemctl stop systemd-timesyncd.service
# ipmitool raw 0x3c 0xf9
Make sure the system time can be change.
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I3c6fbc3314d4a75814d5e05022ba8d3a720e7c1e
3 files changed