mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Android P have no make_ext4fs, use mke2fs as fallback
This commit is contained in:
parent
9e737df534
commit
e4e5269836
@ -58,11 +58,13 @@ int create_img(const char *img, int size) {
|
||||
LOGI("Create %s with size %dM\n", img, size);
|
||||
int ret;
|
||||
|
||||
char buffer[16];
|
||||
snprintf(buffer, sizeof(buffer), "%dM", size);
|
||||
ret = exec_command_sync("make_ext4fs", "-l", buffer, img, NULL);
|
||||
if (ret < 0)
|
||||
return 1;
|
||||
char size_str[16];
|
||||
snprintf(size_str, sizeof(size_str), "%dM", size);
|
||||
ret = exec_command_sync("make_ext4fs", "-b", "4096", "-l", size_str, img, NULL);
|
||||
if (ret < 0) {
|
||||
// On Android P there is no make_ext4fs, use mke2fs
|
||||
ret = exec_command_sync("mke2fs", "-b", "4096", "-t", "ext4", img, size_str, NULL);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ static int v_exec_command(int err, int *fd, void (*setupenv)(struct vector*), co
|
||||
}
|
||||
|
||||
execvpe(argv0, (char **) vec_entry(&args), envp);
|
||||
PLOGE("execvpe");
|
||||
PLOGE("execvpe %s", argv0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user