uboot Compile time not changed when rebuild it,

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

uboot Compile time not changed when rebuild it,

1,299件の閲覧回数
wang12zhe
Contributor III

When uboot start, will show below:

U-Boot SPL 2021.04-lf_v2021.04+gf62650ba9e (Sep 06 2021 - 08:48:23 +0000)
Normal Boot
Trying to boot from MMC1
Primary set selected
Load image from MMC/SD 0x5e400

 

I think the "Sep 06 2021 - 08:48:23" is compile time, but why this time never change when rebuild uboot ?

 

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

1,291件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The timestamp will be generated in include/timestamp_autogenerated.h when you first build uboot.

You can try to clean the uboot build file and rebuild it.

0 件の賞賛
返信

1,284件の閲覧回数
wang12zhe
Contributor III

@Zhiming_Liu 

I had test on IMX8QM EVK with imx-yocto-L5.10.52_2.1.0

Step1 .bitbake u-boot-imx -c cleanall

Step2. bitbake u-boot-imx 

Step3 .cd tmp/work/imx8qmmek-poky-linux/u-boot-imx/2021.04-r0/build/imx8qm_mek_defconfig/include/generated/

Step4.

$ cat timestamp_autogenerated.h
#define U_BOOT_DATE "Sep 06 2021"
#define U_BOOT_TIME "08:48:23"
#define U_BOOT_TZ "+0000"
#define U_BOOT_DMI_DATE "09/06/2021"
#define U_BOOT_BUILD_DATE 0x20210906
#define U_BOOT_EPOCH 1630918103

I think the build time not changed,

 

I check the Makefile in Uboot

define filechk_timestamp.h
    (if test -n "$${SOURCE_DATE_EPOCH}"then \
        SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
        DATE=""; \
        for date in gdate date.gnu date; do \
            $${date} -u -d "$${SOURCE_DATE}" >/dev/null 2>&1 && DATE="$${date}"; \
        done; \
        if test -n "$${DATE}"then \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
            LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_EPOCH %s'; \
        else \
            return 42; \
        fi; \
    else \
        echo "123456"; \
        LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
        LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
        LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
        LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
        LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
        LC_ALL=C date +'#define U_BOOT_EPOCH %s'; \
    fi)
endef

 

I think the root cause is the SOURCE_DATE_EPOCH

But I don't know how to do next

0 件の賞賛
返信

701件の閲覧回数
rohitdubey
Contributor III

You can check if SOURCE_DATE_EPOCH has been declared in your recipe, bbappend, local.conf or the U-boot makefile.

bitbake -e | grep SOURCE_DATE_EPOCH

I had the same issue and just found it declared in my local.conf file.

0 件の賞賛
返信