How to add timezone info to root filesystem using Yocto ?

Recently while debugging some issues we found that we were missing timezone related files into Yocto root filesystem, the debugging with strace shown the following error,

open("/usr/share/zoneinfo/UTC", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

The poky has a recipe for compiling the relevant files at poky/meta/recipes-extended/tzdata/ hence you can use below command to compile it,

$ bitbake tzdata

Once you have it compiled, you can add this files to the root filesystem by adding into IMAGE_INSTALL as,

IMAGE_INSTALL += "tzdata"

Now, after you boot this newly created root filesystem, we will get following messages at same place where it was failed previously in strace,

open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 16
fstat64(16, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
fstat64(16, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
read(16, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., 4096) = 127
_llseek(16, -6, [121], SEEK_CUR)        = 0
read(16, "\nUTC0\n", 4096)              = 6
close(16)                               = 0
Install MongoDB on AWS ubuntu serve... x
Install MongoDB on AWS ubuntu server & get connected to server database using MongoDB composs

1 thought on “How to add timezone info to root filesystem using Yocto ?”

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto Embedded Linux