How to set timezone for imx6 with BSP of Yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set timezone for imx6 with BSP of Yocto

Jump to solution
19,976 Views
宗標廖
Contributor V

Hello,

I am now working with Yocto(3.10.17) on i.MX6, and after the system started up, I want to

set the timezone to Japan.

I know in the LTIB case,just run the following command to set timezone.

ln -sf /usr/share/zoneinfo/Japan /etc/localtime

But this is not work in the Yocto case.

Could someone tell me how to set timezone in the Yocto case?

Best Regard,

ZongbiaoLiao

Labels (3)
Tags (4)
1 Solution
11,208 Views
宗標廖
Contributor V

Hello gusarambula

Thank you for your prompt.

I got it worked and my workaround is as bellow.

1)bitbake -c compile tzdata

2)bitbake -c install tzdata

3)copy <yocto folder>/<build folder>/tmp/work/all-poky-linux/tzdata/2013d-r0/image/usr/share/zoneinfo to the /usr/share of rootfs.

4)ln -sf /usr/share/zoneinfo/Japan /etc/localtime

Best Regards,

ZongbiaoLiao

View solution in original post

6 Replies
11,208 Views
宗標廖
Contributor V

Hi,Community

Could anyone give me some suggests?

0 Kudos
Reply
11,208 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello ZongbiaoLiao,

Perhaps the following community thread may help:

https://community.freescale.com/thread/315531

You may also want to look at tzdata in poky which does have a “DEFAULT_TIMEZONE” variable, although I haven’t personally used it.

Please let us know of your findings!

11,209 Views
宗標廖
Contributor V

Hello gusarambula

Thank you for your prompt.

I got it worked and my workaround is as bellow.

1)bitbake -c compile tzdata

2)bitbake -c install tzdata

3)copy <yocto folder>/<build folder>/tmp/work/all-poky-linux/tzdata/2013d-r0/image/usr/share/zoneinfo to the /usr/share of rootfs.

4)ln -sf /usr/share/zoneinfo/Japan /etc/localtime

Best Regards,

ZongbiaoLiao

11,208 Views
sachusanal
Contributor III

Hai ,

could you please help me to integrate the tzdata to my build.

I am using yocto jethro build for my sabresdp board. I bitbaked console-image.

I found that /usr/share/zone info conatin less amount of xone information  .in  /usr/share/zone info/Asia/Calcutta missing .

How can include the all zone package in my build.

Could you please help me to solve this issue. Its’ an urgent requirement.

0 Kudos
Reply
11,208 Views
prteek17
Contributor I

try adding tzdata-asia to your image.

0 Kudos
Reply
11,208 Views
chandraevolute
Contributor V

sachusanal

did you get the answer. can you please tell me how to do it

0 Kudos
Reply