aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig6
-rw-r--r--init/calibrate.c2
-rw-r--r--init/main.c88
-rw-r--r--init/version.c1
4 files changed, 56 insertions, 41 deletions
diff --git a/init/Kconfig b/init/Kconfig
index ad33c979e0b..f977086e118 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -125,6 +125,12 @@ config IPC_NS
environments, to use ipc namespaces to provide different ipc
objects for different servers. If unsure, say N.
+config SYSVIPC_SYSCTL
+ bool
+ depends on SYSVIPC
+ depends on SYSCTL
+ default y
+
config POSIX_MQUEUE
bool "POSIX Message Queues"
depends on NET && EXPERIMENTAL
diff --git a/init/calibrate.c b/init/calibrate.c
index d206c7548fe..40ff3b40489 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -4,7 +4,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
-#include <linux/sched.h>
+#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/init.h>
diff --git a/init/main.c b/init/main.c
index 4e9e92bb2b8..953500b02ac 100644
--- a/init/main.c
+++ b/init/main.c
@@ -40,6 +40,7 @@
#include <linux/cpu.h>
#include <linux/cpuset.h>
#include <linux/efi.h>
+#include <linux/tick.h>
#include <linux/taskstats_kern.h>
#include <linux/delayacct.h>
#include <linux/unistd.h>
@@ -86,7 +87,6 @@ extern void init_IRQ(void);
extern void fork_init(unsigned long);
extern void mca_init(void);
extern void sbus_init(void);
-extern void sysctl_init(void);
extern void signals_init(void);
extern void pidhash_init(void);
extern void pidmap_init(void);
@@ -516,6 +516,7 @@ asmlinkage void __init start_kernel(void)
* enable them
*/
lock_kernel();
+ tick_init();
boot_cpu_init();
page_address_init();
printk(KERN_NOTICE);
@@ -702,8 +703,8 @@ static void __init do_basic_setup(void)
usermodehelper_init();
driver_init();
-#ifdef CONFIG_SYSCTL
- sysctl_init();
+#ifdef CONFIG_PROC_FS
+ init_irq_proc();
#endif
do_initcalls();
@@ -727,7 +728,49 @@ static void run_init_process(char *init_filename)
kernel_execve(init_filename, argv_init, envp_init);
}
-static int init(void * unused)
+/* This is a non __init function. Force it to be noinline otherwise gcc
+ * makes it inline to init() and it becomes part of init.text section
+ */
+static int noinline init_post(void)
+{
+ free_initmem();
+ unlock_kernel();
+ mark_rodata_ro();
+ system_state = SYSTEM_RUNNING;
+ numa_default_policy();
+
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+
+ (void) sys_dup(0);
+ (void) sys_dup(0);
+
+ if (ramdisk_execute_command) {
+ run_init_process(ramdisk_execute_command);
+ printk(KERN_WARNING "Failed to execute %s\n",
+ ramdisk_execute_command);
+ }
+
+ /*
+ * We try each of these until one succeeds.
+ *
+ * The Bourne shell can be used instead of init if we are
+ * trying to recover a really broken machine.
+ */
+ if (execute_command) {
+ run_init_process(execute_command);
+ printk(KERN_WARNING "Failed to execute %s. Attempting "
+ "defaults...\n", execute_command);
+ }
+ run_init_process("/sbin/init");
+ run_init_process("/etc/init");
+ run_init_process("/bin/init");
+ run_init_process("/bin/sh");
+
+ panic("No init found. Try passing init= option to kernel.");
+}
+
+static int __init init(void * unused)
{
lock_kernel();
/*
@@ -775,39 +818,6 @@ static int init(void * unused)
* we're essentially up and running. Get rid of the
* initmem segments and start the user-mode stuff..
*/
- free_initmem();
- unlock_kernel();
- mark_rodata_ro();
- system_state = SYSTEM_RUNNING;
- numa_default_policy();
-
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
-
- (void) sys_dup(0);
- (void) sys_dup(0);
-
- if (ramdisk_execute_command) {
- run_init_process(ramdisk_execute_command);
- printk(KERN_WARNING "Failed to execute %s\n",
- ramdisk_execute_command);
- }
-
- /*
- * We try each of these until one succeeds.
- *
- * The Bourne shell can be used instead of init if we are
- * trying to recover a really broken machine.
- */
- if (execute_command) {
- run_init_process(execute_command);
- printk(KERN_WARNING "Failed to execute %s. Attempting "
- "defaults...\n", execute_command);
- }
- run_init_process("/sbin/init");
- run_init_process("/etc/init");
- run_init_process("/bin/init");
- run_init_process("/bin/sh");
-
- panic("No init found. Try passing init= option to kernel.");
+ init_post();
+ return 0;
}
diff --git a/init/version.c b/init/version.c
index 6c01ec1cc48..9d17d70ee02 100644
--- a/init/version.c
+++ b/init/version.c
@@ -12,7 +12,6 @@
#include <linux/utsname.h>
#include <linux/utsrelease.h>
#include <linux/version.h>
-#include <linux/sched.h>
#define version(a) Version_ ## a
#define version_string(a) version(a)