diff --git a/native/jni/utils/img.c b/native/jni/utils/img.c index 9c905de35..11f5515c7 100644 --- a/native/jni/utils/img.c +++ b/native/jni/utils/img.c @@ -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; } diff --git a/native/jni/utils/misc.c b/native/jni/utils/misc.c index 326fd9392..4c85b6a7b 100644 --- a/native/jni/utils/misc.c +++ b/native/jni/utils/misc.c @@ -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; }