package/chrony: add 50-chrony.list for systemd-timedated

systemd-timedated discovers NTP services from ntp-units.d/*.list.
Buildroot's chrony package never installs one: on a systemd image
without timesyncd, 'timedatectl status' reports

    NTP service: n/a

and 'timedatectl set-ntp on' fails with

    Failed to set ntp: NTP not supported

even though chronyd is running.

Install 50-chrony.list, following the convention set by Debian,
Fedora and Arch, so timedatectl can manage chrony.

Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Scott Fan <fancp2007@gmail.com>
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
TIAN Yuanhao
2026-09-06 04:30:37 -07:00
committed by Thomas Petazzoni
parent 6c9c2b71e6
commit 079f168792
2 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1 @@
chrony.service

View File

@@ -85,6 +85,9 @@ endef
define CHRONY_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/chrony/chrony.service \
$(TARGET_DIR)/usr/lib/systemd/system/chrony.service
# advertise chrony.service to systemd-timedated
$(INSTALL) -D -m 644 $(CHRONY_PKGDIR)/50-chrony.list \
$(TARGET_DIR)/usr/lib/systemd/ntp-units.d/50-chrony.list
endef
$(eval $(generic-package))