Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/stand decommission old installboot; it doesn'...



details:   https://anonhg.NetBSD.org/src/rev/53c609109f61
branches:  trunk
changeset: 526653:53c609109f61
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue May 07 12:32:52 2002 +0000

description:
decommission old installboot; it doesn't work on bootxx anymore anyway.

diffstat:

 sys/arch/sparc/stand/Makefile                  |    4 +-
 sys/arch/sparc/stand/common/bbinfo.h           |   41 --
 sys/arch/sparc/stand/installboot/Makefile      |   36 --
 sys/arch/sparc/stand/installboot/installboot.c |  417 -------------------------
 4 files changed, 2 insertions(+), 496 deletions(-)

diffs (truncated from 517 to 300 lines):

diff -r 2b17bb243678 -r 53c609109f61 sys/arch/sparc/stand/Makefile
--- a/sys/arch/sparc/stand/Makefile     Tue May 07 12:28:20 2002 +0000
+++ b/sys/arch/sparc/stand/Makefile     Tue May 07 12:32:52 2002 +0000
@@ -1,5 +1,5 @@
-#      $NetBSD: Makefile,v 1.16 2001/03/04 15:34:45 mrg Exp $
+#      $NetBSD: Makefile,v 1.17 2002/05/07 12:32:52 lukem Exp $
 
-SUBDIR= boot bootxx installboot bootblk ofwboot ofwboot.net binstall
+SUBDIR= boot bootxx bootblk ofwboot ofwboot.net binstall
 
 .include <bsd.subdir.mk>
