Re: [PATCH 2/2] initramfs: Encode dependency on KBUILD_BUILD_TIMESTAMP

From: Andrew Donnellan
Date: Wed Mar 22 2023 - 01:26:08 EST


On Mon, 2023-03-20 at 15:08 +1100, Benjamin Gray wrote:
> gen_initramfs.sh has an internal dependency on KBUILD_BUILD_TIMESTAMP
> for generating file mtimes that is not exposed to make, so changing
> KBUILD_BUILD_TIMESTAMP will not trigger a rebuild of the archive.
>
> Declare the mtime date as a new parameter to gen_initramfs.sh to
> encode
> KBUILD_BUILD_TIMESTAMP in the shell command, thereby making make
> aware
> of the dependency.
>
> It will rebuild if KBUILD_BUILD_TIMESTAMP changes or is newly
> set/unset.
> It will _not_ rebuild if KBUILD_BUILD_TIMESTAMP is unset before and
> after. This should be fine for anyone who doesn't care about setting
> specific build times in the first place.
>
> Signed-off-by: Benjamin Gray <bgray@xxxxxxxxxxxxx>

Reviewed-by: Andrew Donnellan <ajd@xxxxxxxxxxxxx>
Tested-by: Andrew Donnellan <ajd@xxxxxxxxxxxxx>

--
Andrew Donnellan OzLabs, ADL Canberra
ajd@xxxxxxxxxxxxx IBM Australia Limited