Unverified Commit 3ae73447 authored by LoveSy's avatar LoveSy Committed by GitHub

Create `/dev` on stub cpio

parent 4eb71830
...@@ -209,6 +209,10 @@ bool LegacySARInit::mount_system_root() { ...@@ -209,6 +209,10 @@ bool LegacySARInit::mount_system_root() {
backup_files(); backup_files();
LOGD("Mounting system_root\n"); LOGD("Mounting system_root\n");
// there's no /dev in stub cpio
xmkdir("/dev", 0777);
strcpy(blk_info.block_dev, "/dev/root"); strcpy(blk_info.block_dev, "/dev/root");
do { do {
...@@ -250,7 +254,6 @@ mount_root: ...@@ -250,7 +254,6 @@ mount_root:
switch_root("/system_root"); switch_root("/system_root");
// Make dev writable // Make dev writable
xmkdir("/dev", 0755);
xmount("tmpfs", "/dev", "tmpfs", 0, "mode=755"); xmount("tmpfs", "/dev", "tmpfs", 0, "mode=755");
mount_list.emplace_back("/dev"); mount_list.emplace_back("/dev");
......
...@@ -39,6 +39,7 @@ void FirstStageInit::prepare() { ...@@ -39,6 +39,7 @@ void FirstStageInit::prepare() {
} }
void LegacySARInit::first_stage_prep() { void LegacySARInit::first_stage_prep() {
xmkdir("/data", 0755);
xmount("tmpfs", "/data", "tmpfs", 0, "mode=755"); xmount("tmpfs", "/data", "tmpfs", 0, "mode=755");
// Patch init binary // Patch init binary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment