Make it possible to leave out .note.netbsd.ident with command line flag -i.

This commit is contained in:
pooka 2009-12-16 20:54:49 +00:00
parent 5c3604e034
commit ffd78a62ec
1 changed files with 21 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: newvers.sh,v 1.54 2009/03/30 16:29:55 perry Exp $
# $NetBSD: newvers.sh,v 1.55 2009/12/16 20:54:49 pooka Exp $
#
# Copyright (c) 1984, 1986, 1990, 1993
# The Regents of the University of California. All rights reserved.
@ -47,6 +47,18 @@ d=$(pwd)
cwd=$(dirname $0)
copyright=$(awk '{ printf("\"%s\\n\"", $0); }' ${cwd}/copyright)
while [ $# -gt 0 ]; do
case "$1" in
-r)
rflag=-r
;;
-i)
iflag=-i
esac
echo arg
shift
done
if [ -f ident ]; then
id="$(cat ident)"
else
@ -58,7 +70,7 @@ osrelcmd=${cwd}/osrelease.sh
ost="NetBSD"
osr=$(sh $osrelcmd)
case $1 in
case "$rflag" in
-r)
fullversion="${ost} ${osr} (${id})\n"
;;
@ -67,6 +79,8 @@ case $1 in
;;
esac
echo $(expr ${v} + 1) > version
cat << _EOF > vers.c
/*
* Automatically generated file from $0
@ -86,6 +100,11 @@ const char kernel_ident[] = "${id}";
const char copyright[] =
${copyright}
"\n";
_EOF
[ "${iflag}" = -i ] && exit 0
cat << _EOF >> vers.c
/*
* NetBSD identity note.
@ -109,4 +128,3 @@ __asm(
);
_EOF
echo $(expr ${v} + 1) > version