Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Mar 2000 00:45:46 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Warner Losh <imp@village.org>
Cc:        current@freebsd.org
Subject:   Re: Please review: fdisk -e -> -I 
Message-ID:  <693.952040746@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 02 Mar 2000 13:33:41 MST." <200003022033.NAA17898@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

You have my OK to change the option, but you'll need Jordans
OK to commit it.

Poul-Henning

In message <200003022033.NAA17898@harmony.village.org>, Warner Losh writes:
>
>Given that OpenBSD had the -e flag to fdisk first, and that it means
>edit there and that disklabel -e means edit, I'd like to apply the
>following patch to -current before it becomes 4.0.  If we wait, we'll
>have compatibility problems.  Right now it is too easy to shoot
>yourself in the foot with this.
>
>When this was hashed out here, the idea was met with wide spread
>support, even fiven the advanced nature of the freeze.  I take that
>support to mean that this is something that would be a good idea to do
>for 4.0.
>
>Comments?
>
>Warner
>
>Index: fdisk.8
>===================================================================
>RCS file: /home/imp/FreeBSD/CVS/src/sbin/i386/fdisk/fdisk.8,v
>retrieving revision 1.16
>diff -u -r1.16 fdisk.8
>--- fdisk.8	1999/08/28 00:13:01	1.16
>+++ fdisk.8	2000/03/02 20:29:12
>@@ -8,7 +8,7 @@
> .Nd PC partition table maintenance program
> .Sh SYNOPSIS
> .Nm fdisk
>-.Op Fl Baeitu
>+.Op Fl BIaitu
> .Op Fl b Ar bootcode
> .Op Fl 1234
> .Op Ar disk
>@@ -62,7 +62,7 @@
> if
> .Fl f
> is given.
>-.It Fl e
>+.It Fl I
> Initialize the contents of sector 0 with one FreeBSD slice covering the entire disk.
> .It Fl f Ar configfile
> Set partition values using the file
>Index: fdisk.c
>===================================================================
>RCS file: /home/imp/FreeBSD/CVS/src/sbin/i386/fdisk/fdisk.c,v
>retrieving revision 1.34
>diff -u -r1.34 fdisk.c
>--- fdisk.c	2000/02/11 11:25:23	1.34
>+++ fdisk.c	2000/03/02 20:31:56
>@@ -120,7 +120,7 @@
> static int B_flag  = 0;		/* replace boot code */
> static int a_flag  = 0;		/* set active partition */
> static char *b_flag = NULL;	/* path to boot code */
>-static int e_flag  = 0;		/* use entire disk for FreeBSD */
>+static int I_flag  = 0;		/* use entire disk for FreeBSD */
> static int i_flag  = 0;		/* replace partition data */
> static int u_flag  = 0;		/* update partition data */
> static int t_flag  = 0;		/* test only, if f_flag is given */
>@@ -216,7 +216,7 @@
> {
> 	int	c, i;
> 
>-	while ((c = getopt(argc, argv, "Bab:ef:ituv1234")) != -1)
>+	while ((c = getopt(argc, argv, "BIab:f:ituv1234")) != -1)
> 		switch (c) {
> 		case 'B':
> 			B_flag = 1;
>@@ -227,8 +227,8 @@
> 		case 'b':
> 			b_flag = optarg;
> 			break;
>-		case 'e':
>-			e_flag = 1;
>+		case 'I':
>+			I_flag = 1;
> 			break;
> 		case 'f':
> 			f_flag = optarg;
>@@ -292,7 +292,7 @@
> 
> 	printf("******* Working on device %s *******\n",disk);
> 
>-	if (e_flag)
>+	if (I_flag)
> 	{
> 		struct dos_partition *partp;
> 
>@@ -648,7 +648,7 @@
> 	if ( !(st.st_mode & S_IFCHR) )
> 		warnx("device %s is not character special", disk);
> 	if ((fd = open(disk,
>-	    a_flag || e_flag || B_flag || u_flag ? O_RDWR : O_RDONLY)) == -1) {
>+	    a_flag || I_flag || B_flag || u_flag ? O_RDWR : O_RDONLY)) == -1) {
> 		if(errno == ENXIO)
> 			return -2;
> 		warnx("can't open device %s", disk);
>

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
FreeBSD -- It will take a long time before progress goes too far!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?693.952040746>