Revert "init: support 2SI devices with skip_initramfs"

This reverts commit b38fd1ca5f.
This commit is contained in:
vvb2060 2024-10-16 04:48:08 +08:00 committed by John Wu
parent b32d7bfafd
commit 0f3cfef278

View File

@ -90,17 +90,15 @@ int main(int argc, char *argv[]) {
} else { } else {
// This will also mount /sys and /proc // This will also mount /sys and /proc
load_kernel_info(&config); load_kernel_info(&config);
bool recovery = access("/sbin/recovery", F_OK) == 0 ||
access("/system/bin/recovery", F_OK) == 0;
if (config.force_normal_boot) if (config.skip_initramfs)
init = new FirstStageInit(argv, &config);
else if (!recovery && check_two_stage())
init = new FirstStageInit(argv, &config);
else if (config.skip_initramfs)
init = new LegacySARInit(argv, &config); 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); init = new RecoveryInit(argv, &config);
else if (check_two_stage())
init = new FirstStageInit(argv, &config);
else else
init = new RootFSInit(argv, &config); init = new RootFSInit(argv, &config);
} }