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