convert to use version template and newvers_stand.sh script for generating

bootblock revision strings, use bootbock_name[] (i.e. "NetBSD/sun3")
	in initial bootblock messages instead of just "NetBSD"

while here, do sligh Makefile cleanup to share more code between them and also
	to make buildable on NetBSD 1.4.1 (my test compile system)
get rid of the XX define hack for netboot & ufsboot, build xxboot.c as
	part of libsa - previos main() was renamed to xxboot_main(), main()
	is now in respective conf.c files and calls xxboot_main() with
	appropriate name of boot block type

XXX I had no chance to actually test the resulting bootblocks, but the
changes were fairly streightforward and should no influence functionality of
boot code
This commit is contained in:
jdolecek 2000-07-16 21:56:12 +00:00
parent 9e1ce523c5
commit 77c0fe57cf
13 changed files with 79 additions and 103 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.12 1998/06/29 20:09:14 gwr Exp $
# $NetBSD: Makefile.inc,v 1.13 2000/07/16 21:56:12 jdolecek Exp $
.if defined(SA_PROG)
@ -6,7 +6,9 @@
# But note: this is w.r.t. a subdirectory
S= ${.CURDIR}/../../../..
LIBSA!=cd ${.CURDIR}/../libsa; $(MAKE) echo_objdir
LIBSA!=cd ${.CURDIR}/../libsa; \
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -s -f-
MDEC_DIR?=/usr/mdec
SRCS?= ${SA_PROG}.c
@ -41,14 +43,6 @@ ${SA_PROG} : ${OBJS} ${DPADD} ${SRTLIB}
${OBJS} : machine m68k
machine :
-rm -f $@
ln -s ${S}/arch/sun3/include $@
m68k :
-rm -f $@
ln -s ${S}/arch/m68k/include $@
.if !target(cleanprog)
cleanprog:
-rm -f ${SA_PROG}.tmp [Ee]rrs mklog core *.core
@ -62,3 +56,12 @@ proginstall: ${SA_PROG}.bin
.endif
.endif # defined(SA_PROG)
machine :
-rm -f $@
ln -s ${S}/arch/sun3/include $@
m68k :
-rm -f $@
ln -s ${S}/arch/m68k/include $@

View File

@ -1,14 +1,12 @@
# $NetBSD: Makefile,v 1.5 1997/09/05 04:31:52 gwr Exp $
# $NetBSD: Makefile,v 1.6 2000/07/16 21:56:13 jdolecek Exp $
SA_PROG= bootxx
SRCS= bootxx.c conf.c
all: ${SA_PROG}
# Do not strip or remove a.out header for this one.
proginstall: ${SA_PROG}
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${SA_PROG} ${DESTDIR}${MDEC_DIR}/${SA_PROG}
STRIPFLAG=
all: ${SA_PROG}
.include <bsd.prog.mk>

View File

@ -1,9 +1,10 @@
# $NetBSD: Makefile,v 1.7 1999/02/13 02:54:49 lukem Exp $
# $NetBSD: Makefile,v 1.8 2000/07/16 21:56:13 jdolecek Exp $
.include <bsd.own.mk>
PROG= installboot
MKMAN= no
MKMAN= no
NOMAN= yes
BINDIR=/usr/mdec
# Need this to work in the miniroot

View File

