Re: [08/34] initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

Michal Marek
2011-04-05T18:12:16Z

Dne 5.4.2011 19:31, Milton Miller napsal(a):
> On Tue, 05 Apr 2011 about 14:58:55 -0000, Michal Marek wrote:
>>
>> gen_init_cpio uses the current time for symlinks, special files and
>> directories.
>
> gen_init_cpio gets the current time and uses it for each symlink,
> special file, and directory.
>
> Grab the current time once, and ...
>
>> Make it possible to override this with the
> (s/this/it/)
>> KBUILD_BUILD_TIMESTAMP variable for reproducible builds.
>>
...
>> + env = getenv("CPIO_TIMESTAMP");
>> + if (env)
>> + default_mtime = atol(env);
>> + if (!default_mtime)
>> + default_mtime = time(NULL);
>> +
>
> Please pass it via an explicit flag in argv instead of magic env variables.
>
> The other current use of the environment (the expansion of variables
> in the location name) is via explicit reference in the input file.
>
> Also, please use strol and check that the whole string is consumed.

Yeah, I was too lazy. I'll do it properly in v2.

Thanks for the review.

Michal