diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -45,18 +45,18 @@ | |||
45 | //#define DEBUG_INIT | 45 | //#define DEBUG_INIT |
46 | 46 | ||
47 | #define CONSOLE "/dev/console" /* Logical system console */ | 47 | #define CONSOLE "/dev/console" /* Logical system console */ |
48 | #define VT_PRIMARY "/dev/tty0" /* Primary virtual console */ | 48 | #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ |
49 | #define VT_SECONDARY "/dev/tty1" /* Virtual console */ | 49 | #define VT_SECONDARY "/dev/tty2" /* Virtual console */ |
50 | #define VT_LOG "/dev/tty2" /* Virtual console */ | 50 | #define VT_LOG "/dev/tty3" /* Virtual console */ |
51 | #define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ | 51 | #define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ |
52 | #define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ | 52 | #define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ |
53 | #define SHELL "/bin/sh" /* Default shell */ | 53 | #define SHELL "/bin/sh" /* Default shell */ |
54 | #define INITSCRIPT "/etc/init.d/rcS" /* Initscript. */ | 54 | #define INITSCRIPT "/etc/init.d/rcS" /* Initscript. */ |
55 | #define PATH_DEFAULT "PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin" | 55 | #define PATH_DEFAULT "PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin" |
56 | 56 | ||
57 | static char *console = VT_PRIMARY; | 57 | static char *console = CONSOLE; |
58 | static char *second_terminal = VT_SECONDARY; | 58 | static char *second_console = VT_SECONDARY; |
59 | static char *log = "/dev/tty3"; | 59 | static char *log = VT_LOG; |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
@@ -173,23 +173,23 @@ static void console_init() | |||
173 | } | 173 | } |
174 | #endif | 174 | #endif |
175 | } else { | 175 | } else { |
176 | console = VT_PRIMARY; | 176 | console = CONSOLE; |
177 | tried_vtprimary++; | 177 | tried_devcons++; |
178 | } | 178 | } |
179 | 179 | ||
180 | while ((fd = open(console, O_RDONLY | O_NONBLOCK)) < 0) { | 180 | while ((fd = open(console, O_RDONLY | O_NONBLOCK)) < 0) { |
181 | /* Can't open selected console -- try vt1 */ | ||
182 | if (!tried_vtprimary) { | ||
183 | tried_vtprimary++; | ||
184 | console = VT_PRIMARY; | ||
185 | continue; | ||
186 | } | ||
187 | /* Can't open selected console -- try /dev/console */ | 181 | /* Can't open selected console -- try /dev/console */ |
188 | if (!tried_devcons) { | 182 | if (!tried_devcons) { |
189 | tried_devcons++; | 183 | tried_devcons++; |
190 | console = CONSOLE; | 184 | console = CONSOLE; |
191 | continue; | 185 | continue; |
192 | } | 186 | } |
187 | /* Can't open selected console -- try vt1 */ | ||
188 | if (!tried_vtprimary) { | ||
189 | tried_vtprimary++; | ||
190 | console = VT_PRIMARY; | ||
191 | continue; | ||
192 | } | ||
193 | break; | 193 | break; |
194 | } | 194 | } |
195 | if (fd < 0) | 195 | if (fd < 0) |
@@ -449,7 +449,7 @@ extern int init_main(int argc, char **argv) | |||
449 | pid1 = run(tty0_commands, console, wait_for_enter); | 449 | pid1 = run(tty0_commands, console, wait_for_enter); |
450 | } | 450 | } |
451 | if (pid2 == 0 && tty1_commands) { | 451 | if (pid2 == 0 && tty1_commands) { |
452 | pid2 = run(tty1_commands, second_terminal, TRUE); | 452 | pid2 = run(tty1_commands, second_console, TRUE); |
453 | } | 453 | } |
454 | wpid = wait(&status); | 454 | wpid = wait(&status); |
455 | if (wpid > 0 ) { | 455 | if (wpid > 0 ) { |