Merge "e2fsdroid and mke2fs are dynamic executable in recovery partition"
This commit is contained in:
+2
-2
@@ -177,8 +177,8 @@ LOCAL_STATIC_LIBRARIES := \
|
|||||||
LOCAL_HAL_STATIC_LIBRARIES := libhealthd
|
LOCAL_HAL_STATIC_LIBRARIES := libhealthd
|
||||||
|
|
||||||
LOCAL_REQUIRED_MODULES := \
|
LOCAL_REQUIRED_MODULES := \
|
||||||
e2fsdroid_static \
|
e2fsdroid.recovery \
|
||||||
mke2fs_static \
|
mke2fs.recovery \
|
||||||
mke2fs.conf
|
mke2fs.conf
|
||||||
|
|
||||||
ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
|
ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ int format_volume(const char* volume, const char* directory) {
|
|||||||
if (strcmp(v->fs_type, "ext4") == 0) {
|
if (strcmp(v->fs_type, "ext4") == 0) {
|
||||||
static constexpr int kBlockSize = 4096;
|
static constexpr int kBlockSize = 4096;
|
||||||
std::vector<std::string> mke2fs_args = {
|
std::vector<std::string> 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;
|
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);
|
int result = exec_cmd(mke2fs_args);
|
||||||
if (result == 0 && directory != nullptr) {
|
if (result == 0 && directory != nullptr) {
|
||||||
std::vector<std::string> e2fsdroid_args = {
|
std::vector<std::string> e2fsdroid_args = {
|
||||||
"/sbin/e2fsdroid_static",
|
"/system/bin/e2fsdroid", "-e", "-f", directory, "-a", volume, v->blk_device,
|
||||||
"-e",
|
|
||||||
"-f",
|
|
||||||
directory,
|
|
||||||
"-a",
|
|
||||||
volume,
|
|
||||||
v->blk_device,
|
|
||||||
};
|
};
|
||||||
result = exec_cmd(e2fsdroid_args);
|
result = exec_cmd(e2fsdroid_args);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -511,8 +511,8 @@ Value* FormatFn(const char* name, State* state, const std::vector<std::unique_pt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fs_type == "ext4") {
|
if (fs_type == "ext4") {
|
||||||
const char* mke2fs_argv[] = { "/sbin/mke2fs_static", "-t", "ext4", "-b", "4096",
|
const char* mke2fs_argv[] = { "/system/bin/mke2fs", "-t", "ext4", "-b", "4096",
|
||||||
location.c_str(), nullptr, nullptr };
|
location.c_str(), nullptr, nullptr };
|
||||||
std::string size_str;
|
std::string size_str;
|
||||||
if (size != 0) {
|
if (size != 0) {
|
||||||
size_str = std::to_string(size / 4096LL);
|
size_str = std::to_string(size / 4096LL);
|
||||||
@@ -525,8 +525,8 @@ Value* FormatFn(const char* name, State* state, const std::vector<std::unique_pt
|
|||||||
return StringValue("");
|
return StringValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* e2fsdroid_argv[] = { "/sbin/e2fsdroid_static", "-e", "-a", mount_point.c_str(),
|
const char* e2fsdroid_argv[] = { "/system/bin/e2fsdroid", "-e", "-a", mount_point.c_str(),
|
||||||
location.c_str(), nullptr };
|
location.c_str(), nullptr };
|
||||||
status = exec_cmd(e2fsdroid_argv[0], const_cast<char**>(e2fsdroid_argv));
|
status = exec_cmd(e2fsdroid_argv[0], const_cast<char**>(e2fsdroid_argv));
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
LOG(ERROR) << name << ": e2fsdroid failed (" << status << ") on " << location;
|
LOG(ERROR) << name << ": e2fsdroid failed (" << status << ") on " << location;
|
||||||
|
|||||||
Reference in New Issue
Block a user