Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K3rHU-0000a2-V7 for mharc-grub-devel@gnu.org; Wed, 04 Jun 2008 07:35:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3rHT-0000Zv-EG for grub-devel@gnu.org; Wed, 04 Jun 2008 07:35:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3rHS-0000ZW-SO for grub-devel@gnu.org; Wed, 04 Jun 2008 07:35:50 -0400 Received: from [199.232.76.173] (port=41087 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3rHS-0000ZT-MT for grub-devel@gnu.org; Wed, 04 Jun 2008 07:35:50 -0400 Received: from rv-out-0708.google.com ([209.85.198.247]:56328) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3rHS-0007Ox-GD for grub-devel@gnu.org; Wed, 04 Jun 2008 07:35:50 -0400 Received: by rv-out-0708.google.com with SMTP id k29so105234rvb.6 for ; Wed, 04 Jun 2008 04:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=vT7U5P3h95zlF2Uf96VoxRMNkrvskHTwJSBhb33p6sM=; b=mrFvLnArgVgn8K8pRyUE7TEeVxT8YdleG/0+yebXhysuQy+F2dqdsv8oO61yUeKt1B SHV/RaihAltFmivsxB58SoXFybB/7Vplqw1VDdm9K09R7KF7W/pOje6NR9q9/P2sakyT Bwsfj12pNwkyZWe6Pj1tWuZTGWarTvDHjVNqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=BGAT+p4n1CxoSL/1PnAlJFL8Q3RC+FVtUfIOeajNQQYiVsvdkVa0bgc/Pxa2V++Hri UpkdK3F37fSxha8RfwucOetqTjmowaBxSjPhuCQAU2/g40dLqZKc2ZahB9ZjlDHlyqHk OJPOvDAti6YUDAadShgEU3idQxjfrPV6WWeM0= Received: by 10.141.29.21 with SMTP id g21mr6524168rvj.248.1212579349307; Wed, 04 Jun 2008 04:35:49 -0700 (PDT) Received: by 10.141.66.21 with HTTP; Wed, 4 Jun 2008 04:35:49 -0700 (PDT) Message-ID: Date: Wed, 4 Jun 2008 19:35:49 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <48467C1D.5000204@isaac.cedarswampstudios.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4840123A.5020003@isaac.cedarswampstudios.org> <48419F91.3070408@isaac.cedarswampstudios.org> <20080531192640.GA25920@thorin> <4841C728.5070008@isaac.cedarswampstudios.org> <48457141.3020405@isaac.cedarswampstudios.org> <48467600.9090203@isaac.cedarswampstudios.org> <48467C1D.5000204@isaac.cedarswampstudios.org> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: macbook EFI experiences X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2008 11:35:51 -0000 On Wed, Jun 4, 2008 at 7:27 PM, Isaac Dupree wrote: > Bean wrote: >> >> On Wed, Jun 4, 2008 at 7:01 PM, Isaac Dupree >> 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