From owner-freebsd-stable@FreeBSD.ORG Wed Aug 14 14:06:57 2013 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CFEF66D; Wed, 14 Aug 2013 14:06:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAC322D4E; Wed, 14 Aug 2013 14:06:56 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 7FE81E46D; Wed, 14 Aug 2013 14:06:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 7FE81E46D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 14 Aug 2013 10:06:53 -0400 From: Glen Barber To: Eric van Gyzen Subject: Re: makefs Sparse Files: NetBSD CLI Compatibility Message-ID: <20130814140653.GG2241@glenbarber.us> References: <520B81D1.1010500@vangyzen.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AzNpbZlgThVzWita" Content-Disposition: inline In-Reply-To: <520B81D1.1010500@vangyzen.net> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Simon Gerraty , stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 14:06:57 -0000 --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--