diff options
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r-- | sbin/bsdlabel/Makefile | 2 | ||||
-rw-r--r-- | sbin/bsdlabel/Makefile.depend | 4 | ||||
-rw-r--r-- | sbin/bsdlabel/bsdlabel.8 | 26 | ||||
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 31 | ||||
-rw-r--r-- | sbin/bsdlabel/disktab | 3 | ||||
-rw-r--r-- | sbin/bsdlabel/pathnames.h | 3 |
6 files changed, 30 insertions, 39 deletions
diff --git a/sbin/bsdlabel/Makefile b/sbin/bsdlabel/Makefile index 6921a655af10..9bfa0fad6573 100644 --- a/sbin/bsdlabel/Makefile +++ b/sbin/bsdlabel/Makefile @@ -1,5 +1,3 @@ -# @(#)Makefile 8.2 (Berkeley) 3/17/94 -# $FreeBSD$ .PATH: ${SRCTOP}/sys/geom diff --git a/sbin/bsdlabel/Makefile.depend b/sbin/bsdlabel/Makefile.depend index 0220673c9076..0dd05cace3c0 100644 --- a/sbin/bsdlabel/Makefile.depend +++ b/sbin/bsdlabel/Makefile.depend @@ -1,16 +1,12 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libexpat \ lib/libgeom \ - lib/libsbuf \ .include <dirdeps.mk> diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index fe2e6825de03..dcf8c7ccace7 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -28,10 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD$ -.\" -.Dd October 5, 2016 +.Dd March 25, 2024 .Dt BSDLABEL 8 .Os .Sh NAME @@ -62,6 +59,22 @@ .Op Fl f .Ar disk | Fl f Ar file .Ar protofile +.Sh DEPRECATION NOTICE +.Nm +is deprecated and is not available in +.Fx 15.0 +or later. +Use +.Xr gpart 8 +instead +.Po +with the +.Cm BSD +partitioning scheme +.Pc , +or install the +.Pa freebsd-bsdlabel +port or package. .Sh DESCRIPTION The .Nm @@ -505,3 +518,8 @@ The .Nm disklabel utility appeared in .Bx 4.3 Tahoe . +.Sh BUGS +.\" PR276517 +The disklabel scheme supports up to 20 partitions, but +.Nm +supports only 8 partitions. diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 943f37207fc2..a68ee377a97c 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -42,21 +42,6 @@ * from: $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk $ */ -#if 0 -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1987, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 1/7/94"; -/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */ -#endif /* not lint */ -#endif -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include <stdint.h> #include <sys/file.h> @@ -65,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/disk.h> #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 20 +#define MAXPARTITIONS 8 /* XXX should be 20, but see PR276517 */ #include <sys/disklabel.h> #include <unistd.h> @@ -146,10 +131,14 @@ main(int argc, char *argv[]) FILE *t; int ch, error, fd; const char *name; - + error = 0; name = NULL; + fprintf(stderr, + "WARNING: bsdlabel is deprecated and is not available in FreeBSD 15 or later.\n" + "Please use gpart instead.\n\n"); + while ((ch = getopt(argc, argv, "ABb:efm:nRrw")) != -1) switch (ch) { case 'A': @@ -1094,7 +1083,7 @@ checklabel(struct disklabel *lp) struct partition *pp; int i, errors = 0; char part; - u_long base_offset, needed, total_size, total_percent, current_offset; + u_long base_offset, needed, total_percent, current_offset; long free_space; int seen_default_offset; int hog_part; @@ -1173,7 +1162,6 @@ checklabel(struct disklabel *lp) /* first allocate space to the partitions, then offsets */ - total_size = 0; /* in sectors */ total_percent = 0; /* in percent */ hog_part = -1; /* find all fixed partitions */ @@ -1234,9 +1222,6 @@ checklabel(struct disklabel *lp) size /= lp->d_secsize; pp->p_size = size; } - /* else already in sectors */ - if (i != RAW_PART) - total_size += size; } } } @@ -1272,7 +1257,6 @@ checklabel(struct disklabel *lp) if (part_set[i] && part_size_type[i] == '%') { /* careful of overflows! and integer roundoff */ pp->p_size = ((double)pp->p_size/100) * free_space; - total_size += pp->p_size; /* FIX we can lose a sector or so due to roundoff per partition. A more complex algorithm could avoid that */ @@ -1328,7 +1312,6 @@ checklabel(struct disklabel *lp) } else { lp->d_partitions[hog_part].p_size = current_offset - base_offset - needed; - total_size += lp->d_partitions[hog_part].p_size; } } diff --git a/sbin/bsdlabel/disktab b/sbin/bsdlabel/disktab index b9bf610d597f..72ff689c82ff 100644 --- a/sbin/bsdlabel/disktab +++ b/sbin/bsdlabel/disktab @@ -1,4 +1,3 @@ -# $FreeBSD$ # # Disk geometry and partition layout tables. # See disktab(5) for format of this file. @@ -9,7 +8,7 @@ # # To make a filesystem on a floppy: # fdformat [-f <size>] fd<drive>[.<size>] -# disklabel -B -r -w fd<drive>[.<size>] fd<size> +# disklabel -B -w fd<drive>[.<size>] fd<size> # newfs <opts> fd<drive>[.<size>] # # with <opts>: diff --git a/sbin/bsdlabel/pathnames.h b/sbin/bsdlabel/pathnames.h index 77ee59e0279e..4d215eb72e33 100644 --- a/sbin/bsdlabel/pathnames.h +++ b/sbin/bsdlabel/pathnames.h @@ -27,9 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)pathnames.h 8.1 (Berkeley) 6/5/93 - * $FreeBSD$ */ #include <paths.h> |