EXT packer#709
Conversation
|
Before I get a chance to review this, how does it compare to these other components that Albert worked on? Also, does it happen to address concerns I raised a long time ago, when the EXT unpacking components were introduced? Note that this would close #529. |
|
@rbs-jacob, mentioned some of this in the PR description but can elaborate a bit more.
|
| # a "lost+found" directory might be created when flushed to disk, but might also happen to be present in the filesystem, so ignore it: | ||
| if "lost+found" in old_files: | ||
| old_files.remove("lost+found") | ||
| if "lost+found" in new_files: | ||
| new_files.remove("lost+found") | ||
| assert len(old_files) == len(new_files) and set(old_files) == set( |
There was a problem hiding this comment.
This seems suspect? I don't think we want our packer to introduce files like this. Are we sure this is needed?
There was a problem hiding this comment.
Although not an EXT requirement, it is a convention to have a lost+found directory at the root of the filesystem. The mke2fs creates that directory here, without any option to not create it: https://github.com/tytso/e2fsprogs/blob/43643a57fb2d3368fbacd181a8cd713102d52a1a/misc/mke2fs.c#L3619
As this is a special case for the EXT component, I moved it from pytest_ofrak/src/pytest_ofrak/patterns/pack_unpack_filesystem.py to ofrak_core/tests/components/test_extfs_component.py in bb7e728
One sentence summary of this PR (This should go in the CHANGELOG!)
Add EXT packer, analyzer and tests.
Link to Related Issue(s)
#529
Please describe the changes in your request.
ExtAnalyzerthat uses thedumpe2fscommand to determine all the EXT attributes.ExtPackerthat uses themke2fscommand and the analysis from theExtAnalyzerto create an EXT2/3/4 filesystem without having to mount anything or use loop devices.FilesystemPackUnpackVerifyPatternand a round trip test to make sure attributes are preserved_validate_folder_equalitymethod inpytest_ofrak/src/pytest_ofrak/patterns/pack_unpack_filesystem.pybecause linux will sometimes create alost+founddirectory when extracting the filesystem. But it could also be present in the original filesystem. So I just removed that from the equality comparison.Compared to #558 PR, this merge request is more compact and less complex (no need to write a debugfs script, etc).
Anyone you think should look at this, specifically?
No