updated on Sun Jan 15 00:02:00 UTC 2012
[aur-mirror.git] / grub2-efi-ubuntu / ubuntu_quiet_grub_loading.patch
blobdf9837e845e922aae00a9124c12b12fce56d9202
1 Description: Suppress "GRUB loading" message unless Shift is held down
2 Upstream doesn't want this, as it makes debugging harder. Ubuntu wants it
3 to provide a cleaner boot experience.
4 Author: Colin Watson <cjwatson@ubuntu.com>
5 Forwarded: not-needed
6 Last-Update: 2011-01-05
8 Index: b/grub-core/boot/i386/pc/boot.S
9 ===================================================================
10 --- a/grub-core/boot/i386/pc/boot.S
11 +++ b/grub-core/boot/i386/pc/boot.S
12 @@ -19,6 +19,7 @@
14 #include <grub/symbol.h>
15 #include <grub/boot.h>
16 +#include <grub/machine/memory.h>
17 #include <grub/machine/boot.h>
20 @@ -151,9 +152,15 @@
21 /* save drive reference first thing! */
22 pushw %dx
24 + /* is either shift key held down? */
25 + movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx
26 + andb $3, (%bx)
27 + jz 2f
29 /* print a notification message on the screen */
30 MSG(notification_string)
32 +2:
33 /* set %si to the disk address packet */
34 movw $disk_address_packet, %si
36 Index: b/grub-core/boot/i386/pc/diskboot.S
37 ===================================================================
38 --- a/grub-core/boot/i386/pc/diskboot.S
39 +++ b/grub-core/boot/i386/pc/diskboot.S
40 @@ -17,6 +17,7 @@
43 #include <grub/symbol.h>
44 +#include <grub/machine/memory.h>
45 #include <grub/machine/boot.h>
48 @@ -24,6 +25,7 @@
51 #define MSG(x) movw $x, %si; call LOCAL(message)
52 +#define SILENT(x) call LOCAL(check_silent); jz LOCAL(x)
54 .file "diskboot.S"
56 @@ -50,11 +52,14 @@
57 /* save drive reference first thing! */
58 pushw %dx
60 + SILENT(after_notification_string)
62 /* print a notification message on the screen */
63 pushw %si
64 MSG(notification_string)
65 popw %si
67 +LOCAL(after_notification_string):
68 /* this sets up for the first run through "bootloop" */
69 movw $(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di
71 @@ -279,7 +284,10 @@
72 /* restore addressing regs and print a dot with correct DS
73 (MSG modifies SI, which is saved, and unused AX and BX) */
74 popw %ds
75 + SILENT(after_notification_step)
76 MSG(notification_step)
78 +LOCAL(after_notification_step):
79 popa
81 /* check if finished with this dataset */
82 @@ -295,8 +303,11 @@
83 /* END OF MAIN LOOP */
85 LOCAL(bootit):
86 + SILENT(after_notification_done)
87 /* print a newline */
88 MSG(notification_done)
90 +LOCAL(after_notification_done):
91 popw %dx /* this makes sure %dl is our "boot" drive */
92 ljmp $0, $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
94 @@ -320,6 +331,12 @@
95 /* go here when you need to stop the machine hard after an error condition */
96 LOCAL(stop): jmp LOCAL(stop)
98 +LOCAL(check_silent):
99 + /* is either shift key held down? */
100 + movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx
101 + andb $3, (%bx)
102 + ret
104 notification_string: .asciz "loading"
106 notification_step: .asciz "."