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 --- Android.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index 920b3903b..6eb1cbcd5 100755 --- a/Android.mk +++ b/Android.mk @@ -46,6 +46,7 @@ ifneq ($(TW_DEVICE_VERSION),) else LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-0"' endif +LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) LOCAL_SRC_FILES := \ twrp.cpp \ -- cgit v1.2.3