Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Aug 2013 10:06:53 -0400
From:      Glen Barber <gjb@FreeBSD.org>
To:        Eric van Gyzen <eric@vangyzen.net>
Cc:        Simon Gerraty <sjg@FreeBSD.org>, stable@freebsd.org
Subject:   Re: makefs Sparse Files: NetBSD CLI Compatibility
Message-ID:  <20130814140653.GG2241@glenbarber.us>
In-Reply-To: <520B81D1.1010500@vangyzen.net>
References:  <520B81D1.1010500@vangyzen.net>

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

--AzNpbZlgThVzWita
Content-Type: multipart/mixed; boundary="eVzOFob/8UvintSX"
Content-Disposition: inline


--eVzOFob/8UvintSX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> 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.
>=20
> If we agree, I'll gladly make the patches, trivial though they'll be.
>=20

Can you please try the attached patch?

Glen


--eVzOFob/8UvintSX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="makefs-sparse-compat.diff.txt"
Content-Transfer-Encoding: quoted-printable

Index: usr.sbin/makefs/makefs.8
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- usr.sbin/makefs/makefs.c	(revision 254289)
+++ usr.sbin/makefs/makefs.c	(working copy)
@@ -113,7 +113,7 @@
 	start_time.tv_sec =3D start.tv_sec;
 	start_time.tv_nsec =3D start.tv_usec * 1000;
=20
-	while ((ch =3D getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:x")) !=3D -1=
) {
+	while ((ch =3D getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) !=3D -=
1) {
 		switch (ch) {
=20
 		case 'B':
@@ -233,6 +233,11 @@
 			fsoptions.onlyspec =3D 1;
 			break;
=20
+		case 'Z':
+			/* Compatibility with NetBSD makefs(8) */
+			fsoptions.sparse =3D 1;
+			break;
+
 		case '?':
 		default:
 			usage();

--eVzOFob/8UvintSX--

--AzNpbZlgThVzWita
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQEcBAEBCAAGBQJSC479AAoJEFJPDDeguUajjo4H/20ccrgS+Q5OjuEnUY03N7hX
IdOSukckKl996bS3MU4Rpbhg+3H/6T+h5H4xR9DIISyO5C7oH0TkTAZNBdZudWWF
E2lMfisuDBaxZ+++/rg0M8hxsWUHp2UvZGyuSIJTQrynt2U6bmryrLquKbKEmOiJ
KaYTgHPkHJOe5PiUUsgG6Agj6kHch3jsQkL3PFoBm7URdQDGWIRFhyuXxY5osZXH
kNSXJ+p253N7JBd9yGLND9rcuIrkuJendkGwd+lpHtKTM8pz4SPBxgJ3SSQSrtWk
r8gDSWc0TkNg7RvaztOETTlJ6SKRwHUJpdrh2iTrZ8xPqDgwdRDeZkLIcEkv9EI=
=9Cfz
-----END PGP SIGNATURE-----

--AzNpbZlgThVzWita--



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