From: "Darrick J. Wong" <djwong@kernel.org>
To: Luca Di Maio <luca.dimaio1@gmail.com>
Cc: linux-xfs@vger.kernel.org, dimitri.ledkov@chainguard.dev,
smoser@chainguard.dev, hch@infradead.org
Subject: Re: [PATCH v6 3/4] mkfs: add -P flag to populate a filesystem from a directory
Date: Thu, 24 Apr 2025 14:55:02 -0700 [thread overview]
Message-ID: <20250424215502.GJ25675@frogsfrogsfrogs> (raw)
In-Reply-To: <rb5jppjdx4c5b4qxqmlxinheztreysqts5o6fx575zvceszart@mtpo6ngxms5m>
On Thu, Apr 24, 2025 at 02:01:06PM +0200, Luca Di Maio wrote:
> On Wed, Apr 23, 2025 at 01:09:14PM -0700, Darrick J. Wong wrote:
> > On Wed, Apr 23, 2025 at 06:03:18PM +0200, Luca Di Maio wrote:
> > > - while ((c = getopt_long(argc, argv, "b:c:d:i:l:L:m:n:KNp:qr:s:CfV",
> > > + while ((c = getopt_long(argc, argv, "b:c:d:i:l:L:P:m:n:KNp:qr:s:CfV",
> > > long_options, &option_index)) != EOF) {
> > > switch (c) {
> > > case 0:
> > > @@ -5280,6 +5283,9 @@ main(
> > > illegal(optarg, "L");
> > > cfg.label = optarg;
> > > break;
> > > + case 'P':
> > > + cli.directory = optarg;
> > > + break;
> >
> > Uh... why not modify setup_proto to check the mode of the opened fd, and
> > call populate_from_dir if it's a directory? Then you don't need all the
> > extra option parsing code. It's not as if -p <path> has ever worked on
> > a directory.
> >
> > --D
> >
>
> Alright, that makes things easier yes, I'll just make sure to clearly
> explain the difference in the man page and help so it's clearer,
> something like:
>
> ```
> -p prototype_options
> Section Name: [proto]
> These options specify the prototype parameters for populating the
> filesystem. The valid prototype_options are:
>
> [file=]
>
> The file= prefix is not required for this CLI argument for
> legacy reasons. If specified as a config file directive,
> the prefix is required.
>
> [file=]directory
>
> If the optional prototype argument is given,
> and it's a directory, mkfs.xfs will copy the contents
> of the given directory or tarball into the root
> directory of the file system.
>
> [file=]protofile
>
> If the optional prototype argument is given,
> and it's a file, [ ... continue with existing man ... ]
> ```
>
> So it's clear from the docs that the option is there and it's the same
> flag.
Sounds good to me!
--D
> L.
>
next prev parent reply other threads:[~2025-04-24 21:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 16:03 [PATCH v6 0/4] mkfs: add ability to populate filesystem from directory Luca Di Maio
2025-04-23 16:03 ` [PATCH v6 1/4] proto: expose more functions from proto Luca Di Maio
2025-04-23 16:03 ` [PATCH v6 2/4] populate: add ability to populate a filesystem from a directory Luca Di Maio
2025-04-23 20:23 ` Darrick J. Wong
2025-04-24 16:09 ` Luca Di Maio
2025-04-24 22:00 ` Darrick J. Wong
2025-04-25 13:10 ` Christoph Hellwig
2025-04-25 15:00 ` Darrick J. Wong
2025-04-25 17:58 ` Luca Di Maio
2025-04-23 16:03 ` [PATCH v6 3/4] mkfs: add -P flag " Luca Di Maio
2025-04-23 20:09 ` Darrick J. Wong
2025-04-24 12:01 ` Luca Di Maio
2025-04-24 21:55 ` Darrick J. Wong [this message]
2025-04-23 16:03 ` [PATCH v6 4/4] man: document " Luca Di Maio
2025-04-23 20:03 ` [PATCH v6 0/4] mkfs: add ability to populate filesystem from directory Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250424215502.GJ25675@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=dimitri.ledkov@chainguard.dev \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=luca.dimaio1@gmail.com \
--cc=smoser@chainguard.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox