Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/disklabel Rip out all the '-B bootblock' support, every...
details: https://anonhg.NetBSD.org/src/rev/585cd6d260dc
branches: trunk
changeset: 555083:585cd6d260dc
user: dsl <dsl%NetBSD.org@localhost>
date: Sat Nov 08 09:25:01 2003 +0000
description:
Rip out all the '-B bootblock' support, everything should use installboot(8).
(can only affect arm32, hp300 and vax ports, and doesn't affect sysinst).
diffstat:
sbin/disklabel/Makefile | 15 +-
sbin/disklabel/disklabel.8 | 156 +-------------------
sbin/disklabel/disklabel.c | 359 ++------------------------------------------
3 files changed, 28 insertions(+), 502 deletions(-)
diffs (truncated from 790 to 300 lines):
diff -r d1c23bd89f8b -r 585cd6d260dc sbin/disklabel/Makefile
--- a/sbin/disklabel/Makefile Sat Nov 08 08:09:38 2003 +0000
+++ b/sbin/disklabel/Makefile Sat Nov 08 09:25:01 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.47 2003/11/02 02:52:58 shin Exp $
+# $NetBSD: Makefile,v 1.48 2003/11/08 09:25:01 dsl Exp $
# @(#)Makefile 8.2 (Berkeley) 3/17/94
PROG= disklabel
@@ -7,18 +7,6 @@
LDADD+= -lutil
DPADD+= ${LIBUTIL}
-.if (${MACHINE} == "i386" || ${MACHINE} == "amd64")
-# recognize old partition ID for a while
-CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
-# use MBR partition info
-CPPFLAGS+= -DUSE_MBR
-.endif
-
-.if (${MACHINE} == "hp300") || (${MACHINE} == "vax") \
- || (${MACHINE} == "arm32")
-CPPFLAGS+= -DNUMBOOT=1
-.endif
-
# these have additional requirements on the alignment of a partition
.if (${MACHINE} == "sparc") || (${MACHINE} == "sparc64") \
|| (${MACHINE} == "sun3")
@@ -37,6 +25,7 @@
|| (${MACHINE} == "evbarm") || (${MACHINE} == "hpcarm") \
|| (${MACHINE} == "netwinder") || (${MACHINE} == "acorn32") \
|| (${MACHINE} == "cats") || (${MACHINE} == "shark") \
+ || (${MACHINE} == "i386") || (${MACHINE} == "amd64") \
|| (${MACHINE} == "playstation2")
# recognize old partition ID for a while
CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
diff -r d1c23bd89f8b -r 585cd6d260dc sbin/disklabel/disklabel.8
--- a/sbin/disklabel/disklabel.8 Sat Nov 08 08:09:38 2003 +0000
+++ b/sbin/disklabel/disklabel.8 Sat Nov 08 09:25:01 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: disklabel.8,v 1.47 2003/08/07 10:04:12 agc Exp $
+.\" $NetBSD: disklabel.8,v 1.48 2003/11/08 09:25:01 dsl Exp $
.\"
.\" Copyright (c) 1987, 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94
.\"
-.Dd July 13, 2003
+.Dd November 8, 2003
.Dt DISKLABEL 8
.Os
.Sh NAME
@@ -67,36 +67,6 @@
.Nm
.Op Fl NW
.Ar disk
-.sp
-.Nm
-.Fl B
-.Op Fl f Ar disktab
-.Oo
-.Fl b Ar boot1
-.Op Fl s Ar boot2
-.Oc
-.Ar disk
-.Oo Ar disktype Oc
-.Nm
-.Fl w
-.Fl B
-.Op Fl f Ar disktab
-.Oo
-.Fl b Ar boot1
-.Op Fl s Ar boot2
-.Oc
-.Ar disk Ar disktype
-.Oo Ar packid Oc
-.Nm
-.Fl R
-.Fl B
-.Op Fl f Ar disktab
-.Oo
-.Fl b Ar boot1
-.Op Fl s Ar boot2
-.Oc
-.Ar disk Ar protofile
-.Oo Ar disktype Oc
.Sh DESCRIPTION
.Nm
can be used to install, examine or modify the label on a disk drive or pack.
@@ -104,9 +74,6 @@
to change the drive identification,
the disk partitions on the drive,
or to replace a damaged label.
-On some systems,
-.Nm
-can be used to install bootstrap code as well.
.Pp
There are several forms of the command that read (display), install or edit
the label on a disk.
@@ -128,15 +95,6 @@
option but provides defaults instead of failing with
an error, if there is no existing disklabel on the disk.
.Pp
-The read and install forms also support the
-.Fl B
-option to install bootstrap code on some platforms,
-e.g., hp300, vax, and arm32.
-The
-.Fl B
-option is not supported on all platforms.
-These variants are described later.
-.Pp
The first form of the command (read) is used to examine the label on the named
disk drive (e.g., sd0 or /dev/rsd0c).
It will display all of the parameters associated with the drive
@@ -233,74 +191,9 @@
.Nm
explicitly disallow and
allow, respectively, writing of the pack label area on the selected disk.
-.Pp
-The final three forms of
-.Nm
-are used to install bootstrap code on machines where the bootstrap is part
-of the label.
-The bootstrap code is composed of one or two boot programs depending on
-the machine.
-The
-.Fl B
-option is used (on some platforms only, see above) to denote that
-bootstrap code is to be installed.
-The
-.Fl r
-flag is implied by
-.Fl B
-and never needs to be specified.
-The name of the boot program(s) to be installed can be selected in a
-variety of ways.
-First, the names can be specified explicitly via the
-.Fl b
-and
-.Fl s
-flags.
-On machines with only a single level of boot program,
-.Fl b
-is the name of that program.
-For machines with a two-level bootstrap,
-.Fl b
-indicates the primary boot program and
-.Fl s
-the secondary boot program.
-If the names are not explicitly given, standard boot programs will be used.
-The boot programs are located in
-.Pa /usr/mdec .
-The names of the programs are taken from the
-.Dq b0
-and
-.Dq b1
-parameters of the
-.Xr disktab 5
-entry for the disk if
-.Ar disktype
-was given and its disktab entry exists and includes those parameters.
-Otherwise, boot program names are derived from the name of the disk.
-These names are of the form
-.Pa basename Ns boot
-for the primary (or only) bootstrap, and
-.Pf boot Pa basename
-for the secondary bootstrap;
-for example,
-.Pa /usr/mdec/sdboot
-and
-.Pa /usr/mdec/bootsd
-if the disk device is
-.Em sd0 .
-.Pp
-The first of the three boot-installation forms is used to install
-bootstrap code without changing the existing label.
-It is essentially a read command with respect to the disk label
-itself and all options are related to the specification of the boot
-program as described previously.
-The final two forms are analogous to the basic write and restore versions
-except that they will install bootstrap code in addition to a new label.
.Sh FILES
-.Bl -tag -width /usr/mdec/xxboot -compact
+.Bl -tag -width /etc/disktab -compact
.It Pa /etc/disktab
-.It Pa /usr/mdec/ Ns Em xx Ns boot
-.It Pa /usr/mdec/boot Ns Em xx
.El
.Sh EXAMPLES
.Dl disklabel sd0
@@ -317,7 +210,6 @@
using
.Pa foo
as the disk pack label.
-Any existing bootstrap code will be clobbered.
If you do not have an entry for your disk in
.Pa /etc/disktab ,
you can use this style to put
@@ -350,32 +242,9 @@
.Pa mylabel .
Existing bootstrap code is unaffected.
.Pp
-.Dl disklabel -B sd0
-.Pp
-Install a new bootstrap on sd0 (only for platforms which support the
-.Fl B
-option, see above).
-The boot code comes from
-.Pa /usr/mdec/sdboot
-and possibly
-.Pa /usr/mdec/bootsd .
-On-disk and in-core labels are unchanged.
-.Pp
-.Dl disklabel -w -B /dev/rsd0c -b newboot sd2212
-.Pp
-Install a new label and bootstrap (on platforms which support the
-.Fl B
-option, see above).
-The label is derived from disktab information for
-.Dq sd2212
-and installed both in-core and on-disk.
-The bootstrap code comes from the file
-.Pa /usr/mdec/newboot .
-.Pp
.Dl disklabel -R -r sd0 \*[Lt]protofile\*[Gt]
.Pp
-Install a new label and bootstrap on a disk, from a prototype label
-file.
+Install a new label on a disk, from a prototype label file.
This is a good way to install a label on a previously unlabeled
disk for which no entry appears in
.Pa /etc/disktab ,
@@ -396,23 +265,6 @@
.Dq a
partition.
.Pp
-On some machines the bootstrap code may not fit entirely in the area
-allocated for it by some filesystems.
-As a result, it may not be possible to have filesystems on some partitions
-of a
-.Dq bootable
-disk.
-When installing bootstrap code,
-.Nm
-checks for these cases.
-If the installed boot code would overlap a partition of type FS_UNUSED
-it is marked as type FS_BOOT.
-The
-.Xr newfs 8
-utility will disallow creation of filesystems on FS_BOOT partitions.
-Conversely, if a partition has a type other than FS_UNUSED or FS_BOOT,
-.Nm
-will not install bootstrap code that overlaps it.
.Sh SEE ALSO
.Xr disklabel 5 ,
.Xr disktab 5 ,
diff -r d1c23bd89f8b -r 585cd6d260dc sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c Sat Nov 08 08:09:38 2003 +0000
+++ b/sbin/disklabel/disklabel.c Sat Nov 08 09:25:01 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.119 2003/10/08 04:25:44 lukem Exp $ */
+/* $NetBSD: disklabel.c,v 1.120 2003/11/08 09:25:01 dsl Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -43,7 +43,7 @@
static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#else
-__RCSID("$NetBSD: disklabel.c,v 1.119 2003/10/08 04:25:44 lukem Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.120 2003/11/08 09:25:01 dsl Exp $");
#endif
#endif /* not lint */
@@ -90,10 +90,6 @@
#define BBSIZE 8192 /* size of boot area, with label */
#endif
-#ifndef NUMBOOT
-#define NUMBOOT 0
-#endif
-
#define DEFEDITOR _PATH_VI
static char *dkname;
@@ -106,20 +102,8 @@
char *specname;
-#if NUMBOOT > 0
-static int installboot; /* non-zero if we should install a boot program */
-static char *bootbuf; /* pointer to buffer with remainder of boot prog */
-static int bootsize; /* size of remaining boot program */
-static char *xxboot; /* primary boot */
-static char *bootxx; /* secondary boot */
-static char boot0[MAXPATHLEN];
-#if NUMBOOT > 1
Home |
Main Index |
Thread Index |
Old Index