erofs-utils: fsck: add --extract=X support to extract to path X
PATCH v2 1/1 erofs-utils: fsck: add --extract=X support to extract to path X
From: Igor Ostapenko <[email protected]>
Add support to extract directories, regular files and symlinks. Allocation for extract_path is done only once, then the buffer is reused.
Raw and compressed data chunks are handled with a unified function to avoid code duplication, compressed data is verified linearly (with EROFS_GET_BLOCKS_FIEMAP) instead of lookback, as it's problematic to extract data when looking backwards.
Signed-off-by Igor Ostapenko <[email protected]>
Signed-off-by Gao Xiang <[email protected]>
---
changes since v1:
- use tar-like options;
- derive ns timestamps.
configure.ac | 3 +- fsck/main.c | 570 +++++++++++++++++++++++++++++++++++++-------------- mkfs/main.c | 2 +- 3 files changed, 419 insertions(+), 156 deletions(-)
configure.ac +2 -1
@@ -188,7 +188,8 @@ AC_CHECK_FUNCS(m4_flatten([ strerror strrchr strtoull - tmpfile64])) + tmpfile64 + utimensat])) # Configure debug mode AS_IF([test "x$enable_debug" != "xno"], [], [
fsck/main.c +416 -154
689 lines not on this page · raw message
mkfs/main.c +1 -1
@@ -595,7 +595,7 @@ int main(int argc, char **argv) err =lstat64 (cfg.c_src_path, &st);if (err)return 1 ; -if ((st.st_mode &S_IFMT ) !=S_IFDIR ) { +if (!S_ISDIR (st.st_mode)) {erofs_err ("root of the filesystem is not a directory - %s" , cfg.c_src_path);usage ();
Signature · 1 line
2.20.1