vserver 2.0 rc7
[linux-2.6.git] / init / main.c
index 6849397..40bf367 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/kallsyms.h>
 #include <linux/writeback.h>
 #include <linux/cpu.h>
+#include <linux/cpuset.h>
 #include <linux/efi.h>
 #include <linux/unistd.h>
 #include <linux/rmap.h>
@@ -109,8 +110,8 @@ EXPORT_SYMBOL(system_state);
 /*
  * Boot command-line arguments
  */
-#define MAX_INIT_ARGS 32
-#define MAX_INIT_ENVS 32
+#define MAX_INIT_ARGS CONFIG_INIT_ENV_ARG_LIMIT
+#define MAX_INIT_ENVS CONFIG_INIT_ENV_ARG_LIMIT
 
 extern void time_init(void);
 /* Default late time init is NULL. archs can override this later. */
@@ -209,6 +210,14 @@ static int __init quiet_kernel(char *str)
 __setup("debug", debug_kernel);
 __setup("quiet", quiet_kernel);
 
+static int __init loglevel(char *str)
+{
+       get_option(&str, &console_loglevel);
+       return 1;
+}
+
+__setup("loglevel=", loglevel);
+
 /*
  * Unknown boot options get handed to init, unless they look like
  * failed parameters
@@ -347,12 +356,11 @@ static void __init smp_init(void)
        }
 
        /* Any cleanup work */
-       printk("Brought up %ld CPUs\n", (long)num_online_cpus());
+       printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
        smp_cpus_done(max_cpus);
 #if 0
        /* Get other processors into their bootup holding patterns. */
 
-       smp_threads_ready=1;
        smp_commence();
 #endif
 }
@@ -423,6 +431,7 @@ asmlinkage void __init start_kernel(void)
  */
        lock_kernel();
        page_address_init();
+       printk(KERN_NOTICE);
        printk(linux_banner);
        setup_arch(&command_line);
        setup_per_cpu_areas();
@@ -446,7 +455,7 @@ asmlinkage void __init start_kernel(void)
        preempt_disable();
        build_all_zonelists();
        page_alloc_init();
-       printk("Kernel command line: %s\n", saved_command_line);
+       printk(KERN_NOTICE "Kernel command line: %s\n", saved_command_line);
        parse_early_param();
        parse_args("Booting kernel", command_line, __start___param,
                   __stop___param - __start___param,
@@ -497,6 +506,7 @@ asmlinkage void __init start_kernel(void)
        proc_caches_init();
        buffer_init();
        unnamed_dev_init();
+       key_init();
        security_init();
        vfs_caches_init(num_physpages);
        radix_tree_init();
@@ -506,6 +516,8 @@ asmlinkage void __init start_kernel(void)
 #ifdef CONFIG_PROC_FS
        proc_root_init();
 #endif
+       cpuset_init();
+
        check_bugs();
 
        acpi_early_init(); /* before LAPIC and SMP init */
@@ -553,7 +565,7 @@ static void __init do_initcalls(void)
                        local_irq_enable();
                }
                if (msg) {
-                       printk("error in initcall at 0x%p: "
+                       printk(KERN_WARNING "error in initcall at 0x%p: "
                                "returned with %s\n", *call, msg);
                }
        }
@@ -574,7 +586,6 @@ static void __init do_basic_setup(void)
        /* drivers will send hotplug events */
        init_workqueues();
        usermodehelper_init();
-       key_init();
        driver_init();
 
 #ifdef CONFIG_SYSCTL
@@ -625,6 +636,10 @@ static inline void fixup_cpu_present_map(void)
 static int init(void * unused)
 {
        lock_kernel();
+       /*
+        * init can run on any cpu.
+        */
+       set_cpus_allowed(current, CPU_MASK_ALL);
        /*
         * Tell the world that we're going to be the grim
         * reaper of innocent orphaned children.
@@ -644,6 +659,8 @@ static int init(void * unused)
        smp_init();
        sched_init_smp();
 
+       cpuset_init_smp();
+
        /*
         * Do this before initcalls, because some drivers want to access
         * firmware files.
@@ -672,7 +689,7 @@ static int init(void * unused)
        numa_default_policy();
 
        if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
-               printk("Warning: unable to open an initial console.\n");
+               printk(KERN_WARNING "Warning: unable to open an initial console.\n");
 
        (void) sys_dup(0);
        (void) sys_dup(0);