On Wed, Jun 4, 2008 at 7:27 PM, Isaac Dupree <[EMAIL PROTECTED]> wrote: > Bean wrote: >> >> On Wed, Jun 4, 2008 at 7:01 PM, Isaac Dupree >> <[EMAIL PROTECTED]> wrote: >>> >>> how do you apply this patch? With `patch -p1` I'm getting: >>> 2 out of 4 hunks FAILED -- saving rejects to file >>> loader/i386/efi/linux.c.rej >>> >>> any more infos needed? >> >> There maybe some code mixups, try this one: > > nope, against latest CVS: > >> patch -p1 <../grubinitrd2.patch > patching file loader/i386/efi/linux.c > Hunk #1 FAILED at 601. > Hunk #2 FAILED at 612. > 2 out of 4 hunks FAILED -- saving rejects to file > loader/i386/efi/linux.c.rej
Use -l option in patch to ignore space. If it still not work, you can make the changes manually, it's quite simple: 1) lh = (struct linux_kernel_header *) real_mode_mem; - addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; change the line to addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); 2) addr_max -= 0x10000; /* Usually, the compression ratio is about 50%. */ - addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12); /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); change the line to addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + page_align (size); 3) desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY - && desc->physical_start >= addr_min - && desc->physical_start + size < addr_max && desc->num_pages >= initrd_pages) { grub_efi_physical_address_t physical_end; Remove two lines. 4) if (physical_end > addr_max) physical_end = addr_max; + if (physical_end < addr_min) + continue; + if (physical_end > addr) addr = physical_end - page_align (size); } Add three lines -- Bean _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel