Skip to main content
Visitor II
September 16, 2024
Solved

The Linux kernel compilation time obtained when building the MP135 Distribution Package is incorrect

  • September 16, 2024
  • 1 reply
  • 1666 views

Hello! Thank you for opening this post.
This is my first time to fully build the Distribution Package according to the guide on ST Wiki, and I have gained a lot from it.
But now I have a question to ask for help. After I burned the generated image after the complete build, I found that the compilation date obtained by the uname -a command was incorrect. It was not around the current date, but Fri Mar 15 18:27:50 UTC 2024. What is the reason? I did not modify any code in this process. I think the build is to fully compile all components including the kernel. I hope to get an answer.
Thank you ST!

截屏2024-09-17 上午12.44.19.png

    This topic has been closed for replies.
    Best answer by PatrickF

    Hi @QinWei 

    I'm not expert, but this is usually because 'compilation date/time' is defined somewhere in a configuration file and not using 'current' compilation time.

    The rationale of not using the 'current' system time is linked to quality requirements. In a company, this allows to confirm that even few year later you could build same binary (e.g. by checking Hash) whenever you extract sources with a defined tag from a configuration management system (e.g. git).

    On my side, I don't know where this 'time' is defined, but if you wish/need to modify it, you could probably find it by yourself.

    Regards.

    1 reply

    PatrickFAnswer
    Technical Moderator
    September 17, 2024

    Hi @QinWei 

    I'm not expert, but this is usually because 'compilation date/time' is defined somewhere in a configuration file and not using 'current' compilation time.

    The rationale of not using the 'current' system time is linked to quality requirements. In a company, this allows to confirm that even few year later you could build same binary (e.g. by checking Hash) whenever you extract sources with a defined tag from a configuration management system (e.g. git).

    On my side, I don't know where this 'time' is defined, but if you wish/need to modify it, you could probably find it by yourself.

    Regards.

    QinWeiAuthor
    Visitor II
    September 17, 2024

    Thank you, thank you very much for your reply because this is my first time asking in the STM32 official community! !<3
    I roughly understand what you mean, it sounds very reasonable, especially for checking the kernel version through the uname command. I found a similar question on the Internet:

    :backhand_index_pointing_right:https://adaptivesupport.amd.com/s/article/76559?language=en_US:backhand_index_pointing_left:
    And I found the REPRODUCIBLE_TIMESTAMP_ROOTFS keyword under my Yocto build path. I want to determine whether the value of this keyword affects the compilation time obtained by my uname, and I found that not only the compilation time of uname is incorrect, but also the default time of the system is incorrect. Looking forward to your professional reply, thank you! !

    截屏2024-09-17 下午8.59.46.png