#
e101030b |
| 01-Apr-2024 |
Jason Zhu <zhujiesen@bytedance.com> |
Synchronize NTP settings with systemd-timedated
Bmcweb get/set the "NTP settings" on phosphor-settings. phosphor-time-manager and phosphor-settings are responsible to sync the settings with systemd-
Synchronize NTP settings with systemd-timedated
Bmcweb get/set the "NTP settings" on phosphor-settings. phosphor-time-manager and phosphor-settings are responsible to sync the settings with systemd-timedated. So the services like bmcweb and ipmid will only have to get/set the property on phosphor-settings.
However, in order to avoid a race condition issue with NTP set, bmcweb now directly uses systemd instead of routing through phosphor-settings. As a result, there may be differences in the "NTP settings" between phosphor-setttings and systemd-timedated. To address this, this commit adds a match to monitor time sync method changes on systemd-timedated and updates it to phosphor-settings.
Tested: ``` 1. Get current NTP setting: busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP b true
busctl get-property xyz.openbmc_project.Settings /xyz/openbmc_project/time/sync_method xyz.openbmc_project.Time.Synchronization TimeSyncMethod -j { "type" : "s", "data" : "xyz.openbmc_project.Time.Synchronization.Method.NTP" }
2. Call method in systemd timedate, to change NTP setting: busctl call org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 SetNTP bb false false
journal log: phosphor-time-manager[28150]: Time mode has been changed to xyz.openbmc_project.Time.Synchronization.Method.Manual phosphor-time-manager[28150]: NTP property changed in systemd time service, update to phosphor-settings. phosphor-time-manager[28150]: NTP mode is already the same, skip setting to systemd time service again.
3. Get NTP setting again, NTP in phosphor-settings is synced with systemd-timedated: busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP b false
busctl get-property xyz.openbmc_project.Settings /xyz/openbmc_project/time/sync_method xyz.openbmc_project.Time.Synchronization TimeSyncMethod -j { "type" : "s", "data" : "xyz.openbmc_project.Time.Synchronization.Method.Manual" }
4. Set property in phosphor-settings, to change NTP setting: 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"
journal log: phosphor-time-manager[28150]: Updated NTP setting: True phosphor-time-manager[28150]: Time mode has been changed to xyz.openbmc_project.Time.Synchronization.Method.NTP phosphor-time-manager[28150]: NTP property changed in phosphor-settings, update to systemd time service. phosphor-time-manager[28150]: NTP mode is already the same, skip setting to phosphor-settings again.
5. Get NTP setting again, NTP in phosphor-settings is synced with systemd-timedated: busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP b true
busctl get-property xyz.openbmc_project.Settings /xyz/openbmc_project/time/sync_method xyz.openbmc_project.Time.Synchronization TimeSyncMethod -j { "type" : "s", "data" : "xyz.openbmc_project.Time.Synchronization.Method.NTP" } ```
Signed-off-by: Jason Zhu <zhujiesen@bytedance.com> Change-Id: I192d2257569f46aa0f5473331595c5242d816964
show more ...
|
#
b2670248 |
| 30-Nov-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
guideline: remove 'using namespace' from headers
Using namespace at global scope in a header file violates the cpp core guidelines. Quoting the guidelines:
"Doing so takes away an #includer’s ab
guideline: remove 'using namespace' from headers
Using namespace at global scope in a header file violates the cpp core guidelines. Quoting the guidelines:
"Doing so takes away an #includer’s ability to effectively disambiguate and to use alternatives. It also makes #included headers order-dependent as they might have different meaning when included in different orders."
For further reading: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-using-directive
Change-Id: I40fd6b31a94fe9a12426f76fc71d0832125a8740 Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
#
3afad188 |
| 18-Jul-2023 |
Lei YU <yulei.sh@bytedance.com> |
Add default time sync object path
The time sync object path is empty by default and is initialized by a dbus call at runtime. It works OK in BMC but the unit tests in the repo is broken due to the e
Add default time sync object path
The time sync object path is empty by default and is initialized by a dbus call at runtime. It works OK in BMC but the unit tests in the repo is broken due to the empty string used in the sdbus matcht_t.
Add a config option to initialize the default time sync object path, so that it works both on BMC and in unit tests.
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: Iccdaef58434a1227c4ea73230ba23b4e618a2d2d
show more ...
|
#
864e173e |
| 11-Apr-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
Add clang-tidy file
This commit implements a clang-tidy file, and makes some changes to get it to pass. Most changes are naming or mechanical in nature.
Tested: CI passed in docker.
Change-Id: I1f
Add clang-tidy file
This commit implements a clang-tidy file, and makes some changes to get it to pass. Most changes are naming or mechanical in nature.
Tested: CI passed in docker.
Change-Id: I1f9acf546542c839b8f9facb5b8beff37c0d5909 Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
#
dc746c0b |
| 01-Sep-2022 |
George Liu <liuxiwei@inspur.com> |
Move the getSubTree method to utils
Since the getSubTree method is a generic method that users may use anywhere, It is better to move this method to utils.
Signed-off-by: George Liu <liuxiwei@inspu
Move the getSubTree method to utils
Since the getSubTree method is a generic method that users may use anywhere, It is better to move this method to utils.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ib6e1367b9885dac38a7ba6b63329977436e70c26
show more ...
|
#
43dfeeb1 |
| 01-Sep-2022 |
George Liu <liuxiwei@inspur.com> |
Remove the service method in settings.hpp
Since the service method in settings.hpp is redundant, it is recommended to remove it.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I056abcd4
Remove the service method in settings.hpp
Since the service method in settings.hpp is redundant, it is recommended to remove it.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I056abcd4f6aef4e5d7d292a8786cebcbb7ecd15f
show more ...
|
#
38679266 |
| 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9cedddf4dc9b224ecbc2f68e6b00c0ab1885a826
show more ...
|
#
c6d33972 |
| 21-Jun-2020 |
George Liu <liuxiwei@inspur.com> |
clang-format: update to latest from docs repo
Since `Cpp11` is an alias for `Latest` and we should tend towards using the latest C++ standard, update the C++ standard to Latest.
https://github.com/
clang-format: update to latest from docs repo
Since `Cpp11` is an alias for `Latest` and we should tend towards using the latest C++ standard, update the C++ standard to Latest.
https://github.com/llvm/llvm-project/commit/e5032567903de19962333c4bf7d2edceaf4f9824#diff-b49a097415dff2837d9626d422c58ba8R82 https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I6bd62f057c6881b4e931c1968d71ce5478832d73
show more ...
|
#
0a70452a |
| 13-Apr-2020 |
George Liu <liuxiwei@inspur.com> |
Remove Deferred Updates
Remove deferred consumption of settings Manual/NTP and allow instant consumption.
Tested: Manually set the timeMode to NTP on the WEB and successfully. busctl get-property x
Remove Deferred Updates
Remove deferred consumption of settings Manual/NTP and allow instant consumption.
Tested: Manually set the timeMode to NTP on the WEB and successfully. busctl get-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"
Manually set the date time successfully by D-Bus when timeMode is MANUAL busctl set-property xyz.openbmc_project.Time.Manager /xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed t 1514765953791262
Manually set the date time failed by D-Bus when timeMode is NTP. busctl set-property xyz.openbmc_project.Time.Manager /xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed t 1514765953791262 Failed to set property Elapsed on interface xyz.openbmc_project.TIme.EpochTime: The operation failed
~# journalctl -b | grep timemanager Jan 01 00:15:26 fp5280g2 phosphor-timemanager[309]: Error in setting system time Jan 01 00:15:26 fp5280g2 phosphor-timemanager[309]: The operation failed
Refer: https://lists.ozlabs.org/pipermail/openbmc/2020-April/021409.html
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I7be25a9d0f56615bad6800a0b07df7f84fc0acc3
show more ...
|
#
3c2f4496 |
| 11-Apr-2020 |
George Liu <liuxiwei@inspur.com> |
Remove TimeOwner Feature
The TimeOwner feature is confusing from feedback from the community and hence removing the feature. Remove the TimeOwner feature in the phosphor-time-manager repo and needed
Remove TimeOwner Feature
The TimeOwner feature is confusing from feedback from the community and hence removing the feature. Remove the TimeOwner feature in the phosphor-time-manager repo and needed settings objects.
Tested: Manually set the date time on the web and successfully update the date time of BMC (eg: 2020/01/01 08:07:50). busctrl get-property xyz.openbmc_project.Time.Manager /xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed t 1577837156385836
Refer: https://lists.ozlabs.org/pipermail/openbmc/2020-April/021409.html
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Id47eb0a03e0e94eeff29d2b77dccefb89cded7b8
show more ...
|
#
4e845393 |
| 18-Dec-2018 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
Use a single dbus connection object
Starting with sdbusplus 8ca6025, calling bus_new_default multiple times doesn't seem to work - making calls that generate dbus traffic on one of the objects resul
Use a single dbus connection object
Starting with sdbusplus 8ca6025, calling bus_new_default multiple times doesn't seem to work - making calls that generate dbus traffic on one of the objects results in something like:
sd_bus_call: System.Error.ENOTCONN: Transport endpoint is not connected
This wasn't ideal anyway - move to a single object, shared application-wide.
Tested: Booted a witherspoon QEMU image and there were no coredumps Change-Id: I804a1b1438b22f48e45b26d395135e401ca98a06 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
#
ab4cc6a5 |
| 14-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-an
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ic2c462525eb27b8295c2b298871e04268d93faf2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
debe1d8f |
| 13-Oct-2017 |
Lei YU <mine260309@gmail.com> |
Use host state object to check if host is on
The code was using pgood to determine if host is on or off. Now we have host state object, which is a more appropriate way to check host on/off. So chang
Use host state object to check if host is on
The code was using pgood to determine if host is on or off. Now we have host state object, which is a more appropriate way to check host on/off. So change pgood related code to use host state object.
Change-Id: I553c1a40922ca2e8bc6904688c55e85971bd4720 Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|
#
20ed79e0 |
| 25-Jul-2017 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
Add API to retrieve settings
Add API to retrieve all settings objects of interest to the time manager.
Change-Id: I3d121c08d0156cf481a3468e6c7ca9b71f53d666 Signed-off-by: Deepak Kodihalli <dkodihal
Add API to retrieve settings
Add API to retrieve all settings objects of interest to the time manager.
Change-Id: I3d121c08d0156cf481a3468e6c7ca9b71f53d666 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|