From 69364fe553c8ceda03b5fa2de7d2459d76da8fb7 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 20 Jun 2018 14:18:18 +0900 Subject: e2fsdroid and mke2fs are dynamic executable in recovery partition The two utilities are now converted to dynamic executables as shared libraries are supported in recovery mode. As part of the conversion, their location has moved from /sbin to /system/bin. Reflect the change in the program 'recovery' Bug: 79146551 Test: adb reboot recovery, and select 'Wipe data/factory reset'. The data partition is formatted and there is no selinux denial. Change-Id: Ie7cfc4c50ab1e6767e4a5170533ccf826ec7d7f3 --- Android.mk | 4 ++-- roots.cpp | 10 ++-------- updater/install.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Android.mk b/Android.mk index 257564058..69490a57e 100644 --- a/Android.mk +++ b/Android.mk @@ -177,8 +177,8 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_HAL_STATIC_LIBRARIES := libhealthd LOCAL_REQUIRED_MODULES := \ - e2fsdroid_static \ - mke2fs_static \ + e2fsdroid.recovery \ + mke2fs.recovery \ mke2fs.conf ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) diff --git a/roots.cpp b/roots.cpp index 26ebf1fbe..2b26bf43e 100644 --- a/roots.cpp +++ b/roots.cpp @@ -283,7 +283,7 @@ int format_volume(const char* volume, const char* directory) { if (strcmp(v->fs_type, "ext4") == 0) { static constexpr int kBlockSize = 4096; std::vector mke2fs_args = { - "/sbin/mke2fs_static", "-F", "-t", "ext4", "-b", std::to_string(kBlockSize), + "/system/bin/mke2fs", "-F", "-t", "ext4", "-b", std::to_string(kBlockSize), }; int raid_stride = v->logical_blk_size / kBlockSize; @@ -305,13 +305,7 @@ int format_volume(const char* volume, const char* directory) { int result = exec_cmd(mke2fs_args); if (result == 0 && directory != nullptr) { std::vector e2fsdroid_args = { - "/sbin/e2fsdroid_static", - "-e", - "-f", - directory, - "-a", - volume, - v->blk_device, + "/system/bin/e2fsdroid", "-e", "-f", directory, "-a", volume, v->blk_device, }; result = exec_cmd(e2fsdroid_args); } diff --git a/updater/install.cpp b/updater/install.cpp index bd22467ab..5dbe4a984 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -511,8 +511,8 @@ Value* FormatFn(const char* name, State* state, const std::vector(e2fsdroid_argv)); if (status != 0) { LOG(ERROR) << name << ": e2fsdroid failed (" << status << ") on " << location; -- cgit v1.2.3