Weaken the restrictions on the device file name a bit: /boot can

now be installed on any partition.
Allow PRIM_LOADSZ to be set in the Makefile.
This together allows to make bootable 720k floppys.
closes PR port-i386/3751
This commit is contained in:
drochner 1997-06-19 11:46:44 +00:00
parent cdfaf160a0
commit cc7a41e5d2
5 changed files with 22 additions and 12 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: installboot.8,v 1.2 1997/06/13 22:15:06 drochner Exp $
.\" $NetBSD: installboot.8,v 1.3 1997/06/19 11:46:45 drochner Exp $
.\"
.\" Copyright (c) 1997 Perry E. Metzger. All rights reserved.
.\" Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -92,7 +92,7 @@ start at the beginning of the
portion of the disk and must contain a FFS filesystem. The
.Nm
program enforces its name to be in the form
.Dq /dev/r*a
.Dq /dev/r*
\&.
.El
.Sh EXAMPLES

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 1997/06/13 13:17:46 drochner Exp $
# $NetBSD: Makefile,v 1.5 1997/06/19 11:46:44 drochner Exp $
S= ${.CURDIR}/../../../../
@ -10,7 +10,11 @@ SRCS= main.c devopen.c conf.c version.c
CLEANFILES+= ${BSSTART} ${PROG}.sym ${PROG}.list
CPPFLAGS+= -DCOMPAT_OLDBOOT
#increase MAXFLENTRIES if "installboot" complains about
# "not enough fragment space in bootcode" (default: 5)
#CPPFLAGS+= -DMAXFLENTRIES=10
#set PRIM_LOADSZ to <=9 to make a 720k boot floppy (default: 15)
#CPPFLAGS+= -DPRIM_LOADSZ=9
#CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
CFLAGS+= -Wall

View File

@ -1,4 +1,4 @@
.\" $NetBSD: installboot.8,v 1.2 1997/06/13 22:15:06 drochner Exp $
.\" $NetBSD: installboot.8,v 1.3 1997/06/19 11:46:45 drochner Exp $
.\"
.\" Copyright (c) 1997 Perry E. Metzger. All rights reserved.
.\" Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -92,7 +92,7 @@ start at the beginning of the
portion of the disk and must contain a FFS filesystem. The
.Nm
program enforces its name to be in the form
.Dq /dev/r*a
.Dq /dev/r*
\&.
.El
.Sh EXAMPLES

View File

@ -1,4 +1,4 @@
/* $NetBSD: installboot.c,v 1.2 1997/06/13 22:15:09 drochner Exp $ */
/* $NetBSD: installboot.c,v 1.3 1997/06/19 11:46:46 drochner Exp $ */
/*
* Copyright (c) 1994 Paul Kranenburg
@ -339,8 +339,6 @@ main(argc, argv)
if (argc - optind != 2) {
usage();
}
if (argv[optind + 1][strlen(argv[optind + 1]) - 1] != 'a')
errx(1, "use partition 'a'!");
bp = loadprotoblocks(argv[optind], &size);
if (!bp)
@ -385,9 +383,15 @@ main(argc, argv)
warn("get disklabel");
goto out;
}
} else
bsdoffs = dl.d_partitions[0].p_offset;
} else {
char c = argv[optind + 1][strlen(argv[optind + 1]) - 1];
#define isvalidpart(c) ((c) >= 'a' && (c) <= 'z')
if(!isvalidpart(c) || (c - 'a') >= dl.d_npartitions) {
warnx("invalid partition");
goto out;
}
bsdoffs = dl.d_partitions[c - 'a'].p_offset;
}
if (verbose)
printf("BSD partition starts at sector %d\n", bsdoffs);

View File

@ -1,4 +1,4 @@
/* $NetBSD: bbinfo.h,v 1.1.1.1 1997/03/14 02:40:34 perry Exp $ */
/* $NetBSD: bbinfo.h,v 1.2 1997/06/19 11:46:47 drochner Exp $ */
/*
* Copyright (c) 1996
@ -56,4 +56,6 @@ struct fraglist {
#ifndef MAXFLENTRIES
#define MAXFLENTRIES 5
#endif
#ifndef PRIM_LOADSZ
#define PRIM_LOADSZ 15
#endif