From 1a42ef98c49b37466316be831712994e45e5b9f9 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 14 Mar 2011 16:25:23 +0000 Subject: [PATCH] Fix loading GRUB from lnxboot (LP: #693671). --- debian/changelog | 1 + debian/patches/lnxboot_grub.patch | 39 +++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 41 insertions(+) create mode 100644 debian/patches/lnxboot_grub.patch diff --git a/debian/changelog b/debian/changelog index a1e118751..ab0c1297a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ grub2 (1.99~rc1-4) UNRELEASED; urgency=low - Only call ntfs_fix_mmft if the attribute to find is AT_DATA. This matches GRUB's NTFS module. - Install grubinst as grub-ntldr-img. + * Fix loading GRUB from lnxboot (LP: #693671). -- Colin Watson Thu, 24 Feb 2011 13:20:01 +0000 diff --git a/debian/patches/lnxboot_grub.patch b/debian/patches/lnxboot_grub.patch new file mode 100644 index 000000000..f1e74f428 --- /dev/null +++ b/debian/patches/lnxboot_grub.patch @@ -0,0 +1,39 @@ +Description: Fix loading GRUB from lnxboot + Ensure that the initial chunk read from the kernel always includes GRUB's + multiboot header, which is now outside the first sector. +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/693671 +Forwarded: yes +Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3096 +Last-Update: 2011-03-11 + +Index: b/grub-core/boot/i386/pc/lnxboot.S +=================================================================== +--- a/grub-core/boot/i386/pc/lnxboot.S ++++ b/grub-core/boot/i386/pc/lnxboot.S +@@ -178,8 +178,13 @@ + pushw %es + popw %ds + ++#if GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART + 4 < 0x200 + movl $0x200, %ecx + addl %ecx, %esi ++#else ++ movl $(GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART + 4), %ecx ++ addl $0x200, %esi ++#endif + movl $DATA_ADDR, %edi + + call LOCAL(move_memory) +@@ -196,7 +201,11 @@ + 1: + + movl %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE), %ecx ++#if GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART + 4 < 0x200 + addl $(GRUB_KERNEL_MACHINE_RAW_SIZE - 0x200), %ecx ++#else ++ addl $(GRUB_KERNEL_MACHINE_RAW_SIZE - (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART + 4)), %ecx ++#endif + + 2: + call LOCAL(move_memory) diff --git a/debian/patches/series b/debian/patches/series index 58892af46..ff7daab48 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -17,3 +17,4 @@ branch_longlinuxcmd.patch branch_parse-color.patch branch_embed-sectors.patch btrfs_rootflags.patch +lnxboot_grub.patch