PR/50360: Thomas Klausner: if MKREPRO is set, provide a consistent timestamp for the files in the cdroms to be built. For now we copy the timestamp of <sys/param.h>. We could set an absolute timestamp too like -T 0 for the epoch.diff -r1.32 -r1.33 src/distrib/common/Makefile.bootcd
(christos)
--- src/distrib/common/Makefile.bootcd 2015/05/29 06:28:50 1.32
+++ src/distrib/common/Makefile.bootcd 2015/11/25 00:50:57 1.33
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile.bootcd,v 1.32 2015/05/29 06:28:50 martin Exp $ | 1 | # $NetBSD: Makefile.bootcd,v 1.33 2015/11/25 00:50:57 christos Exp $ | |
2 | # | 2 | # | |
3 | # Makefile snipped to create a CD/DVD ISO | 3 | # Makefile snipped to create a CD/DVD ISO | |
4 | # | 4 | # | |
5 | 5 | |||
6 | # XXX TODO: | 6 | # XXX TODO: | |
7 | # 1) merge with src/distrib/cdrom | 7 | # 1) merge with src/distrib/cdrom | |
8 | # 2) teach makefs to add data from more than 1 directory (see below) | 8 | # 2) teach makefs to add data from more than 1 directory (see below) | |
9 | 9 | |||
10 | # | 10 | # | |
11 | # Required variables: | 11 | # Required variables: | |
12 | # CDBASE Basename of the iso | 12 | # CDBASE Basename of the iso | |
13 | # | 13 | # | |
14 | # Optional variables: | 14 | # Optional variables: | |
@@ -64,26 +64,30 @@ SETS_DIR?= ${RELEASEDIR}/${RELEASEMACHIN | @@ -64,26 +64,30 @@ SETS_DIR?= ${RELEASEDIR}/${RELEASEMACHIN | |||
64 | .include <bsd.kernobj.mk> # For KERNSRCDIR | 64 | .include <bsd.kernobj.mk> # For KERNSRCDIR | |
65 | 65 | |||
66 | DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh | 66 | DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh | |
67 | DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s | 67 | DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s | |
68 | CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR} | 68 | CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR} | |
69 | ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z | 69 | ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z | |
70 | PUBLISHER?= The_NetBSD_Project | 70 | PUBLISHER?= The_NetBSD_Project | |
71 | .if defined(CDMAKEFSOPTIONS) | 71 | .if defined(CDMAKEFSOPTIONS) | |
72 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER},${CDMAKEFSOPTIONS} | 72 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER},${CDMAKEFSOPTIONS} | |
73 | .else | 73 | .else | |
74 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER} | 74 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER} | |
75 | .endif | 75 | .endif | |
76 | 76 | |||
77 | .if ${MKREPRO:Uno} == "yes" | |||
78 | TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h | |||
79 | .endif | |||
80 | ||||
77 | .if ${MKUNPRIVED} == "no" | 81 | .if ${MKUNPRIVED} == "no" | |
78 | CD_METALOG.unpriv= | 82 | CD_METALOG.unpriv= | |
79 | mtunpriv= | 83 | mtunpriv= | |
80 | .else | 84 | .else | |
81 | CD_METALOG.unpriv=-M ${METALOG}.sanitised | 85 | CD_METALOG.unpriv=-M ${METALOG}.sanitised | |
82 | mtunpriv="-U" | 86 | mtunpriv="-U" | |
83 | .endif | 87 | .endif | |
84 | 88 | |||
85 | # Stuff that should come from elsewhere - XXX where? - HF | 89 | # Stuff that should come from elsewhere - XXX where? - HF | |
86 | CP?= cp | 90 | CP?= cp | |
87 | RM?= rm | 91 | RM?= rm | |
88 | MKDIR?= mkdir -p | 92 | MKDIR?= mkdir -p | |
89 | CHMOD?= chmod | 93 | CHMOD?= chmod | |
@@ -271,27 +275,27 @@ image: | @@ -271,27 +275,27 @@ image: | |||
271 | fi | 275 | fi | |
272 | .if defined(SPEC_IN) | 276 | .if defined(SPEC_IN) | |
273 | cat ${SPEC_IN} >> ${WORKSPEC} | 277 | cat ${SPEC_IN} >> ${WORKSPEC} | |
274 | .endif | 278 | .endif | |
275 | .if defined(SECONDARY_BOOT) | 279 | .if defined(SECONDARY_BOOT) | |
276 | echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \ | 280 | echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \ | |
277 | >> ${WORKSPEC} | 281 | >> ${WORKSPEC} | |
278 | .endif | 282 | .endif | |
279 | .if defined(SPEC_EXTRA) | 283 | .if defined(SPEC_EXTRA) | |
280 | cat ${SPEC_EXTRA} >> ${WORKSPEC} | 284 | cat ${SPEC_EXTRA} >> ${WORKSPEC} | |
281 | .endif | 285 | .endif | |
282 | if [ -s ${WORKSPEC} ]; then specarg="-F ${WORKSPEC}"; fi; \ | 286 | if [ -s ${WORKSPEC} ]; then specarg="-F ${WORKSPEC}"; fi; \ | |
283 | ${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 $${specarg} \ | 287 | ${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 $${specarg} \ | |
284 | ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom | 288 | ${TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom | |
285 | 289 | |||
286 | .if ${CDRELEASE} == false | 290 | .if ${CDRELEASE} == false | |
287 | release: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post | 291 | release: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post | |
288 | ${MKDIR} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | 292 | ${MKDIR} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | |
289 | ${RELEASE_INSTALL} ${CDIMAGE} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | 293 | ${RELEASE_INSTALL} ${CDIMAGE} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | |
290 | 294 | |||
291 | iso_image: | 295 | iso_image: | |
292 | .else | 296 | .else | |
293 | release: | 297 | release: | |
294 | 298 | |||
295 | iso_image: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post | 299 | iso_image: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post | |
296 | ${MKDIR} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | 300 | ${MKDIR} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | |
297 | ${RELEASE_INSTALL} ${CDIMAGE} ${RELEASEDIR}/${CDROMS_RELEASEDIR} | 301 | ${RELEASE_INSTALL} ${CDIMAGE} ${RELEASEDIR}/${CDROMS_RELEASEDIR} |
--- src/distrib/common/bootimage/Makefile.bootimage 2015/05/08 17:46:03 1.11
+++ src/distrib/common/bootimage/Makefile.bootimage 2015/11/25 00:50:57 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile.bootimage,v 1.11 2015/05/08 17:46:03 riastradh Exp $ | 1 | # $NetBSD: Makefile.bootimage,v 1.12 2015/11/25 00:50:57 christos Exp $ | |
2 | # | 2 | # | |
3 | # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. | 3 | # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. | |
4 | # | 4 | # | |
5 | # Redistribution and use in source and binary forms, with or without | 5 | # Redistribution and use in source and binary forms, with or without | |
6 | # modification, are permitted provided that the following conditions | 6 | # modification, are permitted provided that the following conditions | |
7 | # are met: | 7 | # are met: | |
8 | # 1. Redistributions of source code must retain the above copyright | 8 | # 1. Redistributions of source code must retain the above copyright | |
9 | # notice, this list of conditions and the following disclaimer. | 9 | # notice, this list of conditions and the following disclaimer. | |
10 | # 2. Redistributions in binary form must reproduce the above copyright | 10 | # 2. Redistributions in binary form must reproduce the above copyright | |
11 | # notice, this list of conditions and the following disclaimer in the | 11 | # notice, this list of conditions and the following disclaimer in the | |
12 | # documentation and/or other materials provided with the distribution. | 12 | # documentation and/or other materials provided with the distribution. | |
13 | # | 13 | # | |
14 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 14 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
@@ -117,26 +117,30 @@ | @@ -117,26 +117,30 @@ | |||
117 | # template file of disklabel -R | 117 | # template file of disklabel -R | |
118 | # (default: ${DISTRIBDIR}/common/bootimage/diskproto.in | 118 | # (default: ${DISTRIBDIR}/common/bootimage/diskproto.in | |
119 | # or ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in) | 119 | # or ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in) | |
120 | # OMIT_SWAPIMG | 120 | # OMIT_SWAPIMG | |
121 | # no need to put swap partition into image (for USB stick) | 121 | # no need to put swap partition into image (for USB stick) | |
122 | # (default: no) | 122 | # (default: no) | |
123 | # | 123 | # | |
124 | 124 | |||
125 | .include <bsd.own.mk> # | 125 | .include <bsd.own.mk> # | |
126 | .include <bsd.endian.mk> # for TARGET_ENDIANNESS | 126 | .include <bsd.endian.mk> # for TARGET_ENDIANNESS | |
127 | 127 | |||
128 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" | 128 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" | |
129 | 129 | |||
130 | .if ${MKREPRO:Uno} == "yes" | |||
131 | TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h | |||
132 | .endif | |||
133 | ||||
130 | .if empty(IMGBASE) | 134 | .if empty(IMGBASE) | |
131 | .BEGIN: | 135 | .BEGIN: | |
132 | @echo "Error: IMGBASE is not set" | 136 | @echo "Error: IMGBASE is not set" | |
133 | @false | 137 | @false | |
134 | .endif | 138 | .endif | |
135 | 139 | |||
136 | # should be defined elsewhere? | 140 | # should be defined elsewhere? | |
137 | CAT?= cat | 141 | CAT?= cat | |
138 | CHMOD?= chmod | 142 | CHMOD?= chmod | |
139 | CP?= cp | 143 | CP?= cp | |
140 | DD?= dd | 144 | DD?= dd | |
141 | MKDIR?= mkdir -p | 145 | MKDIR?= mkdir -p | |
142 | RM?= rm | 146 | RM?= rm | |
@@ -282,26 +286,27 @@ ${TARGETFS}: prepare_md_post | @@ -282,26 +286,27 @@ ${TARGETFS}: prepare_md_post | |||
282 | .if defined(SECONDARY_BOOT) | 286 | .if defined(SECONDARY_BOOT) | |
283 | echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \ | 287 | echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \ | |
284 | >> ${WORKSPEC} | 288 | >> ${WORKSPEC} | |
285 | .endif | 289 | .endif | |
286 | .if defined(SPEC_EXTRA) | 290 | .if defined(SPEC_EXTRA) | |
287 | cat ${SPEC_EXTRA} >> ${WORKSPEC} | 291 | cat ${SPEC_EXTRA} >> ${WORKSPEC} | |
288 | .endif | 292 | .endif | |
289 | @echo Creating rootfs... | 293 | @echo Creating rootfs... | |
290 | # XXX /var/spool/ftp/hidden is unreadable | 294 | # XXX /var/spool/ftp/hidden is unreadable | |
291 | ${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden | 295 | ${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden | |
292 | ${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \ | 296 | ${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \ | |
293 | -B ${TARGET_ENDIANNESS} \ | 297 | -B ${TARGET_ENDIANNESS} \ | |
294 | -F ${WORKSPEC} -N ${WORKDIR}/etc \ | 298 | -F ${WORKSPEC} -N ${WORKDIR}/etc \ | |
299 | ${TIMESTAMP} \ | |||
295 | ${IMGMAKEFSOPTIONS} \ | 300 | ${IMGMAKEFSOPTIONS} \ | |
296 | ${WORKFS} ${WORKDIR} | 301 | ${WORKFS} ${WORKDIR} | |
297 | .if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no" | 302 | .if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no" | |
298 | ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKFS} \ | 303 | ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKFS} \ | |
299 | ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG} | 304 | ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG} | |
300 | .endif | 305 | .endif | |
301 | @echo done. | 306 | @echo done. | |
302 | mv ${WORKFS} ${.TARGET} | 307 | mv ${WORKFS} ${.TARGET} | |
303 | 308 | |||
304 | # | 309 | # | |
305 | # definitions to create image | 310 | # definitions to create image | |
306 | # | 311 | # | |
307 | .if ${USE_MBR} != "no" | 312 | .if ${USE_MBR} != "no" |