Skip to content

Support DHCP Option 42 (NTP Servers) for Chrony #268

Description

@rodripr1

Hi,

While setting up my printer to use my local NTP server, I noticed that although COSMOS includes Chrony, it doesn't seem to use DHCP Option 42. BusyBox udhcpc already exposes the ntpsrv environment variable, but nothing appears to consume it.

I put together a solution and tested it on my Centauri Carbon. It:

adds a Chrony drop-in configuration,
generates the configuration from the DHCP ntpsrv option,
supports multiple NTP servers,
falls back to the default Chrony pool if no NTP server is provided by DHCP,
only restarts Chrony when the generated configuration actually changes.

I'm not a Linux expert, so I used AI to help me understand the codebase and work through the implementation. That said, all of the testing was done on my own printer, and the feature has been working well in the scenarios I tried (single server, multiple servers, no DHCP NTP server, and DHCP lease renewals).

Before I spend time cleaning everything up into a PR, I wanted to ask if this is something you'd be interested in merging, and if so, where you'd prefer the implementation to live (for example, as a chrony_%.bbappend in meta-opencentauri or another approach).

If there's interest, I'd be happy to prepare a pull request.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions