[Midnightbsd-cvs] src [11225] sync with freebsd 10 stable

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 1 17:08:31 EDT 2018


Revision: 11225
          http://svnweb.midnightbsd.org/src/?rev=11225
Author:   laffer1
Date:     2018-07-01 17:08:31 -0400 (Sun, 01 Jul 2018)
Log Message:
-----------
sync with freebsd 10 stable

Modified Paths:
--------------
    trunk/sbin/fdisk/Makefile
    trunk/sbin/fdisk/fdisk.8
    trunk/sbin/fdisk/fdisk.c
    trunk/sbin/fdisk/runtest.sh

Property Changed:
----------------
    trunk/sbin/fdisk/fdisk.8
    trunk/sbin/fdisk/runtest.sh

Modified: trunk/sbin/fdisk/Makefile
===================================================================
--- trunk/sbin/fdisk/Makefile	2018-07-01 21:07:38 UTC (rev 11224)
+++ trunk/sbin/fdisk/Makefile	2018-07-01 21:08:31 UTC (rev 11225)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/sbin/fdisk/Makefile 183296 2008-09-23 13:12:51Z ru $
 
 PROG=	fdisk
 SRCS=	fdisk.c geom_mbr_enc.c

Modified: trunk/sbin/fdisk/fdisk.8
===================================================================
--- trunk/sbin/fdisk/fdisk.8	2018-07-01 21:07:38 UTC (rev 11224)
+++ trunk/sbin/fdisk/fdisk.8	2018-07-01 21:08:31 UTC (rev 11225)
@@ -1,6 +1,7 @@
 .\" $MidnightBSD$
+.\" $FreeBSD: stable/10/sbin/fdisk/fdisk.8 307435 2016-10-16 23:39:15Z sevan $
 .\"
-.Dd May 24, 2009
+.Dd October 5, 2016
 .Dt FDISK 8
 .Os
 .Sh NAME
@@ -39,6 +40,13 @@
 utility can be used to divide space on the disk into slices and set one
 active.
 .Sh DESCRIPTION
+.Bf -symbolic
+This command is obsolete.
+Users are advised to use
+.Xr gpart 8
+instead.
+.Ef
+.Pp
 The
 .Fx
 utility,
@@ -159,7 +167,7 @@
 When called with no arguments, it prints the sector 0 slice table.
 An example follows:
 .Bd -literal
-	******* Working on device /dev/ad0 *******
+	******* Working on device /dev/ada0 *******
 	parameters extracted from in-core disklabel are:
 	cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
 
@@ -170,12 +178,12 @@
 	Information from DOS bootblock is:
 	The data for partition 1 is:
 	sysid 165,(FreeBSD/NetBSD/386BSD)
-    	    start 495, size 380160 (185 Meg), flag 0
+           start 495, size 380160 (185 Meg), flag 0
 		beg: cyl 1/ sector 1/ head 0;
 		end: cyl 768/ sector 33/ head 14
 	The data for partition 2 is:
 	sysid 164,(unknown)
-    	    start 378180, size 2475 (1 Meg), flag 0
+           start 378180, size 2475 (1 Meg), flag 0
 		beg: cyl 764/ sector 1/ head 0;
 		end: cyl 768/ sector 33/ head 14
 	The data for partition 3 is:
@@ -182,7 +190,7 @@
 	<UNUSED>
 	The data for partition 4 is:
 	sysid 99,(ISC UNIX, other System V/386, GNU HURD or Mach)
-    	    start 380656, size 224234 (109 Meg), flag 80
+           start 380656, size 224234 (109 Meg), flag 80
 		beg: cyl 769/ sector 2/ head 0;
 		end: cyl 197/ sector 33/ head 14
 .Ed
@@ -478,6 +486,21 @@
 .Xr bsdlabel 8 ,
 .Xr gpart 8 ,
 .Xr newfs 8
+.Sh HISTORY
+A version of
+.Nm
+first appeared in the Mach Operating System.
+It was subsequently ported to
+.Bx 386 .
+.Sh AUTHORS
+.An -nosplit
+.Nm
+for Mach Operating System was written by
+.An Robert Baron Aq Mt rvb at cs.cmu.edu .
+It was ported to
+.Bx 386
+by
+.An Julian Elischer Aq Mt julian at tfs.com .
 .Sh BUGS
 The default boot code will not necessarily handle all slice types
 correctly, in particular those introduced since


Property changes on: trunk/sbin/fdisk/fdisk.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/fdisk/fdisk.c
===================================================================
--- trunk/sbin/fdisk/fdisk.c	2018-07-01 21:07:38 UTC (rev 11224)
+++ trunk/sbin/fdisk/fdisk.c	2018-07-01 21:08:31 UTC (rev 11225)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Mach Operating System
  * Copyright (c) 1992 Carnegie Mellon University
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sbin/fdisk/fdisk.c 234345 2012-04-16 17:30:19Z marck $");
 
 #include <sys/disk.h>
 #include <sys/disklabel.h>
@@ -47,7 +48,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int iotest;
+static int iotest;
 
 #define NO_DISK_SECTORS ((u_int32_t)-1)
 #define NO_TRACK_CYLINDERS 1023
@@ -489,7 +490,7 @@
 	    get_type(partp->dp_typ));
 	printf("    start %lu, size %lu (%ju Meg), flag %x%s\n",
 		(u_long)partp->dp_start,
-		(u_long)partp->dp_size, 
+		(u_long)partp->dp_size,
 		(uintmax_t)part_mb,
 		partp->dp_flag,
 		partp->dp_flag == ACTIVE ? " (active)" : "");
@@ -515,6 +516,8 @@
 	if ((fdesc = open(fname, O_RDONLY)) == -1 ||
 	    fstat(fdesc, &sb) == -1)
 		err(1, "%s", fname);
+	if (sb.st_size == 0)
+		errx(1, "%s is empty, must not be.", fname);
 	if ((mboot.bootinst_size = sb.st_size) % secsize != 0)
 		errx(1, "%s: length must be a multiple of sector size", fname);
 	if (mboot.bootinst != NULL)
@@ -919,7 +922,7 @@
 		dos_partition_enc(&mboot.bootinst[DOSPARTOFF + i * DOSPARTSIZE],
 		    &mboot.parts[i]);
 	le16enc(&mboot.bootinst[DOSMAGICOFFSET], DOSMAGIC);
-	for(sector = 0; sector < mboot.bootinst_size / secsize; sector++) 
+	for(sector = 0; sector < mboot.bootinst_size / secsize; sector++)
 		if (write_disk(sector,
 			       &mboot.bootinst[sector * secsize]) == -1) {
 			warn("can't write fdisk partition table");
@@ -1140,7 +1143,7 @@
 		return NO_DISK_SECTORS;
 	}
 
-	if (*end == 'K') 
+	if (*end == 'K')
 		val *= 1024UL / secsize;
 	else if (*end == 'M')
 		val *= 1024UL * 1024UL / secsize;

Modified: trunk/sbin/fdisk/runtest.sh
===================================================================
--- trunk/sbin/fdisk/runtest.sh	2018-07-01 21:07:38 UTC (rev 11224)
+++ trunk/sbin/fdisk/runtest.sh	2018-07-01 21:08:31 UTC (rev 11225)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# $FreeBSD: stable/10/sbin/fdisk/runtest.sh 113454 2003-04-13 21:57:08Z phk $
 # $MidnightBSD$
 
 set -e


Property changes on: trunk/sbin/fdisk/runtest.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list