@ -1,10 +1,13 @@
# $NetBSD: Makefile,v 1.23 2000/01/23 17:04:12 mycroft Exp $
# $NetBSD: Makefile,v 1.24 2000/07/16 21:56:13 jdolecek Exp $
LIB=sa
MKLINT=no
MKPIC=no
MKPROFILE=no
NOPROFILE=
NOPIC=
NOLINT=
# Logically src/sys
S=${.CURDIR}/../../../..
@ -33,12 +36,12 @@ SRC_kern= ashrdi3.c bcmp.c bzero.c inet_addr.c intoa.c \
SRC_here= clock.c dev_disk.c devopen.c exec_sun.c \
gets.c idprom.c netif_sun.c panic.c \
promboot.c promcons.c promdev.c \
sun3.c sun3x.c version.c
sun3.c sun3x.c vers.c xxboot.c
SRCS= ${SRC_net} ${SRC_sa} ${SRC_kern} ${SRC_here}
OBJS= ctrlsp.o
SRCS+= ${S}/arch/sun3/sun3/ctrlsp.S
realall: libsa.a SRT0.o SRT1.o
all: SRT0.o SRT1.o
# only needed during build
libinstall::
@ -54,18 +57,5 @@ SOBJS=
${OBJS} SRT0.o SRT1.o : machine m68k
machine :
-rm -f $@
ln -s ${S}/arch/sun3/include $@
m68k :
-rm -f $@
ln -s ${S}/arch/m68k/include $@
ctrlsp.o : ${S}/arch/sun3/sun3/ctrlsp.S
${COMPILE.S} ${.IMPSRC}
# This is for programs using ../Makefile.inc
echo_objdir:
@echo ${.OBJDIR}
vers.c: ${.CURDIR}/version
sh ${S}/conf/newvers_stand.sh -MD ${.CURDIR}/version "sun3"

View File

@ -1,4 +1,4 @@
/* $NetBSD: libsa.h,v 1.5 1999/03/04 07:56:41 gwr Exp $ */
/* $NetBSD: libsa.h,v 1.6 2000/07/16 21:56:13 jdolecek Exp $ */
/*
* This file defines the API for libsa.a
@ -41,5 +41,6 @@ extern int prom_boothow;
/* sun3.c */
void sun3_getidprom __P((u_char *ea));
/* version.c */
extern char version[];
/* vers.c */
extern const char bootprog_rev[];
extern const char bootprog_name[];

View File

@ -0,0 +1,17 @@
$NetBSD: version,v 1.1 2000/07/16 21:56:13 jdolecek Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
file is important - make sure the entries are appended on end, last item
is taken as the current.
1.1: Initial commit.
1.2: Changed dvdma.c and netif_sun.c in libsa.
1.5: Merge arch/sun3x into arch/sun3.
1.6: Both netboot and ufsboot now look for any of:
{ "netbsd", "netbsd.old", "netbsd.$arch" } where arch=sun3 or
arch=sun3x based on the running machine type. Boot media can
support both sun3 and sun3x by providing two kernels.
1.7: Common boot programs run on both Sun 3 and 3X
machines, with different default kernel names
on each so shared root images are possible.
1.8: Changed to use MI sys/conf/newvers_stand.sh & vers.c.

View File

@ -1,20 +0,0 @@
/* $NetBSD: version.c,v 1.7 1998/07/01 23:12:42 gwr Exp $ */
/*
* NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.
*
* 1/98 Common boot programs run on both Sun 3 and 3X
* machines, with different default kernel names
* on each so shared root images are possible.
*
* 6/98 Both netboot and ufsboot now look for any of:
* { "netbsd", "netbsd.old", "netbsd.$arch" }
* where arch=sun3 or arch=sun3x based on the
* running machine type. Boot media can support
* both sun3 and sun3x by providing two kernels.
*/
#include <sys/types.h>
#include "libsa.h"
char version[] = "$Revision: 1.7 $";

View File

