svn commit: r325859 - head

Ed Maste emaste at FreeBSD.org
Wed Nov 15 18:03:32 UTC 2017


Author: emaste
Date: Wed Nov 15 18:03:31 2017
New Revision: 325859
URL: https://svnweb.freebsd.org/changeset/base/325859

Log:
  Sort pkgbase mtree metadata, for reproducible builds
  
  Packaged base packages are created by running the stageworld and
  stagekernel targets with -DNO_ROOT, and converting the resulting mtree
  file into a set of pkg plists.  If stage* is run with multiple processes
  the order of entries in the mtree file may be nondeterministic, and the
  resulting package tbz also had nondeterministic file ordering.
  
  The mtree file generated by -DNO_ROOT builds consists of one line per
  file, with the filename starting in the first column, so is easily
  sorted.  There's one exception: the first line of the mtree file is a
  comment, but the # character sorts before the filenames anyhow and needs
  no special treatment.
  
  PR:		223673
  Reviewed by:	bapt, gjb
  Sponsored by:	The Linux Foundation, Core Infrastructure Initiative
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D13103

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Nov 15 15:56:08 2017	(r325858)
+++ head/Makefile.inc1	Wed Nov 15 18:03:31 2017	(r325859)
@@ -1613,8 +1613,8 @@ create-packages: .PHONY create-packages-world create-p
 create-world-packages:	_pkgbootstrap .PHONY
 	@rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
 	@cd ${WSTAGEDIR} ; \
-		awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-		${WSTAGEDIR}/METALOG
+		env -i LC_COLLATE=C sort ${WSTAGEDIR}/METALOG | \
+		awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk
 	@for plist in ${WSTAGEDIR}/*.plist; do \
 	  plist=$${plist##*/} ; \
 	  pkgname=$${plist%.plist} ; \
@@ -1658,9 +1658,9 @@ _debug=-debug
 create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
 	@cd ${KSTAGEDIR}/${DISTDIR} ; \
+	env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.meta | \
 	awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-		-v kernel=yes -v _kernconf=${INSTALLKERNEL} \
-		${KSTAGEDIR}/kernel.meta ; \
+		-v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \
 	cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
 	pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
 	sed -e "s/%VERSION%/${PKG_VERSION}/" \
@@ -1693,9 +1693,9 @@ _debug=-debug
 create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
 create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .PHONY
 	@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
+	env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.${_kernel}.meta | \
 	awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \
-		-v kernel=yes -v _kernconf=${_kernel} \
-		${KSTAGEDIR}/kernel.${_kernel}.meta ; \
+		-v kernel=yes -v _kernconf=${_kernel} ; \
 	cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \
 	pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
 	sed -e "s/%VERSION%/${PKG_VERSION}/" \


More information about the svn-src-head mailing list