diff options
author | cperciva <cperciva@FreeBSD.org> | 2005-08-19 01:49:15 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2005-08-19 01:49:15 +0000 |
commit | 53f5361a409649e4182d9a7600185ce847eef442 (patch) | |
tree | c7f85f2f85fc08774ca8291c4a8983b800450c4e /sys/conf | |
parent | 52895150638cb97b4703a5083957095199b23b99 (diff) | |
download | FreeBSD-src-53f5361a409649e4182d9a7600185ce847eef442.zip FreeBSD-src-53f5361a409649e4182d9a7600185ce847eef442.tar.gz |
Pad the strings sccs[], version[], and osrelease[] up to a minimum of
128 bytes, 256 bytes, and 32 bytes respectively. This makes it much
easier to identify when two kernels are identical apart from a version
number bump (as often happens on security branches).
Discussed on: freebsd-arch, in May 2005
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/newvers.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 99367b4..036712d 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -33,6 +33,9 @@ TYPE="FreeBSD" REVISION="7.0" BRANCH="CURRENT" +if [ "X${BRANCH_OVERRIDE}" != "X" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" @@ -85,10 +88,14 @@ v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` cat << EOF > vers.c $COPYRIGHT -char sccs[] = "@(#)${VERSION} #${v}: ${t}"; -char version[] = "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n"; +#define SCCSSTR "@(#)${VERSION} #${v}: ${t}" +#define VERSTR "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n" +#define RELSTR "${RELEASE}" + +char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; +char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; char ostype[] = "${TYPE}"; -char osrelease[] = "${RELEASE}"; +char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF |