Commit Graph

148 Commits

Author SHA1 Message Date
Glen Barber
9dae4c97a0 Rename head from ALPHA1 to ALPHA2 in preparation for the next set
of snapshot builds.

Hashtag:	MaximumEffort
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-08-16 23:58:22 +00:00
Glen Barber
b534d57f63 Rename head from -CURRENT to -ALPHA1 as part of the
12.0-RELEASE cycle.  This commit marks the start of
the code slush for the 12.0 cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-08-10 00:01:21 +00:00
Ed Maste
030efb3cc6 newvers.sh: avoid possibly invalid relative directory
Previously newvers.sh passed --work-tree=${VCSDIR}/.. when invoking git.
When using git worktree .git is actually a file, not a directory, and
.git/.. is not a valid path.  Although it appears git handles this
internally (perhaps it normalizes the path first), it is simple enough
for the script to store both the working tree top-level directory and
the VCS (.git) directory, so do so.

Sponsored by:	The FreeBSD Foundation
2018-06-29 18:45:29 +00:00
Pedro F. Giffuni
981e34b9ca Indent protection and some other oops from the prvious commits. 2017-11-20 19:56:11 +00:00
Pedro F. Giffuni
51369649b0 sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:43:44 +00:00
Ed Maste
3ac77a9151 newvers.sh: speed up failing git-svn revision search
In the case of running newvers.sh on a git tree w/o git-svn-id notes we
previously piped the entire 'git log' to grep. Add --grep to the log
invocation to avoid processing log entries of no interest.

This saves about 2-3 seconds of newvers.sh run time on my SSD laptop.
Later changes will bring further speedups.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2017-09-11 00:14:04 +00:00
Ed Maste
a489102080 newvers.sh: accept "git-svn-id:" at the start of a line only
This prevents incorrect subversion revision detection when "git svn" is
not being used to get the sources but git is available. Previously old
subversion revisions included in commit messages were favoured over the
more recent and correct revisions in git notes.

For example cf1f355747 represents r315395 but was treated as r313908
which is referenced in the commit message. Commits following
r315395/cf1f35574722 but before another commit with a git-svn-id
reference in the commit message would be treated as r313908 as well.

Patch from PR updated to accommodate the initial four space indent in
`git log` ouptut.

PR:		221848
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
MFC after:	2 weeks
2017-09-10 19:12:01 +00:00
Ed Maste
495947bcfa newvers.sh: accommodate git worktree
newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine
which vcs info tool to run (e.g., git rev-parse, svn info).

(As of r308789 if a .vcs subdirectory is not found at ${TOPDIR} then
newvers.sh walks up successive parent directories, testing for the .vcs
subdirectory at each step.  This is done in case the FreeBSD source is
built in a subdirectory as part of some larger project, but either way
newvers.sh still tests for the .vcs subdirectory.)

However, when using git worktree there is no .git subdirectory but
rather a plain text .git file which contains a reference to the main
working tree.

Change findvcs() to test that the .vcs entry exists, regardless of type.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2017-08-22 17:57:34 +00:00
Ed Maste
7f582d6294 newvers.sh: consider as modified SVN mixed revision and other cases
The newvers -R option is intended to include build metadata (e.g. user,
host, time) if the build is from an unmodified VCS tree. For subversion
it considered a trailing 'M' as an indication of a modified tree, and
any other version string as modified.

Also include mixed revision checkouts (e.g. 123:126), switched (123S)
and partial (123P) working copies as modified: the revision number is
insufficient to uniquely determine which source was used for the build.

Reported by:	gjb
Reviewed by:	gjb
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8853
2016-12-19 17:31:34 +00:00
Ed Maste
61ae7e24e2 newvers.sh: add -R option to include metadata only for unmodified src tree
Sponsored by:	The FreeBSD Foundation
2016-12-19 15:19:44 +00:00
Ed Maste
e77cf5967a newvers.sh: correct typo in comment
Submitted by:	lidl
2016-12-15 15:14:02 +00:00
Ed Maste
7e9de36c3a 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
2016-12-15 12:57:03 +00:00
Gleb Smirnoff
5e680acd76 If FreeBSD source tree is a subproject of a bigger project, then .git or
.hg may reside above FreeBSD sources root.  Provide function findvcs()
that will climb up and seek for presence of a VCS directory.

