Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / init / main.c
index d35c4a8..5c9a48d 100644 (file)
@@ -153,10 +153,10 @@ static char *extra_init_args;
 #ifdef CONFIG_BOOT_CONFIG
 /* Is bootconfig on command line? */
 static bool bootconfig_found;
-static bool initargs_found;
+static size_t initargs_offs;
 #else
 # define bootconfig_found false
-# define initargs_found false
+# define initargs_offs 0
 #endif
 
 static char *execute_command;
@@ -422,9 +422,9 @@ static void __init setup_boot_config(void)
        if (IS_ERR(err) || !bootconfig_found)
                return;
 
-       /* parse_args() stops at '--' and returns an address */
+       /* parse_args() stops at the next param of '--' and returns an address */
        if (err)
-               initargs_found = true;
+               initargs_offs = err - tmp_cmdline;
 
        if (!data) {
                pr_err("'bootconfig' found on command line, but no bootconfig found\n");
@@ -655,16 +655,21 @@ static void __init setup_command_line(char *command_line)
                 * Append supplemental init boot args to saved_command_line
                 * so that user can check what command line options passed
                 * to init.
+                * The order should always be
+                * " -- "[bootconfig init-param][cmdline init-param]
                 */
-               len = strlen(saved_command_line);
-               if (initargs_found) {
-                       saved_command_line[len++] = ' ';
+               if (initargs_offs) {
+                       len = xlen + initargs_offs;
+                       strcpy(saved_command_line + len, extra_init_args);
+                       len += ilen - 4;        /* strlen(extra_init_args) */
+                       strcpy(saved_command_line + len,
+                               boot_command_line + initargs_offs - 1);
                } else {
+                       len = strlen(saved_command_line);
                        strcpy(saved_command_line + len, " -- ");
                        len += 4;
+                       strcpy(saved_command_line + len, extra_init_args);
                }
-
-               strcpy(saved_command_line + len, extra_init_args);
        }
 }
 
@@ -786,6 +791,8 @@ void __init __weak poking_init(void) { }
 
 void __init __weak pgtable_cache_init(void) { }
 
+void __init __weak trap_init(void) { }
+
 bool initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
 
@@ -1235,7 +1242,7 @@ trace_initcall_start_cb(void *data, initcall_t fn)
 {
        ktime_t *calltime = (ktime_t *)data;
 
-       printk(KERN_DEBUG "calling  %pS @ %i\n", fn, task_pid_nr(current));
+       printk(KERN_DEBUG "calling  %pS @ %i irqs_disabled() %d\n", fn, task_pid_nr(current), irqs_disabled());
        *calltime = ktime_get();
 }
 
@@ -1249,8 +1256,8 @@ trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
        rettime = ktime_get();
        delta = ktime_sub(rettime, *calltime);
        duration = (unsigned long long) ktime_to_ns(delta) >> 10;
-       printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
-                fn, ret, duration);
+       printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs, irqs_disabled() %d\n",
+                fn, ret, duration, irqs_disabled());
 }
 
 static ktime_t initcall_calltime;
@@ -1401,7 +1408,6 @@ static void __init do_basic_setup(void)
        driver_init();
        init_irq_proc();
        do_ctors();
-       usermodehelper_enable();
        do_initcalls();
 }