aboutsummaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2018-02-26AOSP: Rename libz-host -> libzDan Willemsen
Test: m host Change-Id: I8b0edfe2076531bd4c4f1023b1076aec5f722a44 From AOSP commit: d4356bb606dbcad0b77788318c6199081262b373
2018-02-26AOSP: Add missing libdl dependenciesPavlin Radoslavov
Bug: 62815515 Test: lunch full-eng; make checkbuild Change-Id: I1751669c4ed046c22587938e04eb76abe8553a8d From AOSP commit: a24084ceb74c84b0943c86deb5cb99a63d3c46d7
2018-02-26AOSP: Fix android build warnings in e2fsdroid and libext2fsJin Qian
Change-Id: I23b7abc8af87d87786523944186de1321726a529 From AOSP commit: 424fa8ce373566040ae6ba31151bfbef566b7166
2018-02-26AOSP: e2fsdroid: print used/total inode and block countYang Jin
Bug: 64272984 Change-Id: Idc727e556a3fa7fb85ff0f845b9452c8c033c22d From AOSP commit: 131d29f6a826438aff0e5870fb3711358d2a0988
2018-02-26AOSP: mke2fs, libext2fs: fix bugs on windowsJin Qian
Added O_BINARY to open output files on windows, otherwise they're written as text files and have invalid data. Use '(filename):block_count:block_size' for sparse file name because windows file name can contain ':', e.g. 'c:\output_file'. Bug: 23686092 Change-Id: I731c13e5df0be8c831464c431b8949d33438fb24 From AOSP commit: 0dcf8ec6a429ce4f024fe7838fee2d5636e8ba4d
2018-02-26AOSP: build static version of mke2fs and e2fsdroid for hostJin Qian
Statically link those two binaries for host build so that we can package them with fastboot without including other library files. Bug: 35219933 Change-Id: Ic4762ba5eda8ac61723a2c4137690d12a0aa57f2 From AOSP commit: 42297fb01aa2a49ead938c1d24868941a39fd434
2018-02-26AOSP: e2fsdroid: use libselinux function to read file context on deviceJin Qian
When e2fsdroid runs on device, location of selinux file contexts should be determined by libselinux instead of using arbitrary paths. Bug: 35219933 Change-Id: I413b198422eddb212599498b532ba2c4d8bb36c6 From AOSP commit: c0bd89b31a7719dd3d51137b3d47a9597ba6b038
2018-02-26AOSP: build mke2fs and e2fsdroid as static executables for recovery modeJin Qian
Bug: 35219933 Change-Id: I84f105cafc57c513d83d9e4d26e9e67ef805e33e From AOSP commit: 834180cc81c100f264d4f96a2776c51a99a810f8
2017-10-15Fix spelling typos in contrib/android codeTheodore Ts'o
These typos were found by Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-10-15Merge branch 'maint' into nextTheodore Ts'o
2017-10-15Fix typos in code comments and developer docsSebastian Rasmussen
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
2017-07-23libext2fs: add ea_inode support to set xattrTahsin Erdogan
This patch is a major update to how we decide where to put extended attributes. The main motivation is to enable creating values in extended attribute inodes. While doing this, we want to implement a behavior that is as close to kernel as possible. Existing set ea code deviates from kernel behavior which makes it harder to implement ea_inode feature: - kernel only sorts ea entries in xattr block, e2fsprogs implementation sorts all entries on every update. - e2fsprogs implementation shuffled things on every update so the order of updates does not matter. Kernel does not reshuffle things. - e2fsprogs could evacuate entries from inode body to xattr block and vice versa. This behavior does not exist in kernel. Such differences could lead to inconsistent behavior between fuse2fs and a kernel mount. With ea_inode feature, we also need to decide whether to put a value in an inode or keep it 'inline'. In kernel implementation this depends on current placement of entries. To close the behavioral gap, ext2fs_xattr_set() now takes over the decision about where to place ea values. This also allows it to raise errors early instead of delaying them to a separate ext2fs_xattrs_write() call later. Signed-off-by: Tahsin Erdogan <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: skip setting timestamp if src_dir is nullJin Qian
fs_mgr formats /data without src_dir. Test: zero-out first 4096 bytes on /data partition and reboot Bug: 35219933 Change-Id: I12f1eb1002fd96d18fc7a9ae5a529f673eb57273 From AOSP commit: b5330546f444b49c4d751e9ddd7677ae97161f0c Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: support multiple selinux file contextsJin Qian
Support passing a string of multiple selinux file contexts separated by comma with -S option. E.g. e2fsdroid -S ctx1,ctx2 output Test: make systemimage Bug: 35219933 Change-Id: Icc0f9d5d6180b5db7d68f7de45a1128f5a20be89 From AOSP commit: 34f4f33b24280c0a21a95407da4cf4988b275c95 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: don't print empty files in block_list.c:end_new_fileBen Fennema
Change-Id: I4b38841c9c36a8faaa9f65bc7b61c7abdddab094 Signed-off-by: Ben Fennema <fennema@google.com> From AOSP commit: cc933ab3bfee821dc885fe5a6bbb2a4997304ff9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: Disable macro redefined warnings.Christopher Ferris
The new kernel headers do: #define __bitwise __bitwise__ However, the code redefines __bitwise without undef'ing it first. This is a temporary fix, b/35721782 filed to fix this. Change-Id: I2c6a64146966f1737835f012d24ccc844570d02b Test: Builds without warningers/errors. From AOSP commit: commit 91581e8f15b8a29aedea3e7c11162301c7e66ec3 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: Convert e2fsprogs targets to soong.Alex Deymo
This patch also removes all the "-host" and "_static" suffix from all the libraries adding "unique_host_soname: true". This prevents confusions with the host installed libraries. A new "libext2_misc" library is introduced to export some files from the misc/ directory to other binaries in this project. Bug: 34220783 Test: mmma external/e2fsprogs Change-Id: Ia1b689991346b11f8cb38f7c6ee356e666e01d6d From AOSP commit: 7a9e1a96766d31a41b88f0a539fcc3d532b5c530 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: HACK: android: exit(1) if selabel_lookup failsNick Kralevich
If selabel_lookup fails, the current implementation of set_selinux_xattr returns -1, but the command line tool e2fsdroid reports success. There's a bunch of things wrong: 1) -1 does not appear to be a legal errcode_t value. The appropriate return value appears to be DIRENT_ABORT. 2) A return value of DIRENT_ABORT is ignored by the upper layers of the code. 3) Attempting to fix the upper layers of the code to not ignore DIRENT_ABORT results in complaints about not being able to create /lost+found. Call stack: - main - android_configure_fs - __android_configure_fs - ext2fs_dir_iterate2 - ext2fs_block_iterate3 - ext2fs_process_dir_block - walk_dir - ext2fs_dir_iterate2 - ext2fs_block_iterate3 - ext2fs_process_dir_block - walk_dir - ext2fs_dir_iterate2 - ext2fs_block_iterate3 - ext2fs_process_dir_block - androidify_inode - set_selinux_xattr I'm honestly not sure how to fix this, so just throw an exit(1) in there, to make sure the program dies a horrible death if selabel_lookup() fails. This is much better than the alternative of e2fsdroid returning success with an improperly labeled file. Bug: 34358308 Test: Artifically modify selabel_lookup() to return a failure, and verify Android doesn't compile. Test: Verify Android compiles under normal circumstances. Change-Id: I60e04bc6559a66d3f3202f2c28e2519856385ded From AOSP commit: 87a7db7cf2ca0feecaccad94bf22f92c726000c3 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: Remove "_host" and "_static" suffix from libsparse.Alex Deymo
Bug: 34220783 Change-Id: I218ab40f423bf0bddebc3b2e1526bd9e3549eed6 From AOSP commit: 92d281bd3145e149d7330272b1704d77191482c4 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: report error from ext2fsJin Qian
Returns error back to caller (build system) instead of failing silently. Change-Id: I8bad9eed6fe639014126c98c6bf02e539f086a98 From AOSP commit: 948b9fecf8f92785a171c9416080e0660f089deb Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: set timestamp based on source filesJin Qian
Timestamp was incorrectly set to -1 or left unset. Use lstat to read timestamps from source files and set on target files. Change-Id: I66b2c5281ae769a52bc4e1638895eb5285c18b7a From AOSP commit: d882f1e23195d1fb16a6fe1887c842d04ab420b7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: use absolute path for product_outJin Qian
Android build runs e2fsdroid in a tmp directory. Use absolute path to access files in product_out. Change-Id: Ic238d93ff68f03bd82245bda127d269972f5ef63 From AOSP commit: bc02ac42b26836f22579a81edb5711cae837732f Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: remove extra "/" when mountpoint is "/"Jin Qian
Extra "/" causes problem when matching entries in fs_config. Change-Id: Ie1659b98db3d599cdd1a832d2dfb3036d399a6e3 From AOSP commit: 7fe49140ef755e98607a67199971c01ed6a96930 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: _GNU_SOURCE must be defined before any #include.Elliott Hughes
Fixes the "asprintf undeclared" warning in this code. Bug: N/A Test: builds Change-Id: I42e1bfbdbc0391c5e5d7908204f9064ec858c84d From AOSP commit: 1ebca4b43115846af705bd320bccb8f930e328c8 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: android: add the ext2simg toolAdrien Schildknecht
This tool converts ext images to android sparse images. Test: ext2simg img.ext4 img.sparse simg2img img.sparse img2.ext4 e2fsck -f img.ext; e2fsck -f img2.ext cmp img{,2}.ext Change-Id: I7ec6f126160dacafb0946ba99f07d4bb42a19c45 From AOSP commit: c1b7d19958dc3dbe53810811ea3dcc4f04f85c73 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: create incremental imagesAdrien Schildknecht
Add an option to read a base_fs file and allocate the blocks according to the mapping provided by the file. Test: 1/ Create a normal image and an incremental one. Compare the number of blocks that have changed. 2/ Create an image. Create an incremantal image. The basefs file and the block_list file are the same. Change-Id: Ie000ca48cf000d95e7a45a9752699abfc7484b6c From AOSP commit: 16babe7b79c4c9b6d75d60e30c04a8e24278e4fa Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: read and enforce android's permissionsAdrien Schildknecht
Set the permissions and the extended attributes as defined by fs_config and selinux. Test: create an image with make_ext4 and with mke2fs + e2fsdroid Compare the output of: for f in `find . | sort`; do xattr -l "$f"; md5sum "$f" ls -lah "$f" done Change-Id: I64c97f81c7f5e2bcf3cee3431e410d064cf0735a From AOSP commit: 4c1e1f46301b3ff7f60be1d8e943ecc23b917ca7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: add an option to generate a base_fs fileAdrien Schildknecht
Test: make_ext4 and e2fsdroid both generate the same list of file. Change-Id: Idaf42b64b588824d453bc204562ccbe702de26a9 From AOSP commit: 0fe9949ca0cae4be6cde69e084db922506eda11a Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-23AOSP: e2fsdroid: a tool to create android compatible imageAdrien Schildknecht
Add an option to generate a block_list file from an existing ext4 or sparse image. Test: make_ext4 and e2fsdroid both generate the same list of file. Change-Id: I5ecc6521797397102904bf510c283dfd50a72721 From AOSP commit: fdc29bee07aef3a379f3ec3ccbaa551ff6500bff Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-10-24android: fix Mac buildTheodore Ts'o
Disable building debugfs and e4crypt on mac. Add missing time.h include in ext2fs.h for time_t. From AOSP commit: f2b2d2c0a6af8bd1e1a19150cf9d41d8f2b0e39a Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15Android.mk: Replace _host suffix with more standard -host suffixAlex Deymo
Most libraries use the "-host" suffix when building for the host. This patch renames all the libraries to use -host instead of _host. Addresses-Google-Bug: #24619596 TEST=make dist Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-10-24debugfs: clean up feature test macros with predicate functionsDarrick J. Wong
Create separate predicate functions to test/set/clear feature flags, thereby replacing the wordy old macros. Furthermore, clean out the places where we open-coded feature tests. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-14android: add add_ext4_encrypt helper programTheodore Ts'o
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12Eliminate doubly defined _LARGEFILE_SOURCE warningTheodore Ts'o
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-25Add fsstress to contrib so it can be built for use in AndroidTheodore Ts'o
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-05-05contrib: script to create minified ext4 image from a directoryDarrick J. Wong
The dir2fs script converts a directory into a minimized ext4 filesystem. FS creation parameters are tweaked to reduce as much FS overhead as possible, and to leave as few unused blocks and inodes as possible. Given that mke2fs -d lays out files linearly from the beginning of the FS, using resize2fs -M is not as horrible as it usually is. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-18contrib: add support for COLLAPSE_RANGE and ZERO_RANGE to falocate programDarrick J. Wong
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26contrib: add script to help resync journal code with kernelDarrick J. Wong
Add a script that handles (most) of the code massaging necessary to resync {recovery,revoke}.c from the Linux kernel into e2fsprogs. Usage: jbd2-resync.sh linux/fs/jbd2/revoke.c e2fsprogs/e2fsck/revoke.c Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-04tests: avoid using mktemp -tTheodore Ts'o
The -t option is documented as deprecated in GNU's mktemp, and FreeBSD's mktemp doesn't support it at all. Replace it with the construct "mktemp ${TMPDIR:-/tmp}/foo.XXXXXX" Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-10-13contrib/populate-extfs.sh: use debugfs to populate extX fsRobert Yang
This script uses debugfs command to populate the ext2/3/4 filesystem from a given directory, it is a little similar to genext2fs, but this one fully supports ext3 and ext4. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-01-24contrib: add missing '-p' to fallocate's usage messageZheng Liu
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-21contrib: fix namespace leakage in spd_readdirTheodore Ts'o
Declare the internal symbols alloc_dirstruct() and cache_dirstruct() as static so they don't leak out into the global namespace. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-21contrib: add thread locking and readdir64_r support to spd_readdirTheodore Ts'o
This is part of a series of improvements from a 2008 version of spd_readdir.c that somehow didn't make it into the version which we checked into e2fsprogs git tree. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-21contrib: add safe_getenv() support to spd_readdirTheodore Ts'o
This is part of a series of improvements from a 2008 version of spd_readdir.c that somehow didn't make it into the version which we checked into e2fsprogs git tree. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-12-06contrib/fallocate: add support for punch functionalityTheodore Ts'o
Also fix the -o option so it works correctly (instead of core dumping). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-25Add spd_readdir.c to the contrib directoryTheodore Ts'o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-22fallocate: Add truncate (-t) optionTheodore Ts'o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-22Add fallocate.c to contrib from Eric SandeenTheodore Ts'o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22make-sparse: Write a zero-byte at the end of the imageTheodore Ts'o
This is necessary to preserve the i_size of the output file; otherwise programs like e2fsck will complain that the filesystem has been truncated. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02Add e2croncheck script to the contrib directoryTheodore Ts'o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>