From: Robert Yang <liezhi.yang@windriver.com>
To: <linux-ext4@vger.kernel.org>
Cc: Darren Hart <dvhart@linux.intel.com>, "Theodore Ts'o" <tytso@mit.edu>
Subject: [RFC] e2fsprogs/mke2fs: add an option "-d root-directory"
Date: Mon, 5 Aug 2013 16:40:31 +0800 [thread overview]
Message-ID: <51FF64FF.5090309@windriver.com> (raw)
Hello folks,
I'd like to add an "-d root-directory" option for mke2fs, which is used
for adding files from the "root-directory" to the filesystem after the
formatting, it is similar to genext2fs, but which only supports ext2 AFAIK.
it's usage example would be:
$ mke2fs -t extX -d <dir> <device>
I've done a few work on it, we can re-use the code from debugfs/debugfs.c,
here are the draft implementation thoughts:
Move a part of the code from debugfs/debugfs.c to misc/util.c, for example,
we will change the function do_write() in debugfs.c to:
void do_write(int argc, char *argv[])
{
[snip];
retval = do_write_internal();
[snip];
}
The do_write_internal() will be defined in misc/util.c, then both debugfs.c
and mke2fs.c can use it. We will do the similar thing to do_mkdir(),
do_symlink() and so on.
My questions are:
1) Is the "-d root-directory" option acceptable ?
2) Is the implementation idea OK ?
Please feel free to give your comments, and I will send the patches later
if this is fine.
--
Thanks
Robert
next reply other threads:[~2013-08-05 8:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 8:40 Robert Yang [this message]
2013-08-05 15:17 ` [RFC] e2fsprogs/mke2fs: add an option "-d root-directory" Darren Hart
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=51FF64FF.5090309@windriver.com \
--to=liezhi.yang@windriver.com \
--cc=dvhart@linux.intel.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).