Module Name: src
Committed By: christos
Date: Thu Feb 8 19:24:43 UTC 2024
Modified Files:
src/distrib/hppa/sysnbsd: Makefile
src/sys/arch/hppa/stand/mkboot: mkboot.c
Log Message:
PR/57911: Jan-Benedict Glaw: Allow to set repro timestamp (and use it)
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/hppa/sysnbsd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/stand/mkboot/mkboot.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/hppa/sysnbsd/Makefile
diff -u src/distrib/hppa/sysnbsd/Makefile:1.1 src/distrib/hppa/sysnbsd/Makefile:1.2
--- src/distrib/hppa/sysnbsd/Makefile:1.1 Mon Feb 24 02:23:39 2014
+++ src/distrib/hppa/sysnbsd/Makefile Thu Feb 8 14:24:43 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2014/02/24 07:23:39 skrll Exp $
+# $NetBSD: Makefile,v 1.2 2024/02/08 19:24:43 christos Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -10,8 +10,12 @@ MKBOOT = ${TOOLDIR}/bin/${_TOOL_PREFIX}h
KERN= ${KERNOBJDIR}/GENERIC/netbsd
LIF= SYSNBSD
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MKBOOT_TIMESTAMP=-t "${MKREPRO_TIMESTAMP}"
+.endif
+
release: check_RELEASEDIR
- ${MKBOOT} ${DESTDIR}/usr/mdec/boot ${KERN} ${.OBJDIR}/${LIF}
+ ${MKBOOT} ${MKBOOT_TIMESTAMP} ${DESTDIR}/usr/mdec/boot ${KERN} ${.OBJDIR}/${LIF}
${RELEASE_INSTALL} ${.OBJDIR}/${LIF} \
${RELEASEDIR}/${RELEASEMACHINEDIR}/installation
Index: src/sys/arch/hppa/stand/mkboot/mkboot.c
diff -u src/sys/arch/hppa/stand/mkboot/mkboot.c:1.2 src/sys/arch/hppa/stand/mkboot/mkboot.c:1.3
--- src/sys/arch/hppa/stand/mkboot/mkboot.c:1.2 Thu Jan 21 12:00:23 2016
+++ src/sys/arch/hppa/stand/mkboot/mkboot.c Thu Feb 8 14:24:43 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mkboot.c,v 1.2 2016/01/21 17:00:23 christos Exp $ */
+/* $NetBSD: mkboot.c,v 1.3 2024/02/08 19:24:43 christos Exp $ */
/* $OpenBSD: mkboot.c,v 1.9 2001/05/17 00:57:55 pvalchev Exp $ */
@@ -115,6 +115,7 @@ int cksum(int, int *, int);
char *to_file;
int loadpoint, verbose;
u_long entry;
+time_t repro_epoch = 0;
/*
* Old Format:
@@ -140,14 +141,17 @@ main(int argc, char **argv)
struct hppa_lifvol *lifv = (struct hppa_lifvol *)buf;
struct hppa_lifdir *lifd = (struct hppa_lifdir *)(buf + HPPA_LIF_DIRSTART);
- while ((c = getopt(argc, argv, "vl:")) != -1) {
+ while ((c = getopt(argc, argv, "l:t:v")) != -1) {
switch (c) {
+ case 'l':
+ loadpoint = strtol(optarg, NULL, 0);
+ break;
+ case 't':
+ repro_epoch = atoll(optarg);
+ break;
case 'v':
verbose++;
break;
- case 'l':
- sscanf(optarg, "0x%x", &loadpoint);
- break;
default:
usage();
}
@@ -374,8 +378,8 @@ void __dead
usage(void)
{
fprintf(stderr,
- "usage: %s [-v] [-l loadpoint] prog1 {progN} outfile\n",
- getprogname());
+ "Usage: %s [-v] [-l <loadpoint>] [-t <timestamp>] prog1 {progN} outfile\n",
+ getprogname());
exit(1);
}
@@ -411,6 +415,12 @@ bcddate(char *file, char *toc)
struct stat statb;
struct tm *tm;
+ if (repro_epoch)
+ tm = gmtime(&repro_epoch);
+ else {
+ stat(file, &statb);
+ tm = localtime(&statb.st_ctime);
+ }
stat(file, &statb);
tm = localtime(&statb.st_ctime);
tm->tm_year %= 100;