@ -1,4 +1,4 @@
/* $NetBSD: xxboot.c,v 1.1 1998/07/01 22:51:43 gwr Exp $ */
/* $NetBSD: xxboot.c,v 1.2 2000/07/16 21:56:14 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -62,7 +62,8 @@ char *kernelnames[] = {
};
char line[80];
main()
void
xxboot_main(const char *boot_type)
{
struct open_file f;
char **npp;
@ -70,7 +71,7 @@ main()
char *entry;
int io, x;
printf(">> NetBSD " XX "boot [%s]\n", version);
printf(">> %s %s [%s]\n", bootprog_name, boot_type, bootprog_rev);
prom_get_boot_info();
/*
@ -80,7 +81,7 @@ main()
*/
f.f_flags = F_RAW;
if (devopen(&f, 0, &file)) {
printf(XX "boot: devopen failed\n");
printf("%s: devopen failed\n", boot_type);
return;
}
@ -111,7 +112,7 @@ main()
*/
for (npp = kernelnames; *npp; npp++) {
file = *npp;
printf(XX "boot: trying %s\n", file);
printf("%s: trying %s\n", boot_type, file);
if ((io = open(file, 0)) >= 0) {
/* The open succeeded. */
goto try_load;
@ -138,14 +139,14 @@ main()
try_load:
/* The open succeeded. Try loading. */
printf(XX "boot: loading %s\n", file);
printf("%s: loading %s\n", boot_type, file);
x = load_sun(io, (char *)LOADADDR, &entry);
close(io);
if (x == 0)
break;
err:
printf(XX "boot: %s: %s\n", file, strerror(errno));
printf("%s: %s: %s\n", boot_type, file, strerror(errno));
}
/* Do the "last close" on the underlying device. */

View File

@ -1,27 +1,16 @@
# $NetBSD: Makefile,v 1.10 1998/07/01 22:56:45 gwr Exp $
# $NetBSD: Makefile,v 1.11 2000/07/16 21:56:14 jdolecek Exp $
SA_PROG= netboot
# Using local rule for this
SRCxx= ${.CURDIR}/../libsa/xxboot.c
# Regular local source
SRC1= conf.c
SRCS= conf.c
# Build these locally too
SRC2= dev_net.c bootparam.c globals.c nfs.c rpc.c
SRCS= ${SRCxx} ${SRC1} ${SRC2}
OBJS= boot.o ${SRC1:.c=.o} ${SRC2:.c=.o}
# Build these locally
SRCS+= dev_net.c bootparam.c globals.c nfs.c rpc.c
all: ${SA_PROG}.bin
.include <bsd.prog.mk>
.PATH: ${S}/lib/libsa
DEFS+= -DSUN_BOOTPARAMS
# This file is common to netboot and ufsboot,
# but gets a define so it knows which it is.
boot.o : ${SRCxx}
${COMPILE.c} -DXX='"net"' -o $@ ${SRCxx}

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.3 1996/01/29 23:54:14 gwr Exp $ */
/* $NetBSD: conf.c,v 1.4 2000/07/16 21:56:14 jdolecek Exp $ */
#include <sys/types.h>
#include <netinet/in.h>
@ -17,3 +17,7 @@ struct devsw devsw[] = {
};
int ndevs = 1;
void
main() {
xxboot_main("netboot");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.4 1998/06/29 20:18:07 gwr Exp $ */
/* $NetBSD: boot.c,v 1.5 2000/07/16 21:56:14 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -60,7 +60,7 @@ main()
{
char *cp, *file;
printf(">> NetBSD tapeboot [%s]\n", version);
printf(">> %s tapeboot [%s]\n", bootprog_name, bootprog_rev);
prom_get_boot_info();
/*

View File

@ -1,27 +1,15 @@
# $NetBSD: Makefile,v 1.6 1998/07/01 22:56:45 gwr Exp $
# $NetBSD: Makefile,v 1.7 2000/07/16 21:56:15 jdolecek Exp $
SA_PROG= ufsboot
# Using local rule for this
SRCxx= ${.CURDIR}/../libsa/xxboot.c
# Regular local source
SRC1= conf.c
SRCS= conf.c
# Build these locally too
SRC2= ufs.c
SRCS= ${SRCxx} ${SRC1} ${SRC2}
OBJS= boot.o ${SRC1:.c=.o} ${SRC2:.c=.o}
# Build these locally
SRCS+= ufs.c
all: ${SA_PROG}.bin
.include <bsd.prog.mk>
.PATH: ${S}/lib/libsa
DEFS+= -DCOMPAT_UFS
# This file is common to netboot and ufsboot,
# but gets a define so it knows which it is.
boot.o : ${SRCxx}
${COMPILE.c} -DXX='"ufs"' -o $@ ${SRCxx}

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.1.1.1 1995/06/01 20:38:08 gwr Exp $ */
/* $NetBSD: conf.c,v 1.2 2000/07/16 21:56:15 jdolecek Exp $ */
#include <stand.h>
#include <ufs.h>
@ -14,3 +14,7 @@ struct devsw devsw[] = {
};
int ndevs = 1;
void
main() {
xxboot_main("ufsboot");
}