]>
Commit | Line | Data |
---|---|---|
4ff9093d MT |
1 | --- grub-0.93/stage2/builtins.c.bootterm 2002-12-29 02:01:50.000000000 -0500 |
2 | +++ grub-0.93/stage2/builtins.c 2002-12-29 02:01:07.000000000 -0500 | |
3 | @@ -233,12 +233,22 @@ | |
4 | static int | |
5 | boot_func (char *arg, int flags) | |
6 | { | |
7 | + struct term_entry *prev_term = current_term; | |
8 | /* Clear the int15 handler if we can boot the kernel successfully. | |
9 | This assumes that the boot code never fails only if KERNEL_TYPE is | |
10 | not KERNEL_TYPE_NONE. Is this assumption is bad? */ | |
11 | if (kernel_type != KERNEL_TYPE_NONE) | |
12 | unset_int15_handler (); | |
13 | ||
14 | + /* if our terminal needed initialization, we should shut it down | |
15 | + * before booting the kernel, but we want to save what it was so | |
16 | + * we can come back if needed */ | |
17 | + if (current_term->shutdown) | |
18 | + { | |
19 | + (*current_term->shutdown)(); | |
20 | + current_term = term_table; /* assumption: console is first */ | |
21 | + } | |
22 | + | |
23 | #ifdef SUPPORT_NETBOOT | |
24 | /* Shut down the networking. */ | |
25 | cleanup_net (); | |
26 | @@ -302,6 +312,13 @@ | |
27 | return 1; | |
28 | } | |
29 | ||
30 | + /* if we get back here, we should go back to what our term was before */ | |
31 | + current_term = prev_term; | |
32 | + if (current_term->startup) | |
33 | + /* if our terminal fails to initialize, fall back to console since | |
34 | + * it should always work */ | |
35 | + if ((*current_term->startup)() == 0) | |
36 | + current_term = term_table; /* we know that console is first */ | |
37 | return 0; | |
38 | } | |
39 |