[Midnightbsd-cvs] src [11241] trunk/sbin/bsdlabel: update bsdlabel

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 1 17:20:29 EDT 2018


Revision: 11241
          http://svnweb.midnightbsd.org/src/?rev=11241
Author:   laffer1
Date:     2018-07-01 17:20:29 -0400 (Sun, 01 Jul 2018)
Log Message:
-----------
update bsdlabel

Modified Paths:
--------------
    trunk/sbin/bsdlabel/Makefile
    trunk/sbin/bsdlabel/bsdlabel.8
    trunk/sbin/bsdlabel/bsdlabel.c
    trunk/sbin/bsdlabel/pathnames.h

Property Changed:
----------------
    trunk/sbin/bsdlabel/bsdlabel.8

Modified: trunk/sbin/bsdlabel/Makefile
===================================================================
--- trunk/sbin/bsdlabel/Makefile	2018-07-01 21:17:56 UTC (rev 11240)
+++ trunk/sbin/bsdlabel/Makefile	2018-07-01 21:20:29 UTC (rev 11241)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.2 (Berkeley) 3/17/94
-# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/bsdlabel/Makefile 219449 2011-03-10 08:24:33Z uqs $
 
 .PATH: ${.CURDIR}/../../sys/geom
 

Modified: trunk/sbin/bsdlabel/bsdlabel.8
===================================================================
--- trunk/sbin/bsdlabel/bsdlabel.8	2018-07-01 21:17:56 UTC (rev 11240)
+++ trunk/sbin/bsdlabel/bsdlabel.8	2018-07-01 21:20:29 UTC (rev 11241)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1987, 1988, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -29,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)disklabel.8	8.2 (Berkeley) 4/19/94
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/sbin/bsdlabel/bsdlabel.8 307427 2016-10-16 23:28:58Z sevan $
 .\"
-.Dd March 5, 2011
+.Dd October 5, 2016
 .Dt BSDLABEL 8
 .Os
 .Sh NAME
@@ -445,7 +446,10 @@
 recognize the disk:
 .Bd -literal -offset indent
 dd if=/dev/zero of=/dev/da0 bs=512 count=32
-fdisk -BI da0
+gpart create -s MBR da0
+gpart add -t freebsd da0
+gpart set -a active -i 1 da0
+gpart bootcode -b /boot/mbr da0
 dd if=/dev/zero of=/dev/da0s1 bs=512 count=32
 bsdlabel -w -B da0s1
 bsdlabel -e da0s1
@@ -457,13 +461,13 @@
 and
 .Cm * ,
 which could be used as a source file for
-.Dq Li "bsdlabel -R ad0s1 new_label_file" :
+.Dq Li "bsdlabel -R ada0s1 new_label_file" :
 .Bd -literal -offset 4n
-# /dev/ad0s1:
+# /dev/ada0s1:
 
 8 partitions:
 #        size   offset    fstype   [fsize bsize bps/cpg]
-  a:   400M       16    4.2BSD     4096 16384    75 	# (Cyl.    0 - 812*)
+  a:   400M       16    4.2BSD     4096 16384    75    # (Cyl.    0 - 812*)
   b:     1G        *      swap
   c:      *        *    unused
   e: 204800        *    4.2BSD
@@ -475,7 +479,7 @@
 to be decreased or the offset of a partition to be changed while it is open.
 .Sh COMPATIBILITY
 Due to the use of an
-.Vt u_int32_t
+.Vt uint32_t
 to store the number of sectors,
 .Bx
 labels are restricted to a maximum of 2^32-1 sectors.
@@ -495,6 +499,10 @@
 .Xr md 4 ,
 .Xr disktab 5 ,
 .Xr boot0cfg 8 ,
-.Xr fdisk 8 ,
 .Xr gpart 8 ,
 .Xr newfs 8
+.Sh HISTORY
+The
+.Nm disklabel
+utility appeared in
+.Bx 4.3 Tahoe .


