]>
Commit | Line | Data |
---|---|---|
73276c91 HS |
1 | --- grub-0.96/stage2/builtins.c.orig 2004-06-20 15:33:04.000000000 +0200 |
2 | +++ grub-0.96/stage2/builtins.c 2005-09-02 14:38:53.000000000 +0200 | |
3 | @@ -762,11 +762,11 @@ | |
4 | default_func (char *arg, int flags) | |
5 | { | |
6 | #ifndef SUPPORT_DISKLESS | |
7 | - if (grub_strcmp (arg, "saved") == 0) | |
8 | + if (grub_strcmp (arg, "saved") == 0 || (saved_entryno & 0x4000)) | |
9 | { | |
10 | - default_entry = saved_entryno; | |
11 | - return 0; | |
12 | + default_entry = saved_entryno & 0x3fff; | |
13 | } | |
14 | + else | |
15 | #endif /* SUPPORT_DISKLESS */ | |
16 | ||
17 | if (! safe_parse_maxint (&arg, &default_entry)) | |
18 | @@ -787,6 +787,22 @@ | |
19 | #endif | |
20 | }; | |
21 | ||
22 | +#ifndef SUPPORT_DISKLESS | |
23 | +static int savedefault_func (char *arg, int flags); | |
24 | +void __savedefault_once_reset() | |
25 | +{ | |
26 | + if (saved_entryno & 0x4000) | |
27 | + { | |
28 | + int saved_current_entryno = current_entryno; | |
29 | + grub_timeout = 0; | |
30 | + current_entryno = default_entry; | |
31 | + savedefault_func("\0", BUILTIN_SCRIPT); | |
32 | + current_entryno = saved_current_entryno; | |
33 | + saved_entryno &= 0x3fff; | |
34 | + } | |
35 | +} | |
36 | +#endif /* SUPPORT_DISKLESS */ | |
37 | + | |
38 | \f | |
39 | #ifdef GRUB_UTIL | |
40 | /* device */ | |
41 | --- grub-0.96/stage2/stage2.c~ 2004-07-24 20:53:47.000000000 +0200 | |
42 | +++ grub-0.96/stage2/stage2.c 2005-09-02 14:45:04.000000000 +0200 | |
43 | @@ -827,6 +827,7 @@ | |
44 | return pos; | |
45 | } | |
46 | ||
47 | +extern void __savedefault_once_reset(); | |
48 | ||
49 | /* This is the starting function in C. */ | |
50 | void | |
51 | @@ -1048,7 +1049,9 @@ | |
52 | } | |
53 | while (is_preset); | |
54 | } | |
55 | - | |
56 | +#ifndef SUPPORT_DISKLESS | |
57 | + __savedefault_once_reset(); | |
58 | +#endif | |
59 | if (! num_entries) | |
60 | { | |
61 | /* If no acceptable config file, goto command-line, starting |