Create /dev on stub cpio

This commit is contained in:
LoveSy 2022-06-22 19:05:50 +08:00 committed by GitHub
parent 4eb71830b3
commit 3ae7344747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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");

View File

@ -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