From a111b9f380fdae78821abfe95fb171e82ee5db53 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Thu, 25 Jan 2018 13:55:13 -0800 Subject: Enhance documentation with more examples I found myself looking around for the appropriate curl and busctl commands to configure the time on OpenBMC. I figured them out so figured I'd share. This README was very useful for getting the basics down. Change-Id: I48105d09f2c7afe065ed76c3e27f73e42d0e7807 Signed-off-by: Andrew Geissler --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e7beb2..3fefe12 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ the time. For example on an authenticated session: /xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed ### With REST API on remote host - curl -b cjar -k https://bmc-ip/xyz/openbmc_project/time/bmc + curl -b cjar -k https://${BMC_IP}/xyz/openbmc_project/time/bmc ``` * To set HOST's time: ``` @@ -32,7 +32,7 @@ the time. For example on an authenticated session: ### With REST API on remote host curl -b cjar -k -H "Content-Type: application/json" -X PUT \ -d '{"data": 1487304700000000}' \ - https://bmc-ip/xyz/openbmc_project/time/host/attr/Elapsed + https://${BMC_IP}/xyz/openbmc_project/time/host/attr/Elapsed ``` ### Time settings @@ -61,6 +61,46 @@ MANUAL | HOST | Not allowed | OK MANUAL | SPLIT | OK | OK MANUAL | BOTH | OK | OK +* To set an NTP [server](https://tf.nist.gov/tf-cgi/servers.cgi): + ``` + ### With busctl on BMC + busctl set-property xyz.openbmc_project.Network \ + /xyz/openbmc_project/network/eth0 \ + xyz.openbmc_project.Network.EthernetInterface NTPServers \ + as 1 "" + + ### With REST API on remote host + curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d \ + '{"data": [""] }' \ + https://${BMC_IP}/xyz/openbmc_project/network/eth0/attr/NTPServers + ``` + +* To go into NTP mode + ``` + ### With busctl on BMC + busctl set-property xyz.openbmc_project.Settings \ + /xyz/openbmc_project/time/sync_method xyz.openbmc_project.Time.Synchronization \ + TimeSyncMethod s "xyz.openbmc_project.Time.Synchronization.Method.NTP" + + ### With REST API on remote host + curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d \ + '{"data": "xyz.openbmc_project.Time.Synchronization.Method.NTP" }' \ + https://${BMC_IP}/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod + ``` + +* To change owner + ``` + ### With busctl on BMC + busctl set-property xyz.openbmc_project.Settings \ + /xyz/openbmc_project/time/owner xyz.openbmc_project.Time.Owner \ + TimeOwner s xyz.openbmc_project.Time.Owner.Owners.BMC + + ### With REST API on remote host + curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d \ + '{"data": "xyz.openbmc_project.Time.Owner.Owners.BMC" }' \ + https://${BMC_IP}/xyz/openbmc_project/time/owner/attr/TimeOwner + ``` + ### Special note on host on When the host is on, the changes of the above time mode/owner are not applied but deferred. The changes of the mode/owner are saved to persistent storage. -- cgit v1.2.1