init: remove the restriction of arguments

X86 Kernel could pass CPU capablity to init as argument. This will cause init
can't start first-stage because unknown argument. Need remove this restriction
of arguments to start init successfully.

Fixes: 122435289
Test: Android init can start successfully

Change-Id: I1d432e25553589dd7f618e42ad238b9372dbe34f
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
Signed-off-by: Xihua Chen <xihua.chen@intel.com>
This commit is contained in:
Haoyu Tang 2019-01-05 09:31:28 +08:00 committed by Xihua Chen
parent c2aad281fc
commit f32bc7cd29

View file

@ -57,27 +57,22 @@ int main(int argc, char** argv) {
return ueventd_main(argc, argv);
}
if (argc < 2) {
return FirstStageMain(argc, argv);
if (argc > 1) {
if (!strcmp(argv[1], "subcontext")) {
android::base::InitLogging(argv, &android::base::KernelLogger);
const BuiltinFunctionMap function_map;
return SubcontextMain(argc, argv, &function_map);
}
if (!strcmp(argv[1], "selinux_setup")) {
return SetupSelinux(argv);
}
if (!strcmp(argv[1], "second_stage")) {
return SecondStageMain(argc, argv);
}
}
if (!strcmp(argv[1], "subcontext")) {
android::base::InitLogging(argv, &android::base::KernelLogger);
const BuiltinFunctionMap function_map;
return SubcontextMain(argc, argv, &function_map);
}
if (!strcmp(argv[1], "selinux_setup")) {
return SetupSelinux(argv);
}
if (!strcmp(argv[1], "second_stage")) {
return SecondStageMain(argc, argv);
}
android::base::InitLogging(argv, &android::base::KernelLogger);
LOG(ERROR) << "Unknown argument passed to init '" << argv[1] << "'";
return 1;
return FirstStageMain(argc, argv);
}