Search code examples
timezoneyoctosystemd

How can I install a list of timezones in a yocto-base Linux distribution?


In my Yocto distribution is installed the systemd-timesyncd service and the program timedatectl. I have configured a UTC NTP Server in the file /etc/systemd/timesyncd.conf. The systemd-timesyncd service works correctly and synchronizes date and time with the NTP server and so my system time is synchronized with the Universal Time (UTC).

I need to set my timezone and I know that I can use the command: timedatectl set-timezone <timezone>. When I execute: timedatectl list-timezones to get the list of all timezones available the output of the command is:

> timedatectl list-timezones
UTC

I don't find any file /usr/share/zoneinfo or /usr/zoneinfo.

I think I miss installing something in my distribution but I don't know what..


Solution

  • To add a list of available timezones to a Linux distribution base on yocto it is necessary to add following assignament:

    IMAGE_INSTALL_append = " tzdata"
    

    This installs the package tzdata and after this the execution of the command timedatectl list-timezones outpus all timezones available.

    One possible path for info about timezones is /usr/share/zoneinfo.