diff --git a/sys/arch/sun3/stand/Makefile.inc b/sys/arch/sun3/stand/Makefile.inc index 0bcf5c781c08..a8cead972297 100644 --- a/sys/arch/sun3/stand/Makefile.inc +++ b/sys/arch/sun3/stand/Makefile.inc @@ -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 $@ + diff --git a/sys/arch/sun3/stand/bootxx/Makefile b/sys/arch/sun3/stand/bootxx/Makefile index fc922855c8f1..a99924fdfba3 100644 --- a/sys/arch/sun3/stand/bootxx/Makefile +++ b/sys/arch/sun3/stand/bootxx/Makefile @@ -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 diff --git a/sys/arch/sun3/stand/installboot/Makefile b/sys/arch/sun3/stand/installboot/Makefile index 6b9c6e67d4ba..679673369ee7 100644 --- a/sys/arch/sun3/stand/installboot/Makefile +++ b/sys/arch/sun3/stand/installboot/Makefile @@ -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 PROG= installboot -MKMAN= no +MKMAN= no +NOMAN= yes BINDIR=/usr/mdec # Need this to work in the miniroot diff --git a/sys/arch/sun3/stand/libsa/Makefile b/sys/arch/sun3/stand/libsa/Makefile index b26b1adaa1a8..cb7a175617e6 100644 --- a/sys/arch/sun3/stand/libsa/Makefile +++ b/sys/arch/sun3/stand/libsa/Makefile @@ -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" diff --git a/sys/arch/sun3/stand/libsa/libsa.h b/sys/arch/sun3/stand/libsa/libsa.h index 4dca2470519b..8d91118a56e4 100644 --- a/sys/arch/sun3/stand/libsa/libsa.h +++ b/sys/arch/sun3/stand/libsa/libsa.h @@ -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[]; diff --git a/sys/arch/sun3/stand/libsa/version b/sys/arch/sun3/stand/libsa/version new file mode 100644 index 000000000000..22efeec33f70 --- /dev/null +++ b/sys/arch/sun3/stand/libsa/version @@ -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. diff --git a/sys/arch/sun3/stand/libsa/version.c b/sys/arch/sun3/stand/libsa/version.c deleted file mode 100644 index dcb0dea83937..000000000000 --- a/sys/arch/sun3/stand/libsa/version.c +++ /dev/null @@ -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 -#include "libsa.h" - -char version[] = "$Revision: 1.7 $"; diff --git a/sys/arch/sun3/stand/libsa/xxboot.c b/sys/arch/sun3/stand/libsa/xxboot.c index 13f334e0104b..9f97427947ee 100644 --- a/sys/arch/sun3/stand/libsa/xxboot.c +++ b/sys/arch/sun3/stand/libsa/xxboot.c @@ -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. */ diff --git a/sys/arch/sun3/stand/netboot/Makefile b/sys/arch/sun3/stand/netboot/Makefile index 44e7b5bf2a4f..16ada9d11f8b 100644 --- a/sys/arch/sun3/stand/netboot/Makefile +++ b/sys/arch/sun3/stand/netboot/Makefile @@ -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 + .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} - diff --git a/sys/arch/sun3/stand/netboot/conf.c b/sys/arch/sun3/stand/netboot/conf.c index 6b51da989bb2..9aeed9abb7bb 100644 --- a/sys/arch/sun3/stand/netboot/conf.c +++ b/sys/arch/sun3/stand/netboot/conf.c @@ -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 #include @@ -17,3 +17,7 @@ struct devsw devsw[] = { }; int ndevs = 1; +void +main() { + xxboot_main("netboot"); +} diff --git a/sys/arch/sun3/stand/tapeboot/boot.c b/sys/arch/sun3/stand/tapeboot/boot.c index 3092ac728e14..c8e74a7f93d8 100644 --- a/sys/arch/sun3/stand/tapeboot/boot.c +++ b/sys/arch/sun3/stand/tapeboot/boot.c @@ -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(); /* diff --git a/sys/arch/sun3/stand/ufsboot/Makefile b/sys/arch/sun3/stand/ufsboot/Makefile index 6958fb86a90b..a3299cf1ba04 100644 --- a/sys/arch/sun3/stand/ufsboot/Makefile +++ b/sys/arch/sun3/stand/ufsboot/Makefile @@ -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 .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} - diff --git a/sys/arch/sun3/stand/ufsboot/conf.c b/sys/arch/sun3/stand/ufsboot/conf.c index a4ff9d726667..2e4ab45481d3 100644 --- a/sys/arch/sun3/stand/ufsboot/conf.c +++ b/sys/arch/sun3/stand/ufsboot/conf.c @@ -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 #include @@ -14,3 +14,7 @@ struct devsw devsw[] = { }; int ndevs = 1; +void +main() { + xxboot_main("ufsboot"); +}