newvers.sh revision 59874
1230557Sjimharris#!/bin/sh - 2230557Sjimharris# 3230557Sjimharris# $FreeBSD: head/sys/boot/common/newvers.sh 59874 2000-05-01 20:32:07Z peter $ 4230557Sjimharris# $NetBSD: newvers.sh,v 1.1 1997/07/26 01:50:38 thorpej Exp $ 5230557Sjimharris# 6230557Sjimharris# Copyright (c) 1984, 1986, 1990, 1993 7230557Sjimharris# The Regents of the University of California. All rights reserved. 8230557Sjimharris# 9230557Sjimharris# Redistribution and use in source and binary forms, with or without 10230557Sjimharris# modification, are permitted provided that the following conditions 11230557Sjimharris# are met: 12230557Sjimharris# 1. Redistributions of source code must retain the above copyright 13230557Sjimharris# notice, this list of conditions and the following disclaimer. 14230557Sjimharris# 2. Redistributions in binary form must reproduce the above copyright 15230557Sjimharris# notice, this list of conditions and the following disclaimer in the 16230557Sjimharris# documentation and/or other materials provided with the distribution. 17230557Sjimharris# 3. All advertising materials mentioning features or use of this software 18230557Sjimharris# must display the following acknowledgement: 19230557Sjimharris# This product includes software developed by the University of 20230557Sjimharris# California, Berkeley and its contributors. 21230557Sjimharris# 4. Neither the name of the University nor the names of its contributors 22230557Sjimharris# may be used to endorse or promote products derived from this software 23230557Sjimharris# without specific prior written permission. 24230557Sjimharris# 25230557Sjimharris# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26230557Sjimharris# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27230557Sjimharris# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28230557Sjimharris# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29230557Sjimharris# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30230557Sjimharris# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31230557Sjimharris# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32230557Sjimharris# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33230557Sjimharris# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34230557Sjimharris# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35230557Sjimharris# SUCH DAMAGE. 36230557Sjimharris# 37230557Sjimharris# @(#)newvers.sh 8.1 (Berkeley) 4/20/94 38230557Sjimharris 39230557SjimharrisLC_TIME=C; export LC_TIME 40230557Sjimharrisu=${USER-root} h=`hostname` t=`date` 41230557Sjimharris#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` 42230557Sjimharrisr=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` 43230557Sjimharris 44230557Sjimharrisecho "char bootprog_name[] = \"FreeBSD/${3} ${2}\";" > vers.c 45230557Sjimharrisecho "char bootprog_rev[] = \"${r}\";" >> vers.c 46230557Sjimharrisecho "char bootprog_date[] = \"${t}\";" >> vers.c 47230557Sjimharrisecho "char bootprog_maker[] = \"${u}@${h}\";" >> vers.c 48230557Sjimharris