summaryrefslogtreecommitdiff
path: root/ext4_utils/wipe.c
AgeCommit message (Collapse)Author
2016-10-09ext4_utils: Export headers for libext4_utils* libs.Tao Bao
So we can do "#include <ext4_utils/make_ext4fs.h>" without adding "LOCAL_C_INCLUDES += system/extras/ext4_utils". Also clean up the #include lines in system/extras/ext4_utils/. Test: `m checkbuild` works. Change-Id: I3c8b07c9b6f5996160e0cb6d9d069579b1609f60 (cherry picked from commit 018ef1be61e749d0fbe0f05179a4f0f9b858ae57)
2014-06-13Ignore wipe operation on non-block devices.David 'Digit' Turner
The implementation of make_ext4fs() calls make_ext4fs_internal() by forcing the |wipe| parameter to true, which is problematic when the library is used within the emulator (the wipe operation will always fail on non-Linux platforms). This patch does the following: - Add a 'is_block_device_fd()' function to check that a file descriptor points to a real block device. - Modify the implementation of wipe_block_device() uses it to return silently when trying to wipe a non-block-device file. - Add a WIPE_IS_SUPPORTED flag in wipe.h that indicates whether block device wiping is supported on the current platform (for now, this is only the case on Linux). BUG=NONE Change-Id: I62b62b7c3e99b465c3b876154231e7c2fe541b23
2011-03-22Make a failure of the BLKDISCARD ioctl non-fatal.Ken Sumrall
Failure to erase the partition before making a new filesystem should not be fatal, especially since this is called from recovery, and if make_ext4fs() dies, recovery dies. Change-Id: I1b50b8c486d403a5d9cbd5e9de73cf752d8ef8f7
2011-03-22Fix to properly wipe filesystems larger than 4 gigabytes.Ken Sumrall
Pass the wipe size to the wipe function in a 64 bit int. Change-Id: Ia6a0c70c8ddacaae35d17732d61b126219e5c158
2011-01-28ext4_utils: Fix non-linux buildsColin Cross
Change-Id: I5a22083645055abc36a3addc4eae45b40a7a6b2b
2011-01-28ext4_utils: Add support for wipe option, and wipe by default in recoveryColin Cross
Adds a -w option to make_ext4fs, which will attempt to use the BLKSECDISCARD ioctl to erase the partition in order to avoid leaving old data where it could be recovered, and to improve wear levelling after a reformat. Also causes factory reset through recovery to do a wipe. Change-Id: Ibe34bbd84552e526be6bd041024a950806aca6b4