From a7144f7eb2a8004d87c52cbabbc336f6e99b9ca3 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 31 Oct 2019 08:02:10 -0700 Subject: [PATCH] first_stage_init: if console enabled allow for errors in module loading Allow for module load errors if first stage console is enabled, userdebug development builds, load what you can and continue. Test: compile Bug: 141311820 Change-Id: I30f3ee1129373f6ffedcf03807c212c60d4c39aa --- init/first_stage_init.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/init/first_stage_init.cpp b/init/first_stage_init.cpp index fd2d766a2..ac44796ae 100644 --- a/init/first_stage_init.cpp +++ b/init/first_stage_init.cpp @@ -239,11 +239,16 @@ int FirstStageMain(int argc, char** argv) { } Modprobe m({"/lib/modules"}); - if (!m.LoadListedModules()) { - LOG(FATAL) << "Failed to load kernel modules"; + auto want_console = ALLOW_FIRST_STAGE_CONSOLE && FirstStageConsole(cmdline); + if (!m.LoadListedModules(!want_console)) { + if (want_console) { + LOG(ERROR) << "Failed to load kernel modules, starting console"; + } else { + LOG(FATAL) << "Failed to load kernel modules"; + } } - if (ALLOW_FIRST_STAGE_CONSOLE && FirstStageConsole(cmdline)) { + if (want_console) { StartConsole(); }