How do you change the system time for your image at build time?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How do you change the system time for your image at build time?

ソリューションへジャンプ
2,980件の閲覧回数
nathanswartzent
Contributor I

It appears that whenever we build an image, the builder's system time when the image was built is "baked in" the image somewhere.  If we attempt to change the system time (while running the image) to some time before this, the system acts strangely.  For instance, if our image was built at 3:00PM on Nov 2, and we attempt to change the date while running the image to Oct 20, we see this issue.  Is there a way to change the system time used by the image when the image is built?  We're using the 3.10.17 kernel with yocto 1.6.1.

0 件の賞賛
返信
1 解決策
2,678件の閲覧回数
KursadOney
NXP Employee
NXP Employee

Assuming with "image," you mean the kernel. Here's what Documentation/kbuild/kbuild.txt says:

KBUILD_BUILD_TIMESTAMP

--------------------------------------------------

Setting this to a date string overrides the timestamp used in the

UTS_VERSION definition (uname -v in the running kernel). The value has to

be a string that can be passed to date -d. The default value

is the output of the date command at one point during build.

For example you can run:

export KBUILD_BUILD_TIMESTAMP='Sun May 1 12:00:00 CEST 2011'

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
2,679件の閲覧回数
KursadOney
NXP Employee
NXP Employee

Assuming with "image," you mean the kernel. Here's what Documentation/kbuild/kbuild.txt says:

KBUILD_BUILD_TIMESTAMP

--------------------------------------------------

Setting this to a date string overrides the timestamp used in the

UTS_VERSION definition (uname -v in the running kernel). The value has to

be a string that can be passed to date -d. The default value

is the output of the date command at one point during build.

For example you can run:

export KBUILD_BUILD_TIMESTAMP='Sun May 1 12:00:00 CEST 2011'

0 件の賞賛
返信