diff -r 2b17bb243678 -r 53c609109f61 sys/arch/sparc/stand/common/bbinfo.h
--- a/sys/arch/sparc/stand/common/bbinfo.h      Tue May 07 12:28:20 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*     $NetBSD: bbinfo.h,v 1.1 2001/10/30 05:13:10 thorpej Exp $       */
-
-/*
- * Copyright (c) 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#define        MAXBLOCKNUM     256     /* enough for a 2MB boot program (bs 8K) */
-
-/* Magic string -- 32 bytes long (including the NUL) */
-#define        BBINFO_MAGIC    "NetBSD/sparc bootxx            "
-#define        BBINFO_MAGICSIZE sizeof(BBINFO_MAGIC)
-
-struct bbinfo {
-       uint8_t bbi_magic[BBINFO_MAGICSIZE];
-       int32_t bbi_block_size;
-       int32_t bbi_block_count;
-       int32_t bbi_block_table[MAXBLOCKNUM];
-};
diff -r 2b17bb243678 -r 53c609109f61 sys/arch/sparc/stand/installboot/Makefile
--- a/sys/arch/sparc/stand/installboot/Makefile Tue May 07 12:28:20 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#      $NetBSD: Makefile,v 1.24 2002/01/02 05:21:34 mrg Exp $
-
-NOMAN= # defined
-
-.include <bsd.own.mk>
-
-WARNS?=1
-PROG=  installboot
-SRCS=  installboot.c byteorder.c loadfile.c loadfile_aout.c loadfile_elf32.c
-
-CPPFLAGS+=-DBOOT_AOUT -DBOOT_ELF32
-
-CFLAGS+=-g
-
-LIBSA=${.CURDIR}/../../../../lib/libsa
-
-.PATH.c: ${LIBSA}
-
-CPPFLAGS+=-I${LIBSA} -I.
-CPPFLAGS+=-I${.CURDIR}/..
-
-LDSTATIC?=     -static
-
-.if !defined(HOSTPROGNAME)
-.if !make(obj) && !make(clean) && !make(cleandir)
-.BEGIN:
-       @([ -h machine ] || ln -s ${.CURDIR}/../../../${MACHINE}/include machine)
-       @([ -h sparc ] || ln -s ${.CURDIR}/../../../sparc/include sparc)
-.NOPATH: machine sparc
-.endif
-CLEANFILES+= machine sparc
-.endif
-
-.ifndef HOSTPROG
-.include <bsd.prog.mk>
-.endif
diff -r 2b17bb243678 -r 53c609109f61 sys/arch/sparc/stand/installboot/installboot.c
--- a/sys/arch/sparc/stand/installboot/installboot.c    Tue May 07 12:28:20 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,417 +0,0 @@
-/*     $NetBSD: installboot.c,v 1.11 2001/10/30 23:39:08 thorpej Exp $ */
-
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/mman.h>
-#include <sys/utsname.h>
-#include <ufs/ufs/dinode.h>
-#include <ufs/ufs/dir.h>
-#include <ufs/ffs/fs.h>
-#include <err.h>
-#include <a.out.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "loadfile.h"
-#include "byteorder.h"
-#include "common/bbinfo.h"
-
-int    verbose, nowrite, sparc64, uflag, hflag = 1;
-char   *boot, *proto, *dev;
-
-struct bbinfo *bbinfop;                /* bbinfo in prototype image */
-
-int32_t        max_block_count;
-
-char           *loadprotoblocks __P((char *, size_t *));
-int            loadblocknums __P((char *, int));
-static void    devread __P((int, void *, daddr_t, size_t, char *));
-static void    usage __P((void));
-int            main __P((int, char *[]));
-
-static void
-usage()
-{
-       const char *progname = getprogname();
-
-       if (sparc64)
-               (void)fprintf(stderr,
-                   "Usage: %s [-nv] <bootblk> <device>\n"
-                   "       %s -U [-nv] <boot> <proto> <device>\n",
-                   progname, progname);
-       else
-               (void)fprintf(stderr,
-                   "Usage: %s [-nv] <boot> <proto> <device>\n"
-                   "       %s -u [-n] [-v] <bootblk> <device>\n",
-                   progname, progname);
-       exit(1);
-}
-
-int
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
-       int     c;
-       int     devfd;
-       char    *protostore;
-       size_t  protosize;
-       struct  utsname utsname;
-
-       /*
-        * For UltraSPARC machines, we turn on the uflag by default.
-        */
-       if (uname(&utsname) == -1)
-               err(1, "uname");
-       if (strcmp(utsname.machine, "sparc64") == 0)
-               sparc64 = uflag = 1;
-
-       while ((c = getopt(argc, argv, "a:nhuUv")) != -1) {
-               switch (c) {
-               case 'a':
-                       warnx("-a option is obsolete");
-                       break;
-               case 'h':       /* Note: for backwards compatibility */
-                       /* Don't strip a.out header */
-                       warnx("-h option is obsolete");
-                       break;
-               case 'n':
-                       /* Do not actually write the bootblock to disk */
-                       nowrite = 1;
-                       break;
-               case 'u':
-                       /* UltraSPARC boot block */
-                       uflag = 1;
-                       break;
-               case 'U':
-                       /* Force non-ultrasparc */
-                       uflag = 0;
-                       break;
-               case 'v':
-                       /* Chat */
-                       verbose = 1;
-                       break;
-               default:
-                       usage();
-               }
-       }
-
-       if (uflag) {
-               if (argc - optind < 2)
-                       usage();
-       } else {
-               if (argc - optind < 3)
-                       usage();
-               boot = argv[optind++];
-       }
-
-       proto = argv[optind++];
-       dev = argv[optind];
-
-       if (verbose) {
-               if (!uflag)
-                       printf("boot: %s\n", boot);
-               printf("proto: %s\n", proto);
-               printf("device: %s\n", dev);
-       }
-
-       /* Load proto blocks into core */
-       if (uflag == 0) {
-               if ((protostore = loadprotoblocks(proto, &protosize)) == NULL)
-                       exit(1);
-
-               /* Open and check raw disk device */
-               if ((devfd = open(dev, O_RDONLY, 0)) < 0)
-                       err(1, "open: %s", dev);
-
-               /* Extract and load block numbers */
-               if (loadblocknums(boot, devfd) != 0)
-                       exit(1);
-
-               (void)close(devfd);
-       } else {
-               struct stat sb;
-               int protofd;
-               size_t blanklen;
-
-               if ((protofd = open(proto, O_RDONLY)) < 0)
-                       err(1, "open: %s", proto);
-
-               if (fstat(protofd, &sb) < 0)
-                       err(1, "fstat: %s", proto);
-
-               /* there must be a better way */
-               blanklen = DEV_BSIZE - ((sb.st_size + DEV_BSIZE) & (DEV_BSIZE - 1));
-               protosize = sb.st_size + blanklen;
-               if ((protostore = mmap(0, (size_t)protosize,
-                   PROT_READ|PROT_WRITE, MAP_PRIVATE,
-                   protofd, 0)) == MAP_FAILED)
-                       err(1, "mmap: %s", proto);
-               /* and provide the rest of the block */
-               if (blanklen)
-                       memset(protostore + sb.st_size, 0, blanklen);
-       }
-
-       if (nowrite)
-               return 0;
-



Home | Main Index | Thread Index | Old Index