-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path0001-grub-alias-linux16.patch
65 lines (59 loc) · 2.24 KB
/
0001-grub-alias-linux16.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Alias 'linux16' to 'linux' and 'initrd16' to 'initrd' in case of Xen platform.
This makes it possible to use unmodified grub2-mkconfig in domU to generate
grub.cfg.
Index: grub-2.02~beta2/grub-core/loader/i386/xen.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/loader/i386/xen.c
+++ grub-2.02~beta2/grub-core/loader/i386/xen.c
@@ -689,6 +689,7 @@ fail:
}
static grub_command_t cmd_xen, cmd_initrd, cmd_module, cmd_multiboot;
+static grub_command_t cmd_xen16, cmd_initrd16;
GRUB_MOD_INIT (xen)
{
@@ -700,6 +701,10 @@ GRUB_MOD_INIT (xen)
0, N_("Load initrd."));
cmd_module = grub_register_command ("module", grub_cmd_module,
0, N_("Load module."));
+ cmd_xen16 = grub_register_command ("linux16", grub_cmd_xen,
+ 0, N_("Load Linux."));
+ cmd_initrd16 = grub_register_command ("initrd16", grub_cmd_initrd,
+ 0, N_("Load initrd."));
my_mod = mod;
}
@@ -709,4 +714,6 @@ GRUB_MOD_FINI (xen)
grub_unregister_command (cmd_initrd);
grub_unregister_command (cmd_multiboot);
grub_unregister_command (cmd_module);
+ grub_unregister_command (cmd_xen16);
+ grub_unregister_command (cmd_initrd16);
}
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index b601591..8926f94 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -1104,6 +1104,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
#ifndef GRUB_MACHINE_EFI
static grub_command_t cmd_linux, cmd_initrd;
+static grub_command_t cmd_linux16, cmd_initrd16;
GRUB_MOD_INIT(linux)
{
@@ -1111,13 +1112,19 @@ GRUB_MOD_INIT(linux)
0, N_("Load Linux."));
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
0, N_("Load initrd."));
+ cmd_linux16 = grub_register_command ("linux16", grub_cmd_linux,
+ 0, N_("Load Linux."));
+ cmd_initrd16 = grub_register_command ("initrd16", grub_cmd_initrd,
+ 0, N_("Load initrd."));
my_mod = mod;
}
GRUB_MOD_FINI(linux)
{
grub_unregister_command (cmd_linux);
grub_unregister_command (cmd_initrd);
+ grub_unregister_command (cmd_linux16);
+ grub_unregister_command (cmd_initrd16);
}
#else
extern grub_err_t __attribute__((alias("grub_cmd_linux")))