From 0f3cfef2780d1e0890e3274bbf77106ccce3dcdb Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Wed, 16 Oct 2024 04:48:08 +0800 Subject: [PATCH] Revert "init: support 2SI devices with skip_initramfs" This reverts commit b38fd1ca5f15ed22858c7737879c38d360e78eac. --- native/src/init/init.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/native/src/init/init.cpp b/native/src/init/init.cpp index 4beaa9fe2..c71313325 100644 --- a/native/src/init/init.cpp +++ b/native/src/init/init.cpp @@ -90,17 +90,15 @@ int main(int argc, char *argv[]) { } else { // This will also mount /sys and /proc load_kernel_info(&config); - bool recovery = access("/sbin/recovery", F_OK) == 0 || - access("/system/bin/recovery", F_OK) == 0; - if (config.force_normal_boot) - init = new FirstStageInit(argv, &config); - else if (!recovery && check_two_stage()) - init = new FirstStageInit(argv, &config); - else if (config.skip_initramfs) + if (config.skip_initramfs) init = new LegacySARInit(argv, &config); - else if (recovery) + else if (config.force_normal_boot) + init = new FirstStageInit(argv, &config); + else if (access("/sbin/recovery", F_OK) == 0 || access("/system/bin/recovery", F_OK) == 0) init = new RecoveryInit(argv, &config); + else if (check_two_stage()) + init = new FirstStageInit(argv, &config); else init = new RootFSInit(argv, &config); }