Skip to contentSkip to conversation

Bug fix for EFI

PATCH In review Bean 1 participant 2 messages Aug 21, 2008 – Aug 23, 2008

lore
Share & tools
lore

Bean

author
#0 lore raw

PATCH 1/1 Bug fix for EFI

Hi,

This patch fix two bugs in the EFI port:

1, grub_longjmp (x86_64 EFI):

Return 1 when val = 0. This behavior is consistent with grub_longjmp of i386 platform.

2, genfslist.sh and genpartmaplist.sh

In EFI, the kernel is in a module kernel.mod. genfslist.sh scans the source for grub_fs_register, so kernel.mod would be included in fs.lst and partmap.lst, which cause serious problem when grub try to load extra file system modules. This patch simply ignore kernel.mod in genfslist.sh and genpartmaplist.sh.

2008-08-22 Bean <[email protected]>

* normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0.

* genfslist.sh: Ignore kernel.mod.

* genpartmaplist.sh: Likewise.

Signature · 1 line
Bean
genfslist.sh +5 -0
index b54f0ff..ec48e86 100644
@@ -15,6 +15,11 @@
 
 module=$1
 
+# Ignore kernel.mod.
+if test $module = kernel; then
+    exit
+fi
+
 # For now, this emits only a module name, if the module registers a filesystem.
 if grep -v "^#" | grep '^ *grub_fs_register' >/dev/null 2>&1; then
     echo $module
genpartmaplist.sh +5 -0
index ba65049..fceb0f8 100644
@@ -15,6 +15,11 @@
 
 module=$1
 
+# Ignore kernel.mod.
+if test $module = kernel; then
+    exit
+fi
+
 # For now, this emits only a module name, if the module registers a partition map.
 if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then
     echo $module
normal/x86_64/setjmp.S +5 -0
index 4c8d4b3..621b09b 100644
@@ -50,6 +50,11 @@ FUNCTION(grub_setjmp)
  */
 FUNCTION(grub_longjmp)
 	movl	%esi, %eax
+	orl	%eax, %eax
+	jnz	1f
+	incl	%eax
+1:
+
 	movq	(%rdi), %rbx
 	movq	8(%rdi), %rsp
 	movq	16(%rdi), %rbp
author
#1 lore raw
Quoted 17 lines · Bean

Hi,

This patch fix two bugs in the EFI port:

1, grub_longjmp (x86_64 EFI):

Return 1 when val = 0. This behavior is consistent with grub_longjmp of i386 platform.

2, genfslist.sh and genpartmaplist.sh

In EFI, the kernel is in a module kernel.mod. genfslist.sh scans the source for grub_fs_register, so kernel.mod would be included in fs.lst and partmap.lst, which cause serious problem when grub try to load extra file system modules. This patch simply ignore kernel.mod in genfslist.sh and genpartmaplist.sh.

Quoted 7 lines

2008-08-22 Bean <[email protected]>

* normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0.

* genfslist.sh: Ignore kernel.mod.

* genpartmaplist.sh: Likewise.

Committed.

Signature · 1 line
Bean