From owner-svn-src-all@freebsd.org Thu Dec 15 12:57:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956E9C81536; Thu, 15 Dec 2016 12:57:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0891ACE; Thu, 15 Dec 2016 12:57:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBFCv3ww001962; Thu, 15 Dec 2016 12:57:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBFCv3ih001961; Thu, 15 Dec 2016 12:57:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612151257.uBFCv3ih001961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Dec 2016 12:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310112 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2016 12:57:04 -0000 Author: emaste Date: Thu Dec 15 12:57:03 2016 New Revision: 310112 URL: https://svnweb.freebsd.org/changeset/base/310112 Log: newvers.sh: add option to eliminate kernel build metadata Build metadata (username, hostname, etc.) prevents the FreeBSD kernel from building reproducibly. Add an option to disable inclusion of that metadata but retain the release information and SVN/git VCS details. See https://reproducible-builds.org/ for additional background. Reviewed by: bapt Obtained from: NetBSD MFC after: 1 month Sponsored by: Reproducible Builds World Summit 2, Berlin Differential Revision: https://reviews.freebsd.org/D4347 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Dec 15 10:51:35 2016 (r310111) +++ head/sys/conf/newvers.sh Thu Dec 15 12:57:03 2016 (r310112) @@ -30,6 +30,14 @@ # @(#)newvers.sh 8.1 (Berkeley) 4/20/94 # $FreeBSD$ +# Command line options: +# +# -r Reproducible build. Do not embed directory names, user +# names, time stamps or other dynamic information into +# the outuput file. This is intended to allow two builds +# done at different times and even by different people on +# different hosts to produce identical output. + TYPE="FreeBSD" REVISION="12.0" BRANCH="CURRENT" @@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then fi fi +include_metadata=true +while getopts r opt; do + case "$opt" in + r) + include_metadata= + ;; + esac +done +shift $((OPTIND - 1)) + +if [ -z "${include_metadata}" ]; then + VERINFO="${VERSION} ${svn}${git}${hg}${p4version}" + VERSTR="${VERINFO}\\n" +else + VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" + VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" +fi + cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERINFO}" +#define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;