Loading init/Android.bp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_defaults { ], ], shared_libs: [ shared_libs: [ "libbase", "libbase", "libbinder", "libbootloader_message", "libbootloader_message", "libcutils", "libcutils", "libdl", "libdl", Loading @@ -78,6 +79,7 @@ cc_defaults { "liblog", "liblog", "liblogwrap", "liblogwrap", "libselinux", "libselinux", "libutils", ], ], } } Loading Loading @@ -127,6 +129,13 @@ cc_library_static { type: "lite", type: "lite", export_proto_headers: true, export_proto_headers: true, }, }, target: { recovery: { cflags: ["-DRECOVERY"], exclude_shared_libs: ["libbinder", "libutils"], }, }, } } cc_binary { cc_binary { Loading @@ -143,6 +152,12 @@ cc_binary { ], ], srcs: ["main.cpp"], srcs: ["main.cpp"], symlinks: ["ueventd"], symlinks: ["ueventd"], target: { recovery: { cflags: ["-DRECOVERY"], exclude_shared_libs: ["libbinder", "libutils"], }, }, } } // Tests // Tests Loading init/init.cpp +23 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,10 @@ #include <keyutils.h> #include <keyutils.h> #include <libavb/libavb.h> #include <libavb/libavb.h> #ifndef RECOVERY #include <binder/ProcessState.h> #endif #include "action_parser.h" #include "action_parser.h" #include "epoll.h" #include "epoll.h" #include "first_stage_mount.h" #include "first_stage_mount.h" Loading Loading @@ -413,6 +417,22 @@ static Result<Success> queue_property_triggers_action(const BuiltinArguments& ar return Success(); return Success(); } } static Result<Success> InitBinder(const BuiltinArguments& args) { // init's use of binder is very limited. init cannot: // - have any binder threads // - receive incoming binder calls // - pass local binder services to remote processes // - use death recipients // The main supported usecases are: // - notifying other daemons (oneway calls only) // - retrieving data that is necessary to boot // Also, binder can't be used by recovery. #ifndef RECOVERY android::ProcessState::self()->setThreadPoolMaxThreadCount(0); #endif return Success(); } // Set the UDC controller for the ConfigFS USB Gadgets. // Set the UDC controller for the ConfigFS USB Gadgets. // Read the UDC controller in use from "/sys/class/udc". // Read the UDC controller in use from "/sys/class/udc". // In case of multiple UDC controllers select the first one. // In case of multiple UDC controllers select the first one. Loading Loading @@ -673,6 +693,9 @@ int main(int argc, char** argv) { // wasn't ready immediately after wait_for_coldboot_done // wasn't ready immediately after wait_for_coldboot_done am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng"); am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng"); // Initialize binder before bringing up other system services am.QueueBuiltinAction(InitBinder, "InitBinder"); // Don't mount filesystems or start core system services in charger mode. // Don't mount filesystems or start core system services in charger mode. std::string bootmode = GetProperty("ro.bootmode", ""); std::string bootmode = GetProperty("ro.bootmode", ""); if (bootmode == "charger") { if (bootmode == "charger") { Loading Loading
init/Android.bp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ cc_defaults { ], ], shared_libs: [ shared_libs: [ "libbase", "libbase", "libbinder", "libbootloader_message", "libbootloader_message", "libcutils", "libcutils", "libdl", "libdl", Loading @@ -78,6 +79,7 @@ cc_defaults { "liblog", "liblog", "liblogwrap", "liblogwrap", "libselinux", "libselinux", "libutils", ], ], } } Loading Loading @@ -127,6 +129,13 @@ cc_library_static { type: "lite", type: "lite", export_proto_headers: true, export_proto_headers: true, }, }, target: { recovery: { cflags: ["-DRECOVERY"], exclude_shared_libs: ["libbinder", "libutils"], }, }, } } cc_binary { cc_binary { Loading @@ -143,6 +152,12 @@ cc_binary { ], ], srcs: ["main.cpp"], srcs: ["main.cpp"], symlinks: ["ueventd"], symlinks: ["ueventd"], target: { recovery: { cflags: ["-DRECOVERY"], exclude_shared_libs: ["libbinder", "libutils"], }, }, } } // Tests // Tests Loading
init/init.cpp +23 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,10 @@ #include <keyutils.h> #include <keyutils.h> #include <libavb/libavb.h> #include <libavb/libavb.h> #ifndef RECOVERY #include <binder/ProcessState.h> #endif #include "action_parser.h" #include "action_parser.h" #include "epoll.h" #include "epoll.h" #include "first_stage_mount.h" #include "first_stage_mount.h" Loading Loading @@ -413,6 +417,22 @@ static Result<Success> queue_property_triggers_action(const BuiltinArguments& ar return Success(); return Success(); } } static Result<Success> InitBinder(const BuiltinArguments& args) { // init's use of binder is very limited. init cannot: // - have any binder threads // - receive incoming binder calls // - pass local binder services to remote processes // - use death recipients // The main supported usecases are: // - notifying other daemons (oneway calls only) // - retrieving data that is necessary to boot // Also, binder can't be used by recovery. #ifndef RECOVERY android::ProcessState::self()->setThreadPoolMaxThreadCount(0); #endif return Success(); } // Set the UDC controller for the ConfigFS USB Gadgets. // Set the UDC controller for the ConfigFS USB Gadgets. // Read the UDC controller in use from "/sys/class/udc". // Read the UDC controller in use from "/sys/class/udc". // In case of multiple UDC controllers select the first one. // In case of multiple UDC controllers select the first one. Loading Loading @@ -673,6 +693,9 @@ int main(int argc, char** argv) { // wasn't ready immediately after wait_for_coldboot_done // wasn't ready immediately after wait_for_coldboot_done am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng"); am.QueueBuiltinAction(MixHwrngIntoLinuxRngAction, "MixHwrngIntoLinuxRng"); // Initialize binder before bringing up other system services am.QueueBuiltinAction(InitBinder, "InitBinder"); // Don't mount filesystems or start core system services in charger mode. // Don't mount filesystems or start core system services in charger mode. std::string bootmode = GetProperty("ro.bootmode", ""); std::string bootmode = GetProperty("ro.bootmode", ""); if (bootmode == "charger") { if (bootmode == "charger") { Loading