Commit d7ffac33 authored by Thomas Meyer's avatar Thomas Meyer Committed by Richard Weinberger

um: stdio_console: Make preferred console

The addition of the "ttynull" console driver did break the ordering of the
UML stdio console driver.
The UML stdio console driver is added in late_initcall (7), whereby the
ttynull driver is added in device_initcall (6), which always does make the
ttynull driver the default console.

Fix it by explicitly adding the UML stdio console as the preferred console,
in case no 'console=' command line option was specified.
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 1cdcfb44
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
#include <mem_user.h> #include <mem_user.h>
#include <os.h> #include <os.h>
#define DEFAULT_COMMAND_LINE "root=98:0" #define DEFAULT_COMMAND_LINE_ROOT "root=98:0"
#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty"
/* Changed in add_arg and setup_arch, which run before SMP is started */ /* Changed in add_arg and setup_arch, which run before SMP is started */
static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 }; static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 };
...@@ -109,7 +110,8 @@ unsigned long end_vm; ...@@ -109,7 +110,8 @@ unsigned long end_vm;
int ncpus = 1; int ncpus = 1;
/* Set in early boot */ /* Set in early boot */
static int have_root __initdata = 0; static int have_root __initdata;
static int have_console __initdata;
/* Set in uml_mem_setup and modified in linux_main */ /* Set in uml_mem_setup and modified in linux_main */
long long physmem_size = 32 * 1024 * 1024; long long physmem_size = 32 * 1024 * 1024;
...@@ -161,6 +163,17 @@ __uml_setup("debug", no_skas_debug_setup, ...@@ -161,6 +163,17 @@ __uml_setup("debug", no_skas_debug_setup,
" this flag is not needed to run gdb on UML in skas mode\n\n" " this flag is not needed to run gdb on UML in skas mode\n\n"
); );
static int __init uml_console_setup(char *line, int *add)
{
have_console = 1;
return 0;
}
__uml_setup("console=", uml_console_setup,
"console=<preferred console>\n"
" Specify the preferred console output driver\n\n"
);
static int __init Usage(char *line, int *add) static int __init Usage(char *line, int *add)
{ {
const char **p; const char **p;
...@@ -264,7 +277,10 @@ int __init linux_main(int argc, char **argv) ...@@ -264,7 +277,10 @@ int __init linux_main(int argc, char **argv)
add_arg(argv[i]); add_arg(argv[i]);
} }
if (have_root == 0) if (have_root == 0)
add_arg(DEFAULT_COMMAND_LINE); add_arg(DEFAULT_COMMAND_LINE_ROOT);
if (have_console == 0)
add_arg(DEFAULT_COMMAND_LINE_CONSOLE);
host_task_size = os_get_top_address(); host_task_size = os_get_top_address();
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment