main.c (10205618052908770451acd33eaeaa7685e97ed2) main.c (a91bd6223ecd46addc71ee6fcd432206d39365d2)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/init/main.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 *
7 * GK 2/5/95 - Changed to support mounting root fs via NFS
8 * Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96

--- 1466 unchanged lines hidden (view full) ---

1475}
1476
1477/* Open /dev/console, for stdin/stdout/stderr, this should never fail */
1478void __init console_on_rootfs(void)
1479{
1480 struct file *file = filp_open("/dev/console", O_RDWR, 0);
1481
1482 if (IS_ERR(file)) {
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/init/main.c
4 *
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 *
7 * GK 2/5/95 - Changed to support mounting root fs via NFS
8 * Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96

--- 1466 unchanged lines hidden (view full) ---

1475}
1476
1477/* Open /dev/console, for stdin/stdout/stderr, this should never fail */
1478void __init console_on_rootfs(void)
1479{
1480 struct file *file = filp_open("/dev/console", O_RDWR, 0);
1481
1482 if (IS_ERR(file)) {
1483 pr_err("Warning: unable to open an initial console. Fallback to ttynull.\n");
1484 register_ttynull_console();
1485
1486 file = filp_open("/dev/console", O_RDWR, 0);
1487 if (IS_ERR(file)) {
1488 pr_err("Warning: Failed to add ttynull console. No stdin, stdout, and stderr for the init process!\n");
1489 return;
1490 }
1483 pr_err("Warning: unable to open an initial console.\n");
1484 return;
1491 }
1492 init_dup(file);
1493 init_dup(file);
1494 init_dup(file);
1495 fput(file);
1496}
1497
1498static noinline void __init kernel_init_freeable(void)

--- 14 unchanged lines hidden (view full) ---

1513 cad_pid = task_pid(current);
1514
1515 smp_prepare_cpus(setup_max_cpus);
1516
1517 workqueue_init();
1518
1519 init_mm_internals();
1520
1485 }
1486 init_dup(file);
1487 init_dup(file);
1488 init_dup(file);
1489 fput(file);
1490}
1491
1492static noinline void __init kernel_init_freeable(void)

--- 14 unchanged lines hidden (view full) ---

1507 cad_pid = task_pid(current);
1508
1509 smp_prepare_cpus(setup_max_cpus);
1510
1511 workqueue_init();
1512
1513 init_mm_internals();
1514
1515 rcu_init_tasks_generic();
1521 do_pre_smp_initcalls();
1522 lockup_detector_init();
1523
1524 smp_init();
1525 sched_init_smp();
1526
1527 padata_init();
1528 page_alloc_init_late();

--- 29 unchanged lines hidden ---
1516 do_pre_smp_initcalls();
1517 lockup_detector_init();
1518
1519 smp_init();
1520 sched_init_smp();
1521
1522 padata_init();
1523 page_alloc_init_late();

--- 29 unchanged lines hidden ---