Reviewed by:	imp (earlier version of the patch)
2016-11-18 00:13:30 +00:00
Glen Barber
ae940db11f Reflect head is now 12.0-CURRENT.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-07-08 00:12:29 +00:00
Glen Barber
193d700fe2 Update 11.0 to ALPHA6.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-07-01 00:00:35 +00:00
Glen Barber
591dda3ad0 Update head to ALPHA5 in preparation of new snapshot builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-06-24 00:05:45 +00:00
Glen Barber
6c84c6e2d2 Update 11.0 to -ALPHA4 in preparation of a new set of snapshot
builds.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-06-17 00:00:45 +00:00
Glen Barber
f6596b97a8 Update 11.0 to ALPHA3 in preparation for new snapshot builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-06-10 19:29:55 +00:00
Glen Barber
46e7e6bd41 Update to ALPHA2 in preparation of a new set of snapshot builds.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-06-03 00:06:24 +00:00
Glen Barber
f40383e102 Update head from 11.0-CURRENT to 11.0-ALPHA1, marking the official
start of the code slush.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-05-27 00:01:48 +00:00
Ed Maste
f232b3913a newvers.sh: rationalize licence condition numbering 2016-04-07 20:30:46 +00:00
Ed Maste
58eaee0654 newvers.sh: put variable assignments on separate lines
This makes it easier to grep for where they're set, and may simplify
future merging for FreeBSD derivatives that change these.
2015-12-31 19:25:35 +00:00
Ed Maste
484df459f0 newvers: Honour SOURCE_DATE_EPOCH as a build reproducibility measure
One reason the kernel does not build reproducibly is that it includes
a timestamp in the version string. SOURCE_DATE_EPOCH provides a standard
method to address this: it should be set to the last modification time
of the source, and build processes use the specified timestamp instead
of the "current" date and time.

This change uses SOURCE_DATE_EPOCH if it is set; how it gets set needs
to be addressed elsewhere.

Reviewed by:	bapt
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-12-03 12:17:09 +00:00
Bryan Drewery
8e8319a68d Stop building vers.c in include/ and only build the needed osreldate.h.
Because of how osreldate.h was being built with newvers.sh, which always
spat out a vers.c dependent on SVN or git, the meta mode build was
considering osreldate.h to depend on the current git or SVN index.  This
would lead to entire tree rebuilds when modifying git's index.  There's
no reason to be generating vers.c here so just skip it.

While here, in mk-osreldate.sh rename PARAM_H to proper PARAMFILE (which
newvers.sh already has a default for) and remove unneeded export.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:59 +00:00
Eitan Adler
22cac86d54 newvers.sh: remove 'X' hack from shell script
Reviewed by:	allanjude,  Daniel O'Connor
2015-04-08 04:01:02 +00:00
Warner Losh
8757069658 Don't require ${SYSDIR}/../COPYRIGHT to exist. Fall back to the
current date if we can't find it.

MFC After: 2 weeks
2014-12-22 19:10:21 +00:00
Xin LI
b4f46e79e8 Use ${SYSDIR} as the reference pointer instead of specifying relative path directly.
Reported by:	jenkins via Olivér Pintér (on github)
2014-11-14 18:44:13 +00:00
Xin LI
efda9da6e6 Derive copyright year from src/COPYRIGHT.
MFC after:	2 weeks
2014-11-13 00:30:17 +00:00
Baptiste Daroussin
72b2ef06e2 Only catch the line from the compiler output where 'version' is a word
This allows to build the kernel with gcc 4.9.1 from ports
2014-10-09 12:35:17 +00:00
Rui Paulo
1f88f8a384 Fix the definition of hg_cmd.
MFC after:	3 days
2014-02-03 08:15:09 +00:00
Rui Paulo
a4108819e3 Add support for Mercurial repositories. 2013-10-15 05:50:02 +00:00
Glen Barber
006a42a9cb Turn it all the way up to 11:
- Update FreeBSD version in:
  - UPDATING
  - sys/conf/newvers.sh

- Add 11.0 FreeBSD version for manual pages

- Bump __FreeBSD_version to 1100000

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-10-10 18:05:13 +00:00
Glen Barber
4fb8f7b451 Update head/ to ALPHA6 in preparation of branching to stable/10.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-10-10 17:39:39 +00:00
Glen Barber
24907464b4 Update head/ to 10.0-ALPHA5.
Approved by:	re (implicit)
2013-10-06 19:47:06 +00:00
Rui Paulo
d71346820f Append the Git branch to the version string.
Approved by:	re (gjb)
2013-10-03 01:53:17 +00:00
Glen Barber
0d8a6a99ba Update head/ to -ALPHA4.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-09-29 01:05:00 +00:00
Ian Lepore
0210509acd Allow the path to the system source directory to be passed in to
newvers.sh.  Pass it in from include/Makefile.  If it isn't passed in,
fall back to the old logic of using dirname $0.

