From owner-freebsd-stable@FreeBSD.ORG Wed Aug 14 14:33:09 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 9C7C0F10; Wed, 14 Aug 2013 14:33:09 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from aussmtpmrkpc120.us.dell.com (aussmtpmrkpc120.us.dell.com [143.166.82.159]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2BD7B2EDB; Wed, 14 Aug 2013 14:33:08 +0000 (UTC) X-Loopcount0: from 64.238.244.148 X-IronPort-AV: E=Sophos;i="4.89,877,1367989200"; d="diff'?scan'208";a="39971198" Message-ID: <520B951D.2080305@vangyzen.net> Date: Wed, 14 Aug 2013 09:33:01 -0500 From: Eric van Gyzen User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130702 Thunderbird/17.0.7 MIME-Version: 1.0 To: Glen Barber Subject: Re: makefs Sparse Files: NetBSD CLI Compatibility References: <520B81D1.1010500@vangyzen.net> <20130814140653.GG2241@glenbarber.us> In-Reply-To: <20130814140653.GG2241@glenbarber.us> Content-Type: multipart/mixed; boundary="------------080007030007000703050305" 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:33:09 -0000 --------------080007030007000703050305 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit 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 --------------080007030007000703050305 Content-Type: text/x-diff; name="makefs_sparse.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="makefs_sparse.diff" 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); --------------080007030007000703050305--