Skip to content

feat: ntp: configure chrony PTP refclock and daemon access - #983

Draft
nwjsmith wants to merge 1 commit into
bottlerocket-os:developfrom
nwjsmith:ntp-refclock-and-access-settings
Draft

feat: ntp: configure chrony PTP refclock and daemon access#983
nwjsmith wants to merge 1 commit into
bottlerocket-os:developfrom
nwjsmith:ntp-refclock-and-access-settings

Conversation

@nwjsmith

Copy link
Copy Markdown

Issue number:

Addresses bottlerocket-os/bottlerocket#4407 and bottlerocket-os/bottlerocket#4473

Description of changes:
Render the new settings.ntp.* values in the chrony config template and create a stable device symlink for the Amazon Time Sync Service PTP hardware clock (PHC):

  • packages/chrony/chrony-conf: render settings.ntp.refclocks as chrony refclock directives (Ability to configure PTP hardware clock in chrony bottlerocket#4407) and settings.ntp.{allow,cmdallow,bindcmdaddress} as the matching access directives (NTP/Chrony Daemon Access Options bottlerocket#4473). Each block is guarded with {{#if}} because schnauzer renders in strict mode; when the settings are unset the output is byte-identical to today's.
  • packages/os/ena-ptp.rules: a udev rule that creates the stable /dev/ptp_ena symlink for the ENA PHC device (the kernel names PTP devices /dev/ptpN in probe order), matching the name used by Amazon Linux and the EC2 documentation. This is what makes refclock PHC /dev/ptp_ena work out of the box.

Requires a bottlerocket-settings-models release that defines the new settings.ntp fields (dep bump handled separately, as in #978); until then the template branches are inert and the default render is unchanged.

Testing done:

  • make build (package builds)
  • Rendered chrony-conf through schnauzer's renderer for default / PTP / access / combined inputs: default output byte-identical to current; PTP emits refclock PHC /dev/ptp_ena poll 0 delay 0.000010 prefer.
  • udevadm verify on the new rule — passes (systemd 257).

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.


Blocked by bottlerocket-os/bottlerocket-settings-sdk#143

Render the new settings.ntp.* values in the chrony config template and
create a stable device symlink for the Amazon Time Sync Service PTP
hardware clock (PHC).

- packages/chrony/chrony-conf: render settings.ntp.refclocks as chrony
  `refclock` directives and settings.ntp.{allow,cmdallow,bindcmdaddress}
  as the matching access directives. Each block is guarded with {{#if}}
  so the output is unchanged when the settings are unset (the templates
  render in strict mode).
- packages/os/ena-ptp.rules: add a udev rule that creates the stable
  /dev/ptp_ena symlink for the ENA PHC device (the kernel names PTP
  devices /dev/ptpN in probe order), matching the name used by Amazon
  Linux and the EC2 documentation.

Requires a bottlerocket-settings-models release that defines the new
settings.ntp fields; until then the template branches are inert.

Addresses bottlerocket-os/bottlerocket#4407 and
bottlerocket-os/bottlerocket#4473.

Signed-off-by: Nate Smith <nate@theinternate.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant