src/mkfs.fat.c | 19 ++++++++++++++++---
3 files changed, 53 insertions(+), 7 deletions(-)
-diff --git a/src/boot.c b/src/boot.c
-index 4de450d..8f78e1c 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -33,6 +33,8 @@
#include "common.h"
#include "fsck.fat.h"
-@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, char *label)
+@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, cha
{
time_t now;
struct tm *mtime;
off_t offset;
int created;
DIR_ENT de;
-@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, char *label)
+@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, cha
if (de.name[0] == 0xe5)
de.name[0] = 0x05;
if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
(mtime->tm_min << 5) +
-diff --git a/src/common.c b/src/common.c
-index 6a2e396..4f1afcb 100644
--- a/src/common.c
+++ b/src/common.c
@@ -30,6 +30,7 @@
uint32_t generate_volume_id(void)
{
struct timeval now;
--
-- if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+ char *source_date_epoch = NULL;
-+
+
+- if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ char *tmp = NULL;
srand(getpid());
/* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
-diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
-index 37fc8ff..1948635 100644
--- a/src/mkfs.fat.c
+++ b/src/mkfs.fat.c
@@ -1074,7 +1074,7 @@ static void setup_tables(void)
+
volume_id = generate_volume_id();
check_atari();
-
\ No newline at end of file
+