The maximum length of the volume label is 16 bytes.
.TP
.BI "\-T " #
-Set all files to the given UNIX timestamp. Reproducible builds require setting
-all to a specific one. By default, the source file's modification time is used.
+Specify a UNIX timestamp for image creation time for reproducible builds.
+If \fI--mkfs-time\fR is not specified, it will behave as \fI--all-time\fR:
+setting all files to the specified UNIX timestamp instead of using the
+modification times of the source files.
.TP
.BI "\-U " UUID
Set the universally unique identifier (UUID) of the filesystem to
.B \-\-all-root
Make all files owned by root.
.TP
+.B \-\-all-time
+(used together with \fB-T\fR) set all files to the fixed timestamp. This is the
+default.
+.TP
.BI "\-\-blobdev " file
Specify an extra blob device to store chunk-based data.
.TP
.BI "\-\-max-extent-bytes " #
Specify maximum decompressed extent size in bytes.
.TP
+.B \-\-mkfs-time
+(used together with \fB-T\fR) the given timestamp is only applied to the build
+time.
+.TP
.B "\-\-preserve-mtime"
Use extended inodes instead of compact inodes if the file modification time
would overflow compact inodes. This is the default. Overrides
{"clean", optional_argument, NULL, 522},
{"incremental", optional_argument, NULL, 523},
{"root-xattr-isize", required_argument, NULL, 524},
+ {"mkfs-time", no_argument, NULL, 525},
+ {"all-time", no_argument, NULL, 526},
{0, 0, 0, 0},
};
" -C# specify the size of compress physical cluster in bytes\n"
" -EX[,...] X=extended options\n"
" -L volume-label set the volume label (maximum 16)\n"
- " -T# set a fixed UNIX timestamp # to all files\n"
+ " -T# specify a fixed UNIX timestamp # as build time\n"
+ " --all-time the timestamp is also applied to all files (default)\n"
+ " --mkfs-time the timestamp is applied as build time only\n"
" -UX use a given filesystem UUID\n"
" --all-root make all files owned by root\n"
" --blobdev=X specify an extra device X to store chunked data\n"
int opt, i, err;
bool quiet = false;
int tarerofs_decoder = 0;
+ bool has_timestamp = false;
while ((opt = getopt_long(argc, argv, "C:E:L:T:U:b:d:x:z:Vh",
long_options, NULL)) != -1) {
erofs_err("invalid UNIX timestamp %s", optarg);
return -EINVAL;
}
- cfg.c_timeinherit = TIMESTAMP_FIXED;
+ has_timestamp = true;
break;
case 'U':
if (erofs_uuid_parse(optarg, fixeduuid)) {
return -EINVAL;
}
break;
+ case 525:
+ cfg.c_timeinherit = TIMESTAMP_NONE;
+ break;
+ case 526:
+ cfg.c_timeinherit = TIMESTAMP_FIXED;
+ break;
case 'V':
version();
exit(0);
}
cfg.c_mkfs_pclustersize_packed = pclustersize_packed;
}
+
+ if (has_timestamp && cfg.c_timeinherit == TIMESTAMP_UNSPECIFIED)
+ cfg.c_timeinherit = TIMESTAMP_FIXED;
return 0;
}