Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/chrony/chrony-conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ ntp = "v1"
{{#each settings.ntp.time-servers}}
pool {{this}}{{#each ../settings.ntp.options}} {{this}}{{/each}}
{{/each}}
{{#if settings.ntp.refclocks}}
{{#each settings.ntp.refclocks}}
refclock {{this.driver}} {{this.parameter}}{{#if this.options}}{{#each this.options}} {{this}}{{/each}}{{/if}}
{{/each}}
{{/if}}
{{#if settings.ntp.allow}}
{{#each settings.ntp.allow}}
allow {{this}}
{{/each}}
{{/if}}
{{#if settings.ntp.cmdallow}}
{{#each settings.ntp.cmdallow}}
cmdallow {{this}}
{{/each}}
{{/if}}
{{#if settings.ntp.bindcmdaddress}}
{{#each settings.ntp.bindcmdaddress}}
bindcmdaddress {{this}}
{{/each}}
{{/if}}
driftfile /var/lib/chrony/drift
makestep 1.0 3
dumponexit
Expand Down
11 changes: 11 additions & 0 deletions packages/os/ena-ptp.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Amazon EC2 exposes the Amazon Time Sync Service PTP Hardware Clock (PHC) through
# the ENA driver when the instance is booted with the `ena.phc_enable=1` kernel
# parameter. The kernel names PTP character devices /dev/ptpN in probe order, which
# is not stable, so create a predictable /dev/ptp_ena symlink -- matching the name
# used by Amazon Linux and the EC2 documentation -- for chrony to reference via
# `settings.ntp.refclocks` (e.g. `refclock PHC /dev/ptp_ena`).
ACTION=="remove", GOTO="ena_ptp_end"
SUBSYSTEM!="ptp", GOTO="ena_ptp_end"
ATTR{clock_name}=="ena-ptp-*", SYMLINK+="ptp_ena"

LABEL="ena_ptp_end"
3 changes: 3 additions & 0 deletions packages/os/os.spec
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Source300: ephemeral-storage.rules
Source301: ebs-volumes.rules
Source302: ephemeral-ebs-storage.rules
Source303: supplemental-storage.rules
Source304: ena-ptp.rules

# 4xx sources: Bottlerocket licenses
Source400: COPYRIGHT
Expand Down Expand Up @@ -793,6 +794,7 @@ install -p -m 0644 %{S:300} %{buildroot}%{_cross_udevrulesdir}/80-ephemeral-stor
install -p -m 0644 %{S:301} %{buildroot}%{_cross_udevrulesdir}/81-ebs-volumes.rules
install -p -m 0644 %{S:302} %{buildroot}%{_cross_udevrulesdir}/82-ephemeral-ebs-storage.rules
install -p -m 0644 %{S:303} %{buildroot}%{_cross_udevrulesdir}/83-supplemental-storage.rules
install -p -m 0644 %{S:304} %{buildroot}%{_cross_udevrulesdir}/84-ena-ptp.rules

install -d %{buildroot}%{_cross_datadir}/whippet/
install -p -m 0644 %{S:22} %{buildroot}%{_cross_datadir}/whippet/system.toml
Expand All @@ -813,6 +815,7 @@ install -p -m 0644 %{S:400} %{S:401} %{S:402} %{buildroot}%{_cross_licensedir}
%{_cross_licensedir}/COPYRIGHT
%{_cross_licensedir}/LICENSE-MIT
%{_cross_licensedir}/LICENSE-APACHE
%{_cross_udevrulesdir}/84-ena-ptp.rules

%files -n %{_cross_os}apiserver
%{_cross_bindir}/apiserver
Expand Down