diff --git a/native/jni/init/mount.cpp b/native/jni/init/mount.cpp index 953b0f28e..cd86b930d 100644 --- a/native/jni/init/mount.cpp +++ b/native/jni/init/mount.cpp @@ -209,6 +209,10 @@ bool LegacySARInit::mount_system_root() { backup_files(); LOGD("Mounting system_root\n"); + + // there's no /dev in stub cpio + xmkdir("/dev", 0777); + strcpy(blk_info.block_dev, "/dev/root"); do { @@ -250,7 +254,6 @@ mount_root: switch_root("/system_root"); // Make dev writable - xmkdir("/dev", 0755); xmount("tmpfs", "/dev", "tmpfs", 0, "mode=755"); mount_list.emplace_back("/dev"); diff --git a/native/jni/init/twostage.cpp b/native/jni/init/twostage.cpp index b91f97259..5f7de268b 100644 --- a/native/jni/init/twostage.cpp +++ b/native/jni/init/twostage.cpp @@ -39,6 +39,7 @@ void FirstStageInit::prepare() { } void LegacySARInit::first_stage_prep() { + xmkdir("/data", 0755); xmount("tmpfs", "/data", "tmpfs", 0, "mode=755"); // Patch init binary