Re: [PATCH] fs/proc: add compile time info

From: Masahiro Yamada
Date: Thu Sep 15 2022 - 00:38:20 EST


On Mon, Sep 12, 2022 at 6:42 PM Florian Eckert <fe@xxxxxxxxxx> wrote:
>
> Hello Masahiro,
>
> thanks for your feedback.
>
> > https://patchwork.kernel.org/project/linux-kbuild/patch/20220828024003.28873-6-masahiroy@xxxxxxxxxx/
> > lands, nobody cannot reference KBUILD_BUILD_TIMESTAMP,
> > then this whack-a-mole game will end.
>
> I was not aware of that problem. Thanks for the link.
>
> I understood that this is a bad idea to create the timestamp for proc
> like this!
> But how does it look in principle to offer the build timestamp in proc
> for reading?
> You have only made your point about creating the timestamp but not about
> reading it out via the proc directory.
>
> So far the timestamp is only readable as a string via dmesg.


init/version.c is the only file that can depend on the output of
the 'date' command.


You can follow what 'linux_proc_banner' does.

Define it in init/version.c, and declare it somewhere in a header file.





> Best regards
>
> Florian



--
Best Regards
Masahiro Yamada