Wed Nov 25 00:50:57 2015 UTC ()
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.


(christos)
diff -r1.32 -r1.33 src/distrib/common/Makefile.bootcd
diff -r1.11 -r1.12 src/distrib/common/bootimage/Makefile.bootimage

cvs diff -r1.32 -r1.33 src/distrib/common/Makefile.bootcd (expand / switch to unified diff)

--- 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
66DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh 66DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh
67DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s 67DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
68CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR} 68CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR}
69ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z 69ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z
70PUBLISHER?= The_NetBSD_Project 70PUBLISHER?= 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"
 78TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h
 79.endif
 80
77.if ${MKUNPRIVED} == "no" 81.if ${MKUNPRIVED} == "no"
78CD_METALOG.unpriv= 82CD_METALOG.unpriv=
79mtunpriv= 83mtunpriv=
80.else 84.else
81CD_METALOG.unpriv=-M ${METALOG}.sanitised 85CD_METALOG.unpriv=-M ${METALOG}.sanitised
82mtunpriv="-U" 86mtunpriv="-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
86CP?= cp 90CP?= cp
87RM?= rm 91RM?= rm
88MKDIR?= mkdir -p 92MKDIR?= mkdir -p
89CHMOD?= chmod 93CHMOD?= 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
287release: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post 291release: 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
291iso_image: 295iso_image:
292.else 296.else
293release: 297release:
294 298
295iso_image: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post 299iso_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}

cvs diff -r1.11 -r1.12 src/distrib/common/bootimage/Makefile.bootimage (expand / switch to unified diff)

--- 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"
 131TIMESTAMP=-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?
137CAT?= cat 141CAT?= cat
138CHMOD?= chmod 142CHMOD?= chmod
139CP?= cp 143CP?= cp
140DD?= dd 144DD?= dd
141MKDIR?= mkdir -p 145MKDIR?= mkdir -p
142RM?= rm 146RM?= 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"