Property changes on: trunk/sbin/bsdlabel/bsdlabel.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/bsdlabel/bsdlabel.c
===================================================================
--- trunk/sbin/bsdlabel/bsdlabel.c	2018-07-01 21:17:56 UTC (rev 11240)
+++ trunk/sbin/bsdlabel/bsdlabel.c	2018-07-01 21:20:29 UTC (rev 11241)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1994, 1995 Gordon W. Ross
  * Copyright (c) 1994 Theo de Raadt
@@ -53,7 +54,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sbin/bsdlabel/bsdlabel.c 234122 2012-04-11 06:35:13Z ae $");
 
 #include <sys/param.h>
 #include <stdint.h>
@@ -130,7 +131,7 @@
 static int labeloffset = LABELOFFSET;
 static int bbsize = BBSIZE;
 
-enum	{
+static enum {
 	UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT
 } op = UNSPEC;
 
@@ -189,8 +190,8 @@
 				break;
 			case 'r':
 				/*
-				 * We accept and ignode -r for compatibility with
-				 * historically disklabel usage.
+				 * We accept and ignore -r for compatibility with
+				 * historical disklabel usage.
 				 */
 				break;
 			case 'w':
@@ -386,7 +387,7 @@
 	struct disklabel *lp = &lab;
 
 	if (disable_write) {
-		warnx("write to disk label supressed - label was as follows:");
+		warnx("write to disk label suppressed - label was as follows:");
 		display(stdout, NULL);
 		return (0);
 	}
@@ -400,7 +401,7 @@
 	for (i = 0; i < lab.d_npartitions; i++)
 		if (lab.d_partitions[i].p_size)
 			lab.d_partitions[i].p_offset += lba_offset;
-	bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize,
+	bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * lab.d_secsize,
 	    lp);
 
 	fd = open(specname, O_RDWR);
@@ -434,7 +435,7 @@
 		gctl_ro_param(grq, "class", -1, "BSD");
 		gctl_ro_param(grq, "geom", -1, pname);
 		gctl_ro_param(grq, "label", 148+16*8,
-			bootarea + labeloffset + labelsoffset * secsize);
+			bootarea + labeloffset + labelsoffset * lab.d_secsize);
 		errstr = gctl_issue(grq);
 		if (errstr != NULL) {
 			warnx("%s", errstr);
@@ -782,12 +783,12 @@
 	lp->d_sbsize = 0;				/* XXX */
 	while (fgets(line, sizeof(line) - 1, f)) {
 		lineno++;
-		if ((cp = index(line,'\n')) != 0)
+		if ((cp = strchr(line,'\n')) != 0)
 			*cp = '\0';
 		cp = skip(line);
 		if (cp == NULL)
 			continue;
-		tp = index(cp, ':');
+		tp = strchr(cp, ':');
 		if (tp == NULL) {
 			fprintf(stderr, "line %d: syntax error\n", lineno);
 			errors++;
@@ -1513,8 +1514,8 @@
 	loclab.d_secperunit = mediasize / secsize;
 
 	/*
-	 * Nobody in these enligthened days uses the CHS geometry for
-	 * anything, but nontheless try to get it right.  If we fail
+	 * Nobody in these enlightened days uses the CHS geometry for
+	 * anything, but nonetheless try to get it right.  If we fail
 	 * to get any good ideas from the device, construct something
 	 * which is IBM-PC friendly.
 	 */

Modified: trunk/sbin/bsdlabel/pathnames.h
===================================================================
--- trunk/sbin/bsdlabel/pathnames.h	2018-07-01 21:17:56 UTC (rev 11240)
+++ trunk/sbin/bsdlabel/pathnames.h	2018-07-01 21:20:29 UTC (rev 11241)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -27,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)pathnames.h	8.1 (Berkeley) 6/5/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sbin/bsdlabel/pathnames.h 128073 2004-04-09 19:58:40Z markm $
  */
 
 #include <paths.h>



More information about the Midnightbsd-cvs mailing list