summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-06-05 11:57:18 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-06-05 11:57:18 +0000
commite71cc3e83f19c135c9a5d6c4f56a4581d11e38c7 (patch)
tree6a826b4b074936b711d662d41cded1db80e85d7b
parente34568bbe2ff16dc22896fb2252fca17a104ca30 (diff)
Nuke uses of and references to DIOCWLABEL, and the related 'W' and
'N' command line options. ok matthew@
-rw-r--r--sbin/disklabel/disklabel.513
-rw-r--r--sbin/disklabel/disklabel.823
-rw-r--r--sbin/disklabel/disklabel.c44
3 files changed, 8 insertions, 72 deletions
diff --git a/sbin/disklabel/disklabel.5 b/sbin/disklabel/disklabel.5
index e9cca63723b..4bebf36cd6f 100644
--- a/sbin/disklabel/disklabel.5
+++ b/sbin/disklabel/disklabel.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: disklabel.5,v 1.19 2007/05/31 19:19:43 jmc Exp $
+.\" $OpenBSD: disklabel.5,v 1.20 2011/06/05 11:57:17 krw Exp $
.\" $NetBSD: disklabel.5,v 1.3 1995/03/18 14:54:36 cgd Exp $
.\"
.\" Copyright (c) 1987, 1991, 1993
@@ -33,7 +33,7 @@
.\"
.\" @(#)disklabel.5.5 8.1 (Berkeley) 6/5/93
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: June 5 2011 $
.Dt DISKLABEL 5
.Os
.Sh NAME
@@ -67,15 +67,6 @@ without any information about the disk geometry.
It is at an offset
.Dv LABELOFFSET
from the beginning of the sector, to allow room for the initial bootstrap.
-The disk sector containing the label is normally made read-only
-so that it is not accidentally overwritten by pack-to-pack copies
-or swap operations;
-the
-.Dv DIOCWLABEL
-.Xr ioctl 2 ,
-which is done as needed by the
-.Xr disklabel 8
-program, allows modification of the label sector.
.Pp
A copy of the in-core label for a disk can be obtained with the
.Dv DIOCGDINFO
diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8
index 9b11153bb3b..a98d6fc0f6b 100644
--- a/sbin/disklabel/disklabel.8
+++ b/sbin/disklabel/disklabel.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: disklabel.8,v 1.102 2011/05/23 08:40:56 otto Exp $
+.\" $OpenBSD: disklabel.8,v 1.103 2011/06/05 11:57:17 krw Exp $
.\" $NetBSD: disklabel.8,v 1.9 1995/03/18 14:54:38 cgd Exp $
.\"
.\" Copyright (c) 1987, 1988, 1991, 1993
@@ -33,7 +33,7 @@
.\"
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: May 23 2011 $
+.Dd $Mdocdate: June 5 2011 $
.Dt DISKLABEL 8
.Os
.Sh NAME
@@ -66,10 +66,6 @@
.Fl R
.Op Fl nv
.Ar disk Ar protofile
-.Nm disklabel
-.Fl N | W
-.Op Fl nv
-.Ar disk
.Pp
.Nm disklabel
.Fl B\ \&
@@ -184,8 +180,6 @@ The same as
except that entries will be written using disk device names.
.It Fl h
Print partition sizes in human readable format.
-.It Fl N
-Disallow writing of the pack label area on the selected disk.
.It Fl n
Make no permanent changes to the disklabel
.Pq useful for debugging purposes .
@@ -216,8 +210,6 @@ entry.
.It Fl v
Print additional information during operation
.Pq verbose mode .
-.It Fl W
-Allow writing of the pack label area on the selected disk.
.It Fl w
Write a standard label on the designated drive.
.It Ar disk
@@ -492,17 +484,6 @@ Comments are delimited by
and newline.
Any existing bootstrap code will be unaffected.
.Pp
-The sixth form of the command
-.Pq protect
-is used to control write access to the label area of a disk
-so that the label cannot be inadvertently overwritten.
-The
-.Fl N
-and
-.Fl W
-options are only available on architectures that support this feature,
-such as vax, hp300 and some sparc models.
-.Pp
The final three forms of
.Nm
are used to install bootstrap code on machines where the bootstrap is
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index d0e74e1c5e6..731d2111762 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.180 2011/06/02 17:00:24 krw Exp $ */
+/* $OpenBSD: disklabel.c,v 1.181 2011/06/05 11:57:17 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -92,7 +92,7 @@ void setbootflag(struct disklabel *);
#endif
enum {
- UNSPEC, EDIT, EDITOR, READ, RESTORE, SETWRITEABLE, WRITE, WRITEBOOT
+ UNSPEC, EDIT, EDITOR, READ, RESTORE, WRITE, WRITEBOOT
} op = UNSPEC;
int aflag;
@@ -120,11 +120,11 @@ u_int64_t getnum(char *, u_int64_t, u_int64_t, const char **);
int
main(int argc, char *argv[])
{
- int ch, f, writeable, error = 0;
+ int ch, f, error = 0;
struct disklabel *lp;
FILE *t;
- while ((ch = getopt(argc, argv, "ABEf:F:hNRWb:cdenp:s:tvw")) != -1)
+ while ((ch = getopt(argc, argv, "ABEf:F:hRb:cdenp:s:tvw")) != -1)
switch (ch) {
case 'A':
++aflag;
@@ -137,23 +137,11 @@ main(int argc, char *argv[])
xxboot = optarg;
break;
#endif
- case 'N':
- if (op != UNSPEC)
- usage();
- writeable = 0;
- op = SETWRITEABLE;
- break;
case 'R':
if (op != UNSPEC)
usage();
op = RESTORE;
break;
- case 'W':
- if (op != UNSPEC)
- usage();
- writeable = 1;
- op = SETWRITEABLE;
- break;
case 'c':
++cflag;
break;
@@ -273,12 +261,6 @@ main(int argc, char *argv[])
error = writelabel(f, bootarea, lp);
fclose(t);
break;
- case SETWRITEABLE:
- if (!donothing) {
- if (ioctl(f, DIOCWLABEL, (char *)&writeable) < 0)
- err(4, "ioctl DIOCWLABEL");
- }
- break;
case WRITE:
if (dflag | aflag) {
readlabel(f);
@@ -357,10 +339,6 @@ int
writelabel(int f, char *boot, struct disklabel *lp)
{
#if NUMBOOT > 0
- int writeable;
-#endif
-
-#if NUMBOOT > 0
setbootflag(lp);
#endif
lp->d_magic = DISKMAGIC;
@@ -389,14 +367,6 @@ writelabel(int f, char *boot, struct disklabel *lp)
perror("lseek");
return (1);
}
- /*
- * write enable label sector before write (if necessary),
- * disable after writing.
- */
- writeable = 1;
-
- if (ioctl(f, DIOCWLABEL, &writeable) < 0)
- perror("ioctl DIOCWLABEL");
if (write(f, boot, lp->d_bbsize) != lp->d_bbsize) {
perror("write");
return (1);
@@ -409,10 +379,6 @@ writelabel(int f, char *boot, struct disklabel *lp)
perror("write");
return(1);
}
- writeable = 0;
- if (!donothing)
- if (ioctl(f, DIOCWLABEL, &writeable) < 0)
- perror("ioctl DIOCWLABEL");
} else
#endif /* NUMBOOT > 0 */
if (!donothing) {
@@ -1497,8 +1463,6 @@ usage(void)
" disklabel -E [-c | -d] [-Anv] [-F|-f file] disk\t(simple editor)\n");
fprintf(stderr,
" disklabel -R [-nv] disk protofile\t\t\t(restore)\n");
- fprintf(stderr,
- " disklabel -N | -W [-nv] disk\t\t\t\t(protect)\n\n");
#if NUMBOOT > 0
fprintf(stderr,
"%sdisklabel -B [-nv]%s disk [disktype] (boot)\n",