mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	The release notes says this: As already said, the changes since 2.1.1 are primarily bug fixes, addressing compiler warnings and issues reported by diagnostic tools, but also build failures for some configurations. https://lists.infradead.org/pipermail/linux-mtd/2020-July/081299.html Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
		
			
				
	
	
		
			61 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
--- a/jffsX-utils/mkfs.jffs2.c
 | 
						|
+++ b/jffsX-utils/mkfs.jffs2.c
 | 
						|
@@ -109,7 +109,7 @@ static char *rootdir = default_rootdir;
 | 
						|
 static int verbose = 0;
 | 
						|
 static int squash_uids = 0;
 | 
						|
 static int squash_perms = 0;
 | 
						|
-static int fake_times = 0;
 | 
						|
+static time_t fixed_timestamp = -1;
 | 
						|
 int target_endian = __BYTE_ORDER;
 | 
						|
 
 | 
						|
 static uint32_t find_hardlink(struct filesystem_entry *e)
 | 
						|
@@ -251,8 +251,8 @@ static struct filesystem_entry *add_host
 | 
						|
 			mode &= ~(S_ISUID | S_ISGID);
 | 
						|
 		}
 | 
						|
 	}
 | 
						|
-	if (fake_times) {
 | 
						|
-		timestamp = 0;
 | 
						|
+	if (fixed_timestamp != -1) {
 | 
						|
+		timestamp = fixed_timestamp;
 | 
						|
 	}
 | 
						|
 
 | 
						|
 	entry = xcalloc(1, sizeof(struct filesystem_entry));
 | 
						|
@@ -1558,6 +1558,20 @@ static void parse_image(void){
 | 
						|
 	close(in_fd);
 | 
						|
 }
 | 
						|
 
 | 
						|
+static void set_source_date_epoch() {
 | 
						|
+	char *env = getenv("SOURCE_DATE_EPOCH");
 | 
						|
+	char *endptr = env;
 | 
						|
+	errno = 0;
 | 
						|
+	if (env && *env) {
 | 
						|
+		fixed_timestamp = strtoull(env, &endptr, 10);
 | 
						|
+		if (errno || (endptr && *endptr != '\0')) {
 | 
						|
+			fprintf(stderr, "Invalid SOURCE_DATE_EPOCH");
 | 
						|
+			exit(1);
 | 
						|
+		}
 | 
						|
+	}
 | 
						|
+}
 | 
						|
+
 | 
						|
+
 | 
						|
 int main(int argc, char **argv)
 | 
						|
 {
 | 
						|
 	int c, opt;
 | 
						|
@@ -1576,6 +1590,7 @@ int main(int argc, char **argv)
 | 
						|
 		warn_page_size = 1; /* warn user if page size not 4096 */
 | 
						|
 
 | 
						|
 	jffs2_compressors_init();
 | 
						|
+	set_source_date_epoch();
 | 
						|
 
 | 
						|
 	while ((opt = getopt_long(argc, argv,
 | 
						|
 					"D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
 | 
						|
@@ -1626,7 +1641,7 @@ int main(int argc, char **argv)
 | 
						|
 				break;
 | 
						|
 
 | 
						|
 			case 'f':
 | 
						|
-				fake_times = 1;
 | 
						|
+				fixed_timestamp = 0;
 | 
						|
 				break;
 | 
						|
 
 | 
						|
 			case 'h':
 |