parent
23f8829780
commit
1c281a330d
|
|
@ -493,8 +493,9 @@ static void enable_wlan_clock(void)
|
|||
|
||||
void set_console(void)
|
||||
{
|
||||
char buf[8];
|
||||
char *defaultconsole = getenv("defaultconsole");
|
||||
char buf[20];
|
||||
int i;
|
||||
int shield_id = bd_get_shield(0);
|
||||
|
||||
if (defaultconsole == 0) {
|
||||
|
|
@ -511,15 +512,18 @@ void set_console(void)
|
|||
/* With comio shield the defaultconsole should be ttyS0 and not ttyS1 */
|
||||
setenv("defaultconsole", "ttyS0");
|
||||
|
||||
/* If consoldev is set take this as productive conosle instead of default console */
|
||||
if (read_file("/root/boot/consoledev", buf, 5) != 5) {
|
||||
puts("Invalid file consoledev\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strstr(buf, "tty")==buf) {
|
||||
buf[5] = 0;
|
||||
setenv("defaultconsole", buf);
|
||||
/* If consoledev file is present, take the tty defined in it as console */
|
||||
if (read_file("/root/boot/consoledev",buf, sizeof(buf)) > 3) {
|
||||
if (strstr(buf, "tty") == buf) {
|
||||
buf[sizeof(buf)-1] = 0;
|
||||
for (i=0; i<sizeof(buf); i++) {
|
||||
if (buf[i]<=' ') {
|
||||
buf[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
setenv("defaultconsole", buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue