Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/stand/bootblock/installboot Remove unused; sw...
details: https://anonhg.NetBSD.org/src/rev/35cafcbeef60
branches: trunk
changeset: 365860:35cafcbeef60
user: rin <rin%NetBSD.org@localhost>
date: Fri Apr 29 07:19:33 2022 +0000
description:
Remove unused; switched to usr.sbin/installboot/arch/amiga.c long ago.
diffstat:
sys/arch/amiga/stand/bootblock/installboot/Makefile | 13 -
sys/arch/amiga/stand/bootblock/installboot/installboot.c | 114 ---------------
2 files changed, 0 insertions(+), 127 deletions(-)
diffs (135 lines):
diff -r b6499197adf5 -r 35cafcbeef60 sys/arch/amiga/stand/bootblock/installboot/Makefile
--- a/sys/arch/amiga/stand/bootblock/installboot/Makefile Fri Apr 29 07:18:17 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-# $NetBSD: Makefile,v 1.8 2016/09/17 17:09:10 christos Exp $
-
-.include <bsd.init.mk>
-
-PROG=installboot
-SRCS=installboot.c chksum.c
-BINDIR=/usr/mdec
-
-NOMAN= # defined
-
-.PATH: ${.CURDIR}/../elf2bb # chksum.c
-
-.include <bsd.prog.mk>
diff -r b6499197adf5 -r 35cafcbeef60 sys/arch/amiga/stand/bootblock/installboot/installboot.c
--- a/sys/arch/amiga/stand/bootblock/installboot/installboot.c Fri Apr 29 07:18:17 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/* $NetBSD: installboot.c,v 1.6 2017/02/12 18:21:50 maxv Exp $ */
-
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "../elf2bb/chksum.h"
-
-/* XXX Must be kept in sync with bbstart.s! */
-#define CMDLN_LOC 0x10
-#define CMDLN_LEN 0x20
-
-int main(int argc, char *argv[]);
-
-int main(int argc, char *argv[]){
-
- char *line = NULL;
- char *progname;
- char *bootnam, *devnam;
- char *dline;
- int bootfd, devfd;
- int rc; /* read, write */
- int c; /* getopt */
- int sumlen;
- u_int32_t sum2, sum16;
-
- u_int32_t block[128*16];
-
- progname = argv[0];
- while ((c = getopt(argc, argv, "l:")) != -1) {
- switch(c) {
- case 'l':
- line = optarg;
- break;
- default:
- errx(1,
- "usage: %s [-l newcommandline] bootblock device",
- progname);
- }
- }
- argc -= optind;
- argv += optind;
- if (argc != 2) {
- errx(1, "usage: %s [-l newcommandline] bootblock device",
- progname);
- /* NOTREACHED */
- }
-
- bootnam = *argv++;
- devnam = *argv;
-
- bootfd = open(bootnam, O_RDONLY, 0);
- if (bootfd < 0) {
- err(1, "Can't open bootblock for reading");
- /* NOTREACHED */
- }
-
- devfd = open(devnam, O_CREAT|O_RDWR, 0666);
- if (devfd < 0) {
- err(1, "Can't open output device for writing");
- /* NOTREACHED */
- }
-
- rc = read(bootfd, block, sizeof(block));
-
- if (rc < sizeof(block)) {
- err(1, "Can't read bootblock");
- /* NOTREACHED */
- }
-
- /* XXX the choices should not be hardcoded */
-
- sum2 = chksum(block, 1024/4);
- sum16 = chksum(block, 8192/4);
-
- if (sum16 == 0xffffffff) {
- sumlen = 8192/4;
- } else if (sum2 == 0xffffffff) {
- sumlen = 1024/4;
- } else {
- errx(1, "%s: wrong checksum", bootnam);
- /* NOTREACHED */
- }
-
- if (sum2 == sum16) {
- warnx("eek - both sums are the same");
- }
-
-
- if (line) {
- dline = (char *)&(block[CMDLN_LOC/4]);
- /* XXX keep the default default line in sync with bbstart.s */
- if (strcmp(dline, "netbsd -ASn2") != 0) {
- errx(1, "Old bootblock version? Can't change command line.");
- }
- (void)strncpy(dline, line, CMDLN_LEN-1);
-
- block[1] = 0;
- block[1] = 0xffffffff - chksum(block, sumlen);
- }
-
- rc = write(devfd, block, sizeof(block));
-
- if (rc < sizeof(block)) {
- err(1, "Can't write bootblock");
- /* NOTREACHED */
- }
-
- exit(1);
- /* NOTREACHED */
-}
Home |
Main Index |
Thread Index |
Old Index