Sample Header Ad - 728x90

In a yocto linux image how can I substitute the default timesyncd.conf file by a custom configuration file?

0 votes
1 answer
51 views
I'm developing a custom Linux distribution with yocto (Zeus Release). I'm using systemd-timesyncd as NTP Client. I need to substitute its default configuration file (/etc/systemd/timesyncd.conf) with a custom configuration file. I know that the NTP client systemd-timesyncd is installed into the image by the recipe meta/recipes-core/systemd/systemd_245.6.bb. In the recipe are present the followed lines:
PACKAGECONFIG ??= " \
    ...
    timesyncd \
    ...
"
and others. Furthermore in the same recipe it is defined the configuration file timesyncd.conf by the followed lines:
CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
    ...
    ${sysconfdir}/systemd/timesyncd.conf \
    ...
"
I have found [this post](https://stackoverflow.com/questions/77915145/bitbake-way-to-add-a-system-conf-setting) which explains how to substitute the default configuration file /etc/systemd/system.conf by an other defined by a user. Since the two configuration files (timesyncd.conf and system.conf) are installed in the same folder, /etc/systemd/, I have created an append file /recipes-core/systemd/systemd-conf_%.bbappend and followed the other steps well described in the post, but, after the image building, the timesyncd.conf remains the default one and it is not substitute by my custom configuration file. So, how can I substitute the default timesyncd.conf file in the yocto image?
Asked by User051209 (498 rep)
Jul 14, 2025, 12:47 PM
Last activity: Jul 15, 2025, 01:03 PM