Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization #558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
#include <linux/rodata_test.h>
#include <linux/jump_label.h>
#include <linux/mem_encrypt.h>

// asm files
#include <asm/io.h>
#include <asm/bugs.h>
#include <asm/setup.h>
Expand All @@ -116,7 +116,6 @@ extern void radix_tree_init(void);
* flag is set.
*/
bool early_boot_irqs_disabled __read_mostly;

enum system_states system_state __read_mostly;
EXPORT_SYMBOL(system_state);

Expand Down Expand Up @@ -224,6 +223,7 @@ static int __init quiet_kernel(char *str)
}

early_param("debug", debug_kernel);

early_param("quiet", quiet_kernel);

static int __init loglevel(char *str)
Expand Down Expand Up @@ -1091,11 +1091,10 @@ static int __ref kernel_init(void *unused)
panic("Requested init %s failed (error %d).",
execute_command, ret);
}
if (!try_to_run_init_process("/sbin/init") ||
!try_to_run_init_process("/etc/init") ||
!try_to_run_init_process("/bin/init") ||
!try_to_run_init_process("/bin/sh"))
if (!try_to_run_init_process("/sbin/init") || !try_to_run_init_process("/etc/init") || !try_to_run_init_process("/bin/init") || !try_to_run_init_process("/bin/sh"))
{
return 0;
}

panic("No working init found. Try passing init= option to kernel. "
"See Linux Documentation/admin-guide/init.rst for guidance.");
Expand Down Expand Up @@ -1146,10 +1145,12 @@ static noinline void __init kernel_init_freeable(void)
*/

if (!ramdisk_execute_command)
{
ramdisk_execute_command = "/init";

if (ksys_access((const char __user *)
ramdisk_execute_command, 0) != 0) {
}

if (ksys_access((const char __user *)ramdisk_execute_command, 0) != 0)
{
ramdisk_execute_command = NULL;
prepare_namespace();
}
Expand All @@ -1162,7 +1163,6 @@ static noinline void __init kernel_init_freeable(void)
* rootfs is available now, try loading the public keys
* and default modules
*/

integrity_load_keys();
load_default_modules();
}