e2fsck: drop -f when TARGET_USES_MKE2FS is enabled
- Drop forced (-f) e2fsck check when the product has
enabled new ext4 generation by setting TARGET_USES_MKE2FS.
- The new generation tool is supposed to give better stability,
thus justifying dropping -f.
- This should help reducing boot-up time as full check (-f) can
increase boot-up time significantly depending on amount of data.
bug: 32246772
Test: many reboots
Change-Id: I631525bf7504bbfb025e170c8d24ad9d3ef3532e
diff --git a/fs_mgr/Android.mk b/fs_mgr/Android.mk
index d6b699b..8997cab 100644
--- a/fs_mgr/Android.mk
+++ b/fs_mgr/Android.mk
@@ -32,6 +32,11 @@
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_CFLAGS := -Werror
+ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
+ ifeq ($(TARGET_USES_MKE2FS), true)
+ LOCAL_CFLAGS += -DTARGET_USES_MKE2FS
+ endif
+endif
ifneq (,$(filter userdebug,$(TARGET_BUILD_VARIANT)))
LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
endif
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index 863c12c..7fac2fb 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -101,7 +101,9 @@
char tmpmnt_opts[64] = "errors=remount-ro";
char *e2fsck_argv[] = {
E2FSCK_BIN,
+#ifndef TARGET_USES_MKE2FS // "-f" only for old ext4 generation tool
"-f",
+#endif
"-y",
blk_device
};