Using dirname $0 does not yield the path to the script if it was
sourced in from another script in another directory; you end up with
the parent script's path.  That was causing newvers.sh to look one
level below the FreeBSD src/ directory when building osreldate.h and it
may find something like a git or svn repo there that has nothing to do
with FreeBSD.

PR:		174422
Approved by:	re ()
MFC after:	2 weeks
2013-09-28 16:39:46 +00:00
Glen Barber
58f1be5525 Update head/ to -ALPHA3.
This commit marks the point the final KBI change was made as part of the
10.0-RELEASE cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-09-24 16:59:28 +00:00
Glen Barber
163fd5eca2 Update head/ to -ALPHA2 status.
Approved by:	re (implicit)
2013-09-16 19:29:18 +00:00
Glen Barber
99f54f8fd0 Update head/ to -ALPHA1 status, as part of the 10.0-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-09-12 17:51:18 +00:00
Glen Barber
7c0af95a13 Use realpath(1) to determine the location of the newvers.sh script,
since the current working directory might not be what is expected,
causing svn{,lite}version to fail to find ${0} (itself).

Submitted by:	Dan Mack
2013-08-11 13:57:14 +00:00
Glen Barber
887d03eaf7 Fix a typo. The script should run /usr/bin/svnliteversion instead of
/usr/bin/svnversion in the affected section.

Reported by:	lev, Dan Mack
2013-08-10 18:23:18 +00:00
Glen Barber
a61914445d When newvers.sh is run, it is possible that the svnversion
(or svnliteversion) in the current lookup path is not what
was used to check out the tree.  If an incompatible version
is used, the svn revision number is not reported in uname(1).

Run ${svnversion} on newvers.sh itself when evaluating if the
svn(1) in use is compatible with the tree.  Fallback to an
empty ${svnversion} if necessary.

With this change, svnliteversion from base is only used
if no compatible svnversion is found, so with this change,
the version of svn(1) from the ports tree is evaluated first.

Requested by:	many
MFC after:	3 days
X-MFC-To:	stable/9, releng/9.2 only
2013-08-08 15:59:00 +00:00
Glen Barber
cfb2932bf4 Redirect svnversion stderr to /dev/null if we cannot determine
the tree version, for example if the tree is checked out with an
outdated svn from ports, but the base system svnlite is built.

Approved by:	kib (mentor)
2013-08-05 10:26:42 +00:00
Andriy Gapon
3878413821 newvers.sh: add another git-svn fallback
This time it is for a git mirror that stores svn revisions as
git notes, e.g. https://github.com/freebsd/freebsd

MFC after:	10 days
Sponsored by:	HybridCluster
2013-07-24 09:06:50 +00:00
Andriy Gapon
5393fdd26f newvers.sh: fix the fallback case of git-svn detection
MFC after:	5 days
Sponsored by:	HybridCluster
2013-07-24 09:05:04 +00:00
Glen Barber
92994bd3ba - Update newvers.sh to include svn revision in uname(1) if the
system has svnliteversion.
- If svnliteversion is not found, look for svnversion in /usr/bin
  and /usr/local/bin, since svnlite can be installed as svn if
  WITH_SVN is set.[1]
- Remove /bin from binary search paths.[1]

Discussed with:	kib [1]
MFC after:	3 days
Approved by:	kib (mentor)
2013-07-02 10:36:57 +00:00
Andriy Gapon
bfdcb3bcba print compiler version in the kernel banner
And provide kernel compiler version as a sysctl as well.
This is useful while we have gcc and clang cohabitation.
This could be even more useful when we have support
for external toolchains.

In cooperation with:	mjg
MFC after:		13 days
2013-02-02 11:58:35 +00:00
Rui Paulo
5ea861555c Improve the check for p4 opened files.
Now we only search for opened files in ${SYSDIR}, which makes it
possible to use multiple source trees.
2012-09-22 07:44:36 +00:00
Rui Paulo
878a25dbbf Add Perforce support. 2012-09-16 06:01:34 +00:00