feat: ntp: configure chrony PTP refclock and daemon access - #983
Draft
nwjsmith wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: rendersettings.ntp.refclocksas chronyrefclockdirectives (Ability to configure PTP hardware clock in chrony bottlerocket#4407) andsettings.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_enasymlink for the ENA PHC device (the kernel names PTP devices/dev/ptpNin probe order), matching the name used by Amazon Linux and the EC2 documentation. This is what makesrefclock PHC /dev/ptp_enawork out of the box.Requires a
bottlerocket-settings-modelsrelease that defines the newsettings.ntpfields (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)chrony-confthrough schnauzer's renderer for default / PTP / access / combined inputs: default output byte-identical to current; PTP emitsrefclock PHC /dev/ptp_ena poll 0 delay 0.000010 prefer.udevadm verifyon 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