How to set timezone for imx6 with BSP of Yocto

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to set timezone for imx6 with BSP of Yocto

跳至解决方案
22,541 次查看
宗標廖
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

标签 (3)
标记 (4)
1 解答
13,773 次查看
宗標廖
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

在原帖中查看解决方案

6 回复数
13,773 次查看
宗標廖
Contributor V

Hi,Community

Could anyone give me some suggests?

0 项奖励
回复
13,773 次查看
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!

13,774 次查看
宗標廖
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

13,773 次查看
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 项奖励
回复
13,773 次查看
prteek17
Contributor I

try adding tzdata-asia to your image.

0 项奖励
回复
13,773 次查看
chandraevolute
Contributor V

sachusanal

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

0 项奖励
回复