New environment variable SOURCE_DATE_EPOCH
This commit is contained in:
parent
bda4b37e97
commit
384ff0eee9
@ -2549,10 +2549,70 @@ ex:;
|
||||
}
|
||||
|
||||
|
||||
/* https://reproducible-builds.org/specs/source-date-epoch/
|
||||
and reproducible-builds@lists.alioth.debian.org in august 2016
|
||||
*/
|
||||
int Xorriso_source_date_epoch(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
char *sec_text, double_text[40];
|
||||
double dsec= -1.0;
|
||||
time_t tsec;
|
||||
struct tm *gmt;
|
||||
|
||||
sec_text= getenv("SOURCE_DATE_EPOCH");
|
||||
if(sec_text == NULL)
|
||||
return(2);
|
||||
|
||||
sscanf(sec_text, "%lf", &dsec);
|
||||
sprintf(double_text, "%.f", dsec);
|
||||
tsec= dsec;
|
||||
if(dsec < 0 || ((double) tsec) != dsec ||
|
||||
strcmp(sec_text, double_text) != 0) {
|
||||
malformed:;
|
||||
Xorriso_msgs_submit(xorriso, 0,
|
||||
"Malformed environment variable SOURCE_DATE_EPOCH encountered",
|
||||
0, "SORRY", 0);
|
||||
Xorriso_msgs_submit(xorriso, 0,
|
||||
"Unset SOURCE_DATE_EPOCH before starting xorriso or see https://reproducible-builds.org/specs/source-date-epoch/",
|
||||
0, "HINT", 0);
|
||||
return(0);
|
||||
}
|
||||
gmt= gmtime(&tsec);
|
||||
if(gmt == NULL)
|
||||
goto malformed;
|
||||
sprintf(xorriso->vol_uuid, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00",
|
||||
1900 + gmt->tm_year, gmt->tm_mon + 1, gmt->tm_mday,
|
||||
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
|
||||
xorriso->gpt_guid_mode= 2; /* Disk GUID from vol_uuid */
|
||||
strcpy(xorriso->all_file_dates, xorriso->vol_uuid);
|
||||
sprintf(xorriso->info_text,
|
||||
"Environment variable SOURCE_DATE_EPOCH encountered with value %s",
|
||||
sec_text);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
sprintf(xorriso->info_text, "SOURCE_DATE_EPOCH : -volume_date uuid %s",
|
||||
xorriso->vol_uuid);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
|
||||
sprintf(xorriso->info_text,
|
||||
"SOURCE_DATE_EPOCH : -volume_date all_file_dates %s",
|
||||
xorriso->all_file_dates);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
|
||||
sprintf(xorriso->info_text,
|
||||
"SOURCE_DATE_EPOCH : -boot_image any volume_date_uuid");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_read_rc(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
int ret,i,was_failure= 0,fret;
|
||||
|
||||
/* Interpret environment variable SOURCE_DATE_EPOCH */
|
||||
ret= Xorriso_source_date_epoch(xorriso, 0);
|
||||
ret= Xorriso_eval_problem_status(xorriso, ret, 0);
|
||||
if(ret < 0)
|
||||
return(0);
|
||||
|
||||
if(xorriso->no_rc)
|
||||
return(1);
|
||||
i= xorriso->rc_filename_count-1;
|
||||
|
@ -9,7 +9,7 @@
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH XORRISO 1 "Version 1.4.5, Aug 14, 2016"
|
||||
.TH XORRISO 1 "Version 1.4.5, Aug 15, 2016"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -2822,7 +2822,16 @@ Available types are:
|
||||
.br
|
||||
"f" time since when the volume is effectively valid.
|
||||
.br
|
||||
"uuid" sets a timestring that overrides "c" and "m" times literally.
|
||||
"all_file_dates" sets mtime, atime, and ctime of all files and
|
||||
directories to the given time.
|
||||
This action stays delayed until actual ISO production begins.
|
||||
Up to then it can be revoked by "all_file_dates" with empty timestring.
|
||||
.br
|
||||
The timestamps of the El Torito boot catalog file get refreshed when the ISO
|
||||
is produced. They can be influenced by "uuid".
|
||||
.br
|
||||
"uuid" sets a timestring that overrides "c" and "m" times literally and sets
|
||||
the time of the El Torito boot catalog.
|
||||
It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with
|
||||
YYYY between 1970 and 2999. Time zone is GMT.
|
||||
It is supposed to match this GRUB line:
|
||||
@ -4156,6 +4165,10 @@ mentioned boot facilities.
|
||||
Modes \fBcmd\fR and \fBas_mkisofs\fR work like with
|
||||
command \-report_el_torito. See above.
|
||||
.br
|
||||
With mode \fBgpt_disk_guid\fR print the GPT disk GUID of the loaded ISO
|
||||
in RFC 4122 text format to result channel. It is not considered an error if
|
||||
no GPT is present. In this case nothing is printed to result channel.
|
||||
.br
|
||||
With mode \fBgpt_crc_of:\fRdisk_path read up to 32 KiB from the disk
|
||||
file with the path given after the colon. Compute the GPT compliant CRC number
|
||||
and print it to the result channel. The number is shown like "0x690fd979".
|
||||
@ -5978,6 +5991,21 @@ The default setting of \-check_media abort_file= is:
|
||||
.br
|
||||
/var/opt/xorriso/do_abort_check_media
|
||||
.br
|
||||
.SS
|
||||
.SH ENVIRONMENT
|
||||
The following environment variables influence the program behavior:
|
||||
.br
|
||||
HOME is used to find xorriso and mkisofs startup files.
|
||||
.br
|
||||
SOURCE_DATE_EPOCH belongs to the specs of reproducible\-builds.org.
|
||||
It is supposed to be either undefined or to contain a decimal number
|
||||
which tells the seconds since january 1st 1970. If it contains a number,
|
||||
then it is used as time value to set the default of
|
||||
\-volume date "uuid", \-volume_date "all_file_dates",
|
||||
and it sets \-boot_image "any" "gpt_disk_guid=" to "volume_date_uuid".
|
||||
Startup files and program options can override the effect of SOURCE_DATE_EPOCH.
|
||||
.br
|
||||
.SS
|
||||
.SH SEE ALSO
|
||||
.TP
|
||||
For the mkisofs emulation of xorriso
|
||||
|
@ -33,6 +33,7 @@ images with Rock Ridge extensions.
|
||||
* Commands:: Reference of commands
|
||||
* Examples:: Examples
|
||||
* Files:: Files
|
||||
* Environ:: Environment
|
||||
* Seealso:: See also
|
||||
* Bugreport:: Reporting bugs
|
||||
* Legal:: Author, Copyright, Credits
|
||||
@ -2399,10 +2400,17 @@ according to the setting of command -acl.
|
||||
"m" time when volume was last modified.
|
||||
"x" time when the information in the volume expires.
|
||||
"f" time since when the volume is effectively valid.
|
||||
"uuid" sets a timestring that overrides "c" and "m" times
|
||||
literally. It must consist of 16 decimal digits which form
|
||||
YYYYMMDDhhmmsscc, with YYYY between 1970 and 2999. Time zone is
|
||||
GMT. It is supposed to match this GRUB line:
|
||||
"all_file_dates" sets mtime, atime, and ctime of all files and
|
||||
directories to the given time. This action stays delayed until
|
||||
actual ISO production begins. Up to then it can be revoked by
|
||||
"all_file_dates" with empty timestring.
|
||||
The timestamps of the El Torito boot catalog file get refreshed
|
||||
when the ISO is produced. They can be influenced by "uuid".
|
||||
"uuid" sets a timestring that overrides "c" and "m" times literally
|
||||
and sets the time of the El Torito boot catalog. It must consist
|
||||
of 16 decimal digits which form YYYYMMDDhhmmsscc, with YYYY between
|
||||
1970 and 2999. Time zone is GMT. It is supposed to match this GRUB
|
||||
line:
|
||||
search --fs-uuid --set YYYY-MM-DD-hh-mm-ss-cc
|
||||
E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds).
|
||||
Timestrings for the other types may be given as with command
|
||||
@ -3486,6 +3494,10 @@ File: xorriso.info, Node: Inquiry, Next: Navigate, Prev: DialogCtl, Up: Comm
|
||||
boot facilities.
|
||||
Modes *cmd* and *as_mkisofs* work like with command
|
||||
-report_el_torito. See above.
|
||||
With mode *gpt_disk_guid* print the GPT disk GUID of the loaded ISO
|
||||
in RFC 4122 text format to result channel. It is not considered an
|
||||
error if no GPT is present. In this case nothing is printed to
|
||||
result channel.
|
||||
With mode *gpt_crc_of:*disk_path read up to 32 KiB from the disk
|
||||
file with the path given after the colon. Compute the GPT
|
||||
compliant CRC number and print it to the result channel. The
|
||||
@ -4997,7 +5009,7 @@ other -indev drives. See the human readable part of
|
||||
with mount option -o sbsector= or -s.
|
||||
|
||||
|
||||
File: xorriso.info, Node: Files, Next: Seealso, Prev: Examples, Up: Top
|
||||
File: xorriso.info, Node: Files, Next: Environ, Prev: Examples, Up: Top
|
||||
|
||||
11 Files
|
||||
********
|
||||
@ -5043,9 +5055,25 @@ The default setting of -check_media abort_file= is:
|
||||
/var/opt/xorriso/do_abort_check_media
|
||||
|
||||
|
||||
File: xorriso.info, Node: Seealso, Next: Bugreport, Prev: Files, Up: Top
|
||||
File: xorriso.info, Node: Environ, Next: Seealso, Prev: Files, Up: Top
|
||||
|
||||
12 See also
|
||||
12 Environ
|
||||
**********
|
||||
|
||||
The following environment variables influence the program behavior:
|
||||
HOME is used to find xorriso and mkisofs startup files.
|
||||
SOURCE_DATE_EPOCH belongs to the specs of reproducible-builds.org. It
|
||||
is supposed to be either undefined or to contain a decimal number which
|
||||
tells the seconds since january 1st 1970. If it contains a number, then
|
||||
it is used as time value to set the default of -volume date "uuid",
|
||||
-volume_date "all_file_dates", and it sets -boot_image "any"
|
||||
"gpt_disk_guid=" to "volume_date_uuid". Startup files and program
|
||||
options can override the effect of SOURCE_DATE_EPOCH.
|
||||
|
||||
|
||||
File: xorriso.info, Node: Seealso, Next: Bugreport, Prev: Environ, Up: Top
|
||||
|
||||
13 See also
|
||||
***********
|
||||
|
||||
For the mkisofs emulation of 'xorriso'
|
||||
@ -5070,7 +5098,7 @@ On FreeBSD some commands differ:
|
||||
|
||||
File: xorriso.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top
|
||||
|
||||
13 Reporting bugs
|
||||
14 Reporting bugs
|
||||
*****************
|
||||
|
||||
To report bugs, request help, or suggest enhancements for 'xorriso',
|
||||
@ -5086,16 +5114,16 @@ messages of 'xorriso', and the undesirable outcome of your program run.
|
||||
|
||||
File: xorriso.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top
|
||||
|
||||
14 Author, Copyright, Credits
|
||||
15 Author, Copyright, Credits
|
||||
*****************************
|
||||
|
||||
14.1 Author
|
||||
15.1 Author
|
||||
===========
|
||||
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
for libburnia-project.org
|
||||
|
||||
14.2 Copyright
|
||||
15.2 Copyright
|
||||
==============
|
||||
|
||||
Copyright (c) 2007 - 2016 Thomas Schmitt
|
||||
@ -5104,7 +5132,7 @@ modified in sync with the technical properties of 'xorriso'. If you
|
||||
make use of the license to derive modified versions of 'xorriso' then
|
||||
you are entitled to modify this text under that same license.
|
||||
|
||||
14.3 Credits
|
||||
15.3 Credits
|
||||
============
|
||||
|
||||
'xorriso' is in part based on work by Vreixo Formoso who provides
|
||||
@ -5118,7 +5146,7 @@ years.
|
||||
|
||||
File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
|
||||
|
||||
15 Alphabetic Command List
|
||||
16 Alphabetic Command List
|
||||
**************************
|
||||
|
||||
|