| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| { |
| include: [ |
| "//src/sys/time/timekeeper/config.shard.cml", |
| "inspect/client.shard.cml", |
| "syslog/client.shard.cml", |
| "syslog/offer.shard.cml", |
| "trace/client.shard.cml", |
| ], |
| program: { |
| runner: "elf", |
| binary: "bin/timekeeper", |
| }, |
| collections: [ |
| { |
| name: "timesource", |
| durability: "transient", |
| }, |
| ], |
| capabilities: [ |
| { |
| protocol: [ |
| // Program wake alarms. |
| "fuchsia.time.alarms.WakeAlarms", |
| |
| // Allow adjusting the UTC time estimate. Should be used |
| // sparingly. |
| "fuchsia.time.external.Adjust", |
| |
| // Allows turning off UTC adjustiment. Used in tests only. |
| "fuchsia.time.test.Rtc", |
| ], |
| }, |
| ], |
| use: [ |
| { |
| // Used to start time sources. |
| protocol: [ "fuchsia.component.Realm" ], |
| from: "framework", |
| }, |
| { |
| protocol: [ |
| "fuchsia.driver.token.Debug", |
| "fuchsia.metrics.MetricEventLoggerFactory", |
| "fuchsia.time.Maintenance", |
| ], |
| }, |
| { |
| // Power management protocols. |
| protocol: [ |
| "fuchsia.power.broker.Topology", |
| "fuchsia.power.system.ActivityGovernor", |
| ], |
| |
| // Only used if the structured config option is set: |
| // `power_topology_integration_enabled: true` |
| // See: |
| // `//src/sys/time/timekeeper/config.shard.cml` |
| availability: "optional", |
| }, |
| { |
| storage: "data", |
| path: "/data", |
| |
| // Only used if `serve_test_protocols: true`. |
| availability: "optional", |
| }, |
| { |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have |
| // been migrated to services. The service capability has been added below. |
| directory: "dev-rtc", |
| rights: [ "r*" ], |
| path: "/dev/class/rtc", |
| }, |
| { |
| // This service replaces the directory capability above. |
| service: "fuchsia.hardware.rtc.Service", |
| }, |
| { |
| // Used for handling wake alarms. |
| // TODO(https://fxbug.dev/324273348): Remove this capability once the clients have |
| // been migrated to services. The service capability has been added below. |
| directory: "dev-hrtimer", |
| rights: [ "r*" ], |
| path: "/dev/class/hrtimer", |
| |
| // Optional during development. |
| availability: "optional", |
| }, |
| { |
| // This service replaces the directory capability above. |
| service: "fuchsia.hardware.hrtimer.Service", |
| availability: "optional", |
| }, |
| { |
| // Uses connectivity monitoring to know whether to issue outbound |
| // HTTPS requests for talking to external time sources. |
| // Requires assembly config setting: |
| // `platform.timekeeper.use_connectivity = true`. |
| protocol: "fuchsia.net.reachability.Monitor", |
| availability: "optional", |
| }, |
| ], |
| offer: [ |
| { |
| directory: "root-ssl-certificates", |
| from: "parent", |
| to: "#timesource", |
| rights: [ "r*" ], |
| }, |
| { |
| protocol: [ |
| "fuchsia.metrics.MetricEventLoggerFactory", |
| "fuchsia.net.interfaces.State", |
| "fuchsia.net.name.Lookup", |
| "fuchsia.posix.socket.Provider", |
| ], |
| from: "parent", |
| to: "#timesource", |
| }, |
| ], |
| |
| // See the `capabilities` section for details. |
| expose: [ |
| { |
| protocol: [ |
| "fuchsia.time.alarms.WakeAlarms", |
| "fuchsia.time.test.Rtc", |
| ], |
| from: "self", |
| to: "parent", |
| }, |
| { |
| protocol: [ "fuchsia.time.external.Adjust" ], |
| from: "self", |
| to: "parent", |
| availability: "optional", |
| }, |
| ], |
| } |