summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher R. Palmer <crpalmer@gmail.com>2016-05-16 05:21:28 -0400
committerChristopher R. Palmer <crpalmer@gmail.com>2016-05-16 05:25:36 -0400
commit516d6913dc5acd695581b3999fab0b5192353022 (patch)
tree0a2193a3410cbe002ffbb7613ef74403f27634b3
parent8284bce0e87d18e0779b12b63797515406c2d553 (diff)
downloadsystem_core-516d6913dc5acd695581b3999fab0b5192353022.zip
system_core-516d6913dc5acd695581b3999fab0b5192353022.tar.gz
system_core-516d6913dc5acd695581b3999fab0b5192353022.tar.bz2
init: Allow devices to opt-out of fsck'ing on power off
On the zenfone2 the fsck code patch kills alls processes. This causes watchdogd to get killed which then causes the system to emergency reboot instead of powering off. Change-Id: Ibcc74825df6571caa70e2dde7766a72b7749581b
-rw-r--r--init/Android.mk4
-rw-r--r--init/builtins.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/init/Android.mk b/init/Android.mk
index aa32236..85dfbfc 100644
--- a/init/Android.mk
+++ b/init/Android.mk
@@ -68,6 +68,10 @@ ifneq ($(TARGET_IGNORE_RO_BOOT_REVISION),)
LOCAL_CFLAGS += -DIGNORE_RO_BOOT_REVISION
endif
+ifneq ($(TARGET_INIT_UMOUNT_AND_FSCK_IS_UNSAFE),)
+LOCAL_CFLAGS += -DUMOUNT_AND_FSCK_IS_UNSAFE
+endif
+
LOCAL_MODULE:= init
LOCAL_C_INCLUDES += \
external/zlib \
diff --git a/init/builtins.cpp b/init/builtins.cpp
index d0dbecc..1681d17 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -116,6 +116,7 @@ static void service_start_if_not_disabled(struct service *svc)
static void unmount_and_fsck(const struct mntent *entry)
{
+#ifndef UMOUNT_AND_FSCK_IS_UNSAFE
if (strcmp(entry->mnt_type, "f2fs") && strcmp(entry->mnt_type, "ext4"))
return;
@@ -173,6 +174,7 @@ static void unmount_and_fsck(const struct mntent *entry)
android_fork_execvp_ext(ARRAY_SIZE(ext4_argv), (char **)ext4_argv,
&st, true, LOG_KLOG, true, NULL);
}
+#endif
}
int do_class_start(int nargs, char **args)