Whamcloud - gitweb
mke2fs: add the ability to copy files from a given directory
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 6 Mar 2014 16:00:23 +0000 (11:00 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2014 16:00:23 +0000 (11:00 -0500)
commit0d4deba22e2aa95ad958b44972dc933fd0ebbc59
treed6a87b98eb85d764b1695466ffc596089509fc2f
parent3ba59bf649772967bcde59c6e1513937c2a0c835
mke2fs: add the ability to copy files from a given directory

We will add a -d option which will be used for adding the files from a
given directory to the filesystem, it is similiar to genext2fs, but
genext2fs doesn't fully support ext4.

* We already have the basic operations in debugfs:
  - Copy regular file
  - Create directory
  - Create symlink
  - Create special file

  We will move these operations into create_inode.h and create_inode.c,
  then let both mke2fs and debugfs use them.

* What we need to do are:
  - Copy the given directory recursively, this will be done by the
    populate_fs()
  - Set the owner, mode and other informations
  - Handle the hard links

TODO:
  - The libext2fs can't create the socket file (S_IFSOCK), do we have a
    plan to support it ?

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/create_inode.c [new file with mode: 0644]
misc/create_inode.h [new file with mode: 0644]