diff --git a/init/host_init_stubs.cpp b/init/host_init_stubs.cpp index b85e54a69..47d263370 100644 --- a/init/host_init_stubs.cpp +++ b/init/host_init_stubs.cpp @@ -26,9 +26,6 @@ int setgroups(size_t __size, const gid_t* __list) { namespace android { namespace init { -// init.h -std::string default_console = "/dev/console"; - // property_service.h bool CanReadProperty(const std::string& source_context, const std::string& name) { return true; diff --git a/init/host_init_stubs.h b/init/host_init_stubs.h index f6e967653..4fbd2e671 100644 --- a/init/host_init_stubs.h +++ b/init/host_init_stubs.h @@ -35,9 +35,6 @@ int setgroups(size_t __size, const gid_t* __list); namespace android { namespace init { -// init.h -extern std::string default_console; - // property_service.h bool CanReadProperty(const std::string& source_context, const std::string& name); extern uint32_t (*property_set)(const std::string& name, const std::string& value); diff --git a/init/init.cpp b/init/init.cpp index bb12a6e25..2b94825e1 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -90,8 +90,6 @@ static int property_triggers_enabled = 0; static char qemu[32]; -std::string default_console = "/dev/console"; - static int signal_fd = -1; static std::unique_ptr waiting_for_prop(nullptr); @@ -348,14 +346,6 @@ static Result wait_for_coldboot_done_action(const BuiltinArguments& args) return {}; } -static Result console_init_action(const BuiltinArguments& args) { - std::string console = GetProperty("ro.boot.console", ""); - if (!console.empty()) { - default_console = "/dev/" + console; - } - return {}; -} - static Result SetupCgroupsAction(const BuiltinArguments&) { // Have to create using make_dir function // for appropriate sepolicy to be set for it @@ -762,7 +752,6 @@ int SecondStageMain(int argc, char** argv) { return {}; }, "KeychordInit"); - am.QueueBuiltinAction(console_init_action, "console_init"); // Trigger all the boot actions to get us started. am.QueueEventTrigger("init"); diff --git a/init/init.h b/init/init.h index 198ec2a54..6ada6ab1a 100644 --- a/init/init.h +++ b/init/init.h @@ -34,7 +34,6 @@ namespace init { // Note: These globals are *only* valid in init, so they should not be used in ueventd // or any files that may be included in ueventd, such as devices.cpp and util.cpp. // TODO: Have an Init class and remove all globals. -extern std::string default_console; extern std::vector late_import_paths; Parser CreateParser(ActionManager& action_manager, ServiceList& service_list); diff --git a/init/service.cpp b/init/service.cpp index 4cd18891d..cd08f3d1d 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -40,7 +40,6 @@ #if defined(__ANDROID__) #include -#include "init.h" #include "mount_namespace.h" #include "property_service.h" #else @@ -359,7 +358,7 @@ Result Service::Start() { bool needs_console = (flags_ & SVC_CONSOLE); if (needs_console) { if (proc_attr_.console.empty()) { - proc_attr_.console = default_console; + proc_attr_.console = "/dev/" + GetProperty("ro.boot.console", "console"); } // Make sure that open call succeeds to ensure a console driver is