From 4879b37b5db3b06eb17a4a0deda5fc08fef51c41 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Mon, 3 Dec 2018 18:45:47 +0800 Subject: Fix the long broken format function * For EXT2/3: * Align mke2fs options with Android 9.0 fs_mgr_format.cpp. * For EXT4: * Note that make_ext4fs is still in use on Android 8.1 to workaround a FDE encryption bug even though mke2fs has become the default choice. The bug is fixed in Android 9.0+. * For F2FS: * Drop the broken "-r" option, it's never ported to O, explicitly pass number of sectors instead. * Keep all options aligned with Pie fs_mgr. * Check existence before start wiping, as Wipe_EXT4 does. * For all: * Calculate block size at runtime, and reserve the space specified via negative "length" option from fstab. Note that positive length will be ignored. * If the partition has crypto footer, and "length" is not specified in fstab, automatically reverse CRYPT_FOOTER_OFFSET (16384). * Remove the default crypto key location: footer, this is a bad assumption since most partitions don't use encryption! We need to know the real situation to decide whether to reserve crypto footer on format. * If the current action is "wipe" or "change filesystem", wipe crypto footer or block device after mkfs if the partition is unencrypted or undecrypted (e.g., wrong password). * If the current action is "format data", unconditionally wipe crypto footer or block device. Change-Id: I7304a8ee703131ea4a08ab7c60334af28cac28b3 --- prebuilt/Android.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'prebuilt') diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk index 7696affc4..de8287937 100644 --- a/prebuilt/Android.mk +++ b/prebuilt/Android.mk @@ -41,6 +41,9 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?),0) RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/adbd endif RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) + RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsdroid +endif RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/resize2fs -- cgit v1.2.3