Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b68db40f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6465939 from 9842adf7 to mainline-release

Change-Id: Iefa042e6e7be25dad189263b07579decf32433b0
parents 6c3e9685 9842adf7
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include "first_stage_console.h"

#include <stdio.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
@@ -88,18 +87,8 @@ void StartConsole() {
    _exit(127);
}

int FirstStageConsole(const std::string& cmdline) {
    auto pos = cmdline.find("androidboot.first_stage_console=");
    if (pos != std::string::npos) {
        int val = 0;
        if (sscanf(cmdline.c_str() + pos, "androidboot.first_stage_console=%d", &val) != 1) {
            return FirstStageConsoleParam::DISABLED;
        }
        if (val <= FirstStageConsoleParam::MAX_PARAM_VALUE && val >= 0) {
            return val;
        }
    }
    return FirstStageConsoleParam::DISABLED;
bool FirstStageConsole(const std::string& cmdline) {
    return cmdline.find("androidboot.first_stage_console=1") != std::string::npos;
}

}  // namespace init
+1 −8
Original line number Diff line number Diff line
@@ -21,15 +21,8 @@
namespace android {
namespace init {

enum FirstStageConsoleParam {
    DISABLED = 0,
    CONSOLE_ON_FAILURE = 1,
    IGNORE_FAILURE = 2,
    MAX_PARAM_VALUE = IGNORE_FAILURE,
};

void StartConsole();
int FirstStageConsole(const std::string& cmdline);
bool FirstStageConsole(const std::string& cmdline);

}  // namespace init
}  // namespace android
+3 −3
Original line number Diff line number Diff line
@@ -200,16 +200,16 @@ int FirstStageMain(int argc, char** argv) {
    }

    Modprobe m({"/lib/modules"}, module_load_file);
    auto want_console = ALLOW_FIRST_STAGE_CONSOLE ? FirstStageConsole(cmdline) : 0;
    auto want_console = ALLOW_FIRST_STAGE_CONSOLE && FirstStageConsole(cmdline);
    if (!m.LoadListedModules(!want_console)) {
        if (want_console != FirstStageConsoleParam::DISABLED) {
        if (want_console) {
            LOG(ERROR) << "Failed to load kernel modules, starting console";
        } else {
            LOG(FATAL) << "Failed to load kernel modules";
        }
    }

    if (want_console == FirstStageConsoleParam::CONSOLE_ON_FAILURE) {
    if (want_console) {
        StartConsole();
    }

+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ void atrace_update_tags()
}

#define WRITE_MSG(format_begin, format_end, name, value) { \
    char buf[ATRACE_MESSAGE_LENGTH]; \
    char buf[ATRACE_MESSAGE_LENGTH] __attribute__((uninitialized));     \
    int pid = getpid(); \
    int len = snprintf(buf, sizeof(buf), format_begin "%s" format_end, pid, \
        name, value); \