From e591777ba7019a89be58f540822ac482b6ec54ae Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 7 Apr 1999 22:57:27 +0000 Subject: Kill -F option, it is not needed and just plain wrong anyway --- sbin/disklabel/disklabel.8 | 14 ++++---------- sbin/disklabel/disklabel.c | 16 ++++++---------- sbin/disklabel/editor.c | 22 ++++++++++------------ 3 files changed, 20 insertions(+), 32 deletions(-) (limited to 'sbin/disklabel') diff --git a/sbin/disklabel/disklabel.8 b/sbin/disklabel/disklabel.8 index dd932342bf4..3962a97fee0 100644 --- a/sbin/disklabel/disklabel.8 +++ b/sbin/disklabel/disklabel.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: disklabel.8,v 1.28 1999/03/25 15:34:54 espie Exp $ +.\" $OpenBSD: disklabel.8,v 1.29 1999/04/07 22:57:25 millert Exp $ .\" $NetBSD: disklabel.8,v 1.9 1995/03/18 14:54:38 cgd Exp $ .\" .\" Copyright (c) 1987, 1988, 1991, 1993 @@ -66,7 +66,6 @@ .Nm disklabel .Fl E .Op Fl f Ar tempfile -.Op Fl F .Op Fl n .Op Fl d Li \&| Fl r .Op Fl v @@ -387,12 +386,10 @@ Exit the editor without saving any changes to the label. .El .Pp The -.Fl F -and .Fl f Ar tempfile -flags to +flag to .Nm -are only valid when used in conjunction with the +is only valid when used in conjunction with the .Fl E flag. When the .Fl f @@ -403,10 +400,7 @@ will write entries to in .Xr fstab 5 format for any partitions for which mount point information has been -specified. The -.Fl F -flag indicates that the entire disk is to be used for -.Ox . +specified. .Pp The final three forms of .Nm diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index b2b00010dc4..f17e8ca6b98 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.62 1999/03/23 05:18:49 millert Exp $ */ +/* $OpenBSD: disklabel.c,v 1.63 1999/04/07 22:57:25 millert Exp $ */ /* $NetBSD: disklabel.c,v 1.30 1996/03/14 19:49:24 ghudson Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: disklabel.c,v 1.62 1999/03/23 05:18:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: disklabel.c,v 1.63 1999/04/07 22:57:25 millert Exp $"; #endif /* not lint */ #include @@ -128,7 +128,7 @@ struct disklabel *makebootarea __P((char *, struct disklabel *, int)); void display __P((FILE *, struct disklabel *)); void display_partition __P((FILE *, struct disklabel *, char **, int, char, int)); int width_partition __P((struct disklabel *, int)); -int editor __P((struct disklabel *, int, char *, char *, int)); +int editor __P((struct disklabel *, int, char *, char *)); int edit __P((struct disklabel *, int)); int editit __P((void)); char *skip __P((char *)); @@ -146,7 +146,6 @@ main(argc, argv) char *argv[]; { int ch, f, writeable, error = 0; - int whole_mode = 0; char *fstabfile = NULL; struct disklabel *lp; FILE *t; @@ -196,9 +195,6 @@ main(argc, argv) usage(); op = EDITOR; break; - case 'F': - whole_mode = 1; - break; case 'f': fstabfile = optarg; break; @@ -274,7 +270,7 @@ main(argc, argv) usage(); if ((lp = readlabel(f)) == NULL) exit(1); - error = editor(lp, f, specname, fstabfile, whole_mode); + error = editor(lp, f, specname, fstabfile); break; case READ: if (argc != 1) @@ -1751,8 +1747,8 @@ usage() " disklabel [-nv] [-r|-d] -e disk%s (edit)\n", blank); fprintf(stderr, - " disklabel [-nv] [-r|-d] [-F] [-f temp] -E disk%.*s (simple editor)\n", - strlen(blank) - 9, blank); + " disklabel [-nv] [-r|-d] [-f temp] -E disk%.*s (simple editor)\n", + strlen(blank) - 4, blank); fprintf(stderr, " disklabel [-nv] [-r]%s -R disk proto (restore)\n", boot); diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 27dcb42670b..d7c8c6f152b 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.62 1999/04/07 08:17:21 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.63 1999/04/07 22:57:26 millert Exp $ */ /* * Copyright (c) 1997-1999 Todd C. Miller @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.62 1999/04/07 08:17:21 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.63 1999/04/07 22:57:26 millert Exp $"; #endif /* not lint */ #include @@ -78,7 +78,7 @@ struct mountinfo { }; void edit_parms __P((struct disklabel *, u_int32_t *)); -int editor __P((struct disklabel *, int, char *, char *, int)); +int editor __P((struct disklabel *, int, char *, char *)); void editor_add __P((struct disklabel *, char **, u_int32_t *, char *)); void editor_change __P((struct disklabel *, u_int32_t *, char *)); void editor_countfree __P((struct disklabel *, u_int32_t *)); @@ -95,7 +95,7 @@ u_int32_t next_offset __P((struct disklabel *, struct partition *)); int partition_cmp __P((const void *, const void *)); struct partition **sort_partitions __P((struct disklabel *, u_int16_t *)); void getdisktype __P((struct disklabel *, char *, char *)); -void find_bounds __P((struct disklabel *, struct disklabel *, int)); +void find_bounds __P((struct disklabel *, struct disklabel *)); void set_bounds __P((struct disklabel *, u_int32_t *)); struct diskchunk *free_chunks __P((struct disklabel *)); char ** mpcopy __P((char **, char **)); @@ -134,7 +134,7 @@ extern struct dos_partition *dosdp; /* DOS partition, if found */ * Simple partition editor. Primarily intended for new labels. */ int -editor(lp, f, dev, fstabfile, whole_mode) +editor(lp, f, dev, fstabfile) struct disklabel *lp; int f; char *dev; @@ -163,7 +163,7 @@ editor(lp, f, dev, fstabfile, whole_mode) get_geometry(f, &disk_geop, &bios_geop); /* How big is the OpenBSD portion of the disk? */ - find_bounds(&label, bios_geop, whole_mode); + find_bounds(&label, bios_geop); /* Set freesectors based on bounds and initial label */ editor_countfree(&label, &freesectors); @@ -1676,10 +1676,9 @@ free_chunks(lp) * What is the OpenBSD portion of the disk? Uses the MBR if applicable. */ void -find_bounds(lp, bios_lp, whole_mode) +find_bounds(lp, bios_lp) struct disklabel *lp; struct disklabel *bios_lp; - int whole_mode; { struct partition *pp = &lp->d_partitions[RAW_PART]; @@ -1691,12 +1690,11 @@ find_bounds(lp, bios_lp, whole_mode) #ifdef DOSLABEL /* * If we have an MBR, use values from the {Open,Free,Net}BSD partition - * unless we are in whole disk mode (in which case we ignore the MBR). */ if (dosdp) { if (dosdp->dp_typ == DOSPTYP_OPENBSD || - dosdp->dp_typ == DOSPTYP_FREEBSD || - dosdp->dp_typ == DOSPTYP_NETBSD) { + dosdp->dp_typ == DOSPTYP_FREEBSD || + dosdp->dp_typ == DOSPTYP_NETBSD) { u_int32_t i, new_end; /* Set start and end based on fdisk partition bounds */ @@ -1748,7 +1746,7 @@ find_bounds(lp, bios_lp, whole_mode) } } else { /* Don't trounce the MBR */ - starting_sector = 32; + starting_sector = 63; } printf("\nTreating sectors %u-%u as the OpenBSD portion of the " -- cgit v1.2.3