Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-15 Thread Eric van Gyzen
On 08/14/2013 10:13, Eric van Gyzen wrote:
 On 08/14/2013 09:53, Glen Barber wrote:
 On Wed, Aug 14, 2013 at 09:33:01AM -0500, Eric van Gyzen wrote:
 On 08/14/2013 09:06, Glen Barber wrote:
 On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
 NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
 FreeBSD, the flag is spelled -p.  Is there a reason for using a
 different flag?  It would be very nice to preserve CLI compatibility
 with NetBSD.

 NetBSD committed first (by one month), and neither change has gone into
 a release yet, so we should change to match NetBSD.  We should do it
 soon, too, since our change will go into 9.2-RELEASE.

 If we agree, I'll gladly make the patches, trivial though they'll be.

 Can you please try the attached patch?
 Thanks, Glen.  That patch would work.  However, since our -p flag has
 not yet gone into a release, there is no need to keep it.  I suggest
 that we simply rename -p to -Z, to match NetBSD.  The attached patch
 does this.

 Not in a release, no, but it is available in stable/ branches.  I'd
 prefer to deprecate the '-p' but keep the option for now, as we have no
 way to know how many people are using it.
 That's reasonable.  The attached patch, for releng/9.2, does this.  We
 could remove -p in head (by using my previous patch).

Is there any chance this will be fixed in 9.2?  It would be nice to
avoid introducing incompatibility in a release.

Eric
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-15 Thread Glen Barber
On Thu, Aug 15, 2013 at 04:18:06PM -0500, Eric van Gyzen wrote:
 Is there any chance this will be fixed in 9.2?  It would be nice to
 avoid introducing incompatibility in a release.
 

I will commit it in a few hours, with 3-day scheduled MFC.  I will send
to RE for approval afterwards.

Glen



pgprqM1hoPhF_.pgp
Description: PGP signature


makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Eric van Gyzen
NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
FreeBSD, the flag is spelled -p.  Is there a reason for using a
different flag?  It would be very nice to preserve CLI compatibility
with NetBSD.

NetBSD committed first (by one month), and neither change has gone into
a release yet, so we should change to match NetBSD.  We should do it
soon, too, since our change will go into 9.2-RELEASE.

If we agree, I'll gladly make the patches, trivial though they'll be.

Eric
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Glen Barber
On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
 NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
 FreeBSD, the flag is spelled -p.  Is there a reason for using a
 different flag?  It would be very nice to preserve CLI compatibility
 with NetBSD.
 
 NetBSD committed first (by one month), and neither change has gone into
 a release yet, so we should change to match NetBSD.  We should do it
 soon, too, since our change will go into 9.2-RELEASE.
 
 If we agree, I'll gladly make the patches, trivial though they'll be.
 

Can you please try the attached patch?

Glen

Index: usr.sbin/makefs/makefs.8
===
--- usr.sbin/makefs/makefs.8(revision 254289)
+++ usr.sbin/makefs/makefs.8(working copy)
@@ -35,7 +35,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 22, 2012
+.Dd August 14, 2013
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@
 .Nd create a file system image from a directory tree or a mtree manifest
 .Sh SYNOPSIS
 .Nm
-.Op Fl Dpx
+.Op Fl DpxZ
 .Op Fl B Ar byte-order
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -213,6 +213,10 @@
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
+.It Fl Z
+Create the image as a sparse file.
+Provided for compatibiltiy with
+.Nx .
 .El
 .Pp
 Where sizes are specified, a decimal number of bytes is expected.
Index: usr.sbin/makefs/makefs.c
===
--- usr.sbin/makefs/makefs.c(revision 254289)
+++ usr.sbin/makefs/makefs.c(working copy)
@@ -113,7 +113,7 @@
start_time.tv_sec = start.tv_sec;
start_time.tv_nsec = start.tv_usec * 1000;
 
-   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:x)) != -1) {
+   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ)) != -1) 
{
switch (ch) {
 
case 'B':
@@ -233,6 +233,11 @@
fsoptions.onlyspec = 1;
break;
 
+   case 'Z':
+   /* Compatibility with NetBSD makefs(8) */
+   fsoptions.sparse = 1;
+   break;
+
case '?':
default:
usage();


pgp2qDFJnmAa1.pgp
Description: PGP signature


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Eric van Gyzen
On 08/14/2013 09:06, Glen Barber wrote:
 On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
 NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
 FreeBSD, the flag is spelled -p.  Is there a reason for using a
 different flag?  It would be very nice to preserve CLI compatibility
 with NetBSD.

 NetBSD committed first (by one month), and neither change has gone into
 a release yet, so we should change to match NetBSD.  We should do it
 soon, too, since our change will go into 9.2-RELEASE.

 If we agree, I'll gladly make the patches, trivial though they'll be.

 Can you please try the attached patch?

Thanks, Glen.  That patch would work.  However, since our -p flag has
not yet gone into a release, there is no need to keep it.  I suggest
that we simply rename -p to -Z, to match NetBSD.  The attached patch
does this.

Eric
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index 4d81e45..fd8d76d 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -43,7 +43,7 @@
 .Nd create a file system image from a directory tree or a mtree manifest
 .Sh SYNOPSIS
 .Nm
-.Op Fl Dpx
+.Op Fl DxZ
 .Op Fl B Ar byte-order
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -190,8 +190,6 @@ Set file system specific options.
 .Ar fs-options
 is a comma separated list of options.
 Valid file system specific options are detailed below.
-.It Fl p
-Create the image as a sparse file.
 .It Fl S Ar sector-size
 Set the file system sector size to
 .Ar sector-size .
@@ -213,6 +211,8 @@ ISO 9660 file system.
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
+.It Fl Z
+Create the image as a sparse file.
 .El
 .Pp
 Where sizes are specified, a decimal number of bytes is expected.
diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c
index 03ff1ac..7cbf05a 100644
--- a/usr.sbin/makefs/makefs.c
+++ b/usr.sbin/makefs/makefs.c
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
 	start_time.tv_sec = start.tv_sec;
 	start_time.tv_nsec = start.tv_usec * 1000;
 
-	while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:x)) != -1) {
+	while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:s:S:t:xZ)) != -1) {
 		switch (ch) {
 
 		case 'B':
@@ -204,9 +204,6 @@ main(int argc, char *argv[])
 			}
 			break;
 		}
-		case 'p':
-			fsoptions.sparse = 1;
-			break;
 
 		case 's':
 			fsoptions.minsize = fsoptions.maxsize =
@@ -233,6 +230,10 @@ main(int argc, char *argv[])
 			fsoptions.onlyspec = 1;
 			break;
 
+		case 'Z':
+			fsoptions.sparse = 1;
+			break;
+
 		case '?':
 		default:
 			usage();
@@ -354,7 +355,7 @@ usage(void)
 	fprintf(stderr,
 usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n
 \t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n
-\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n
+\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-DxZ]\n
 \t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n,
 	prog);
 	exit(1);
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org

Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Glen Barber
On Wed, Aug 14, 2013 at 09:33:01AM -0500, Eric van Gyzen wrote:
 On 08/14/2013 09:06, Glen Barber wrote:
  On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
  NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
  FreeBSD, the flag is spelled -p.  Is there a reason for using a
  different flag?  It would be very nice to preserve CLI compatibility
  with NetBSD.
 
  NetBSD committed first (by one month), and neither change has gone into
  a release yet, so we should change to match NetBSD.  We should do it
  soon, too, since our change will go into 9.2-RELEASE.
 
  If we agree, I'll gladly make the patches, trivial though they'll be.
 
  Can you please try the attached patch?
 
 Thanks, Glen.  That patch would work.  However, since our -p flag has
 not yet gone into a release, there is no need to keep it.  I suggest
 that we simply rename -p to -Z, to match NetBSD.  The attached patch
 does this.
 

Not in a release, no, but it is available in stable/ branches.  I'd
prefer to deprecate the '-p' but keep the option for now, as we have no
way to know how many people are using it.

Glen



pgpgg88Qj3Vel.pgp
Description: PGP signature


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Eric van Gyzen
On 08/14/2013 09:53, Glen Barber wrote:
 On Wed, Aug 14, 2013 at 09:33:01AM -0500, Eric van Gyzen wrote:
 On 08/14/2013 09:06, Glen Barber wrote:
 On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
 NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
 FreeBSD, the flag is spelled -p.  Is there a reason for using a
 different flag?  It would be very nice to preserve CLI compatibility
 with NetBSD.

 NetBSD committed first (by one month), and neither change has gone into
 a release yet, so we should change to match NetBSD.  We should do it
 soon, too, since our change will go into 9.2-RELEASE.

 If we agree, I'll gladly make the patches, trivial though they'll be.

 Can you please try the attached patch?
 Thanks, Glen.  That patch would work.  However, since our -p flag has
 not yet gone into a release, there is no need to keep it.  I suggest
 that we simply rename -p to -Z, to match NetBSD.  The attached patch
 does this.

 Not in a release, no, but it is available in stable/ branches.  I'd
 prefer to deprecate the '-p' but keep the option for now, as we have no
 way to know how many people are using it.

That's reasonable.  The attached patch, for releng/9.2, does this.  We
could remove -p in head (by using my previous patch).

Thanks for your help during this busy time in the release.

Eric
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index 81bf334..75b2b8e 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -43,7 +43,7 @@
 .Nd create a file system image from a directory tree or a mtree manifest
 .Sh SYNOPSIS
 .Nm
-.Op Fl Dpx
+.Op Fl DxZ
 .Op Fl B Ar byte-order
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -191,7 +191,10 @@ Set file system specific options.
 is a comma separated list of options.
 Valid file system specific options are detailed below.
 .It Fl p
-Create the image as a sparse file.
+[Deprecated:  Use
+.Fl Z
+instead] Create the image as a sparse file.
+This flag is provided for compatibility with the stable/9 branch.
 .It Fl S Ar sector-size
 Set the file system sector size to
 .Ar sector-size .
@@ -213,6 +216,8 @@ ISO 9660 file system.
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
+.It Fl Z
+Create the image as a sparse file.
 .El
 .Pp
 Where sizes are specified, a decimal number of bytes is expected.
diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c
index 03ff1ac..9125b40 100644
--- a/usr.sbin/makefs/makefs.c
+++ b/usr.sbin/makefs/makefs.c
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
 	start_time.tv_sec = start.tv_sec;
 	start_time.tv_nsec = start.tv_usec * 1000;
 
-	while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:x)) != -1) {
+	while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ)) != -1) {
 		switch (ch) {
 
 		case 'B':
@@ -233,6 +233,10 @@ main(int argc, char *argv[])
 			fsoptions.onlyspec = 1;
 			break;
 
+		case 'Z':
+			fsoptions.sparse = 1;
+			break;
+
 		case '?':
 		default:
 			usage();
@@ -354,7 +358,7 @@ usage(void)
 	fprintf(stderr,
 usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n
 \t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n
-\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n
+\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-DxZ]\n
 \t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n,
 	prog);
 	exit(1);
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org

Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Mehmet Erol Sanliturk
On Wed, Aug 14, 2013 at 10:06 AM, Glen Barber g...@freebsd.org wrote:

 On Wed, Aug 14, 2013 at 08:10:41AM -0500, Eric van Gyzen wrote:
  NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
  FreeBSD, the flag is spelled -p.  Is there a reason for using a
  different flag?  It would be very nice to preserve CLI compatibility
  with NetBSD.
 
  NetBSD committed first (by one month), and neither change has gone into
  a release yet, so we should change to match NetBSD.  We should do it
  soon, too, since our change will go into 9.2-RELEASE.
 
  If we agree, I'll gladly make the patches, trivial though they'll be.
 

 Can you please try the attached patch?

 Glen




 .Nd create a file system image from a directory tree or a mtree manifest



an mtree


+Provided for compatibiltiy with


compatibility



Thank you very much .

Mehmet Erol Sanliturk
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Simon J. Gerraty

On Wed, 14 Aug 2013 08:10:41 -0500, Eric van Gyzen writes:
NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
FreeBSD, the flag is spelled -p.  Is there a reason for using a
different flag?  

No, the -p should have been dropped before we committed to FreeBSD.
But it is there, and Glen expressed a desire to leave it working.

I expect you could drop -p from the man page and usage message.
Ie. just document -Z, but leave -p active, and no harm should
result.

If we agree, I'll gladly make the patches, trivial though they'll be.

Thanks
--sjg

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: makefs Sparse Files: NetBSD CLI Compatibility

2013-08-14 Thread Eric van Gyzen
On 08/14/2013 14:05, Simon J. Gerraty wrote:
 On Wed, 14 Aug 2013 08:10:41 -0500, Eric van Gyzen writes:
 NetBSD's makefs has a -Z flag to create the image as a sparse file.  In
 FreeBSD, the flag is spelled -p.  Is there a reason for using a
 different flag?  
 No, the -p should have been dropped before we committed to FreeBSD.
 But it is there, and Glen expressed a desire to leave it working.

 I expect you could drop -p from the man page and usage message.
 Ie. just document -Z, but leave -p active, and no harm should
 result.

Thank you, Simon.  Later in this thread, I included a patch for 9.x to
do essentially that, and a patch for head to use only -Z and remove -p
entirely (since it was never in a release).  I think I'm just waiting
for someone to commit them, since I don't have a commit bit.

Cheers,

Eric
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org