sizeof(image_header_t)),
sbuf->st_size - sizeof(image_header_t));
- time = imagetool_get_source_date(params, sbuf->st_mtime);
+ time = imagetool_get_source_date(params->cmdname, sbuf->st_mtime);
ep = params->ep;
addr = params->addr;
/* for first image creation, add a timestamp at offset 0 i.e., root */
if (params->datafile) {
- time_t time = imagetool_get_source_date(params, sbuf.st_mtime);
+ time_t time = imagetool_get_source_date(params->cmdname,
+ sbuf.st_mtime);
ret = fit_set_timestamp(ptr, 0, time);
}
}
time_t imagetool_get_source_date(
- struct image_tool_params *params,
+ const char *cmdname,
time_t fallback)
{
char *source_date_epoch = getenv("SOURCE_DATE_EPOCH");
if (gmtime(&time) == NULL) {
fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
- params->cmdname);
+ cmdname);
time = 0;
}
* an error message if SOURCE_DATE_EPOCH contains an invalid value and returns
* 0.
*
- * @params: mkimage parameters
+ * @cmdname: command name
* @fallback: timestamp to use if SOURCE_DATE_EPOCH isn't set
* @return timestamp based on SOURCE_DATE_EPOCH
*/
time_t imagetool_get_source_date(
- struct image_tool_params *params,
+ const char *cmdname,
time_t fallback);
/*