From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lXRkc-0004Em-GZ for mharc-grub-devel@gnu.org; Fri, 16 Apr 2021 12:55:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXRkY-00049y-RZ for grub-devel@gnu.org; Fri, 16 Apr 2021 12:55:23 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:44625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXRkV-0004j4-Sh for grub-devel@gnu.org; Fri, 16 Apr 2021 12:55:22 -0400 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lXRkP-004B74-04; Fri, 16 Apr 2021 18:55:13 +0200 Received: from p5b13a1ac.dip0.t-ipconnect.de ([91.19.161.172] helo=[192.168.178.139]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1lXRkO-000rcZ-M1; Fri, 16 Apr 2021 18:55:12 +0200 Subject: Re: GRUB error: unknown filesystem on ia64 From: John Paul Adrian Glaubitz To: The development of GNU GRUB , Javier Martinez Canillas Cc: Daniel Kiper , Peter Jones References: <20210326180133.z5qjvtwt7loxvuqt@tomti.i.net-space.pl> <20210326184315.awfdlparysi3hqii@tomti.i.net-space.pl> <5b041746-09e9-0557-9f2a-ac3b37837728@physik.fu-berlin.de> <8affe4f2-5e8d-1bd5-35e2-6ef108086009@redhat.com> Message-ID: <2b2d1558-ad3b-afe8-3e96-c150533ae59f@physik.fu-berlin.de> Date: Fri, 16 Apr 2021 18:55:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 91.19.161.172 Received-SPF: pass client-ip=130.133.4.66; envelope-from=glaubitz@zedat.fu-berlin.de; helo=outpost1.zedat.fu-berlin.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2021 16:55:23 -0000 Hi! On 4/16/21 6:43 PM, John Paul Adrian Glaubitz wrote: > It seems the patch no longer applies due to the changes introduced by the --sbat > option [1]. I have manually rebased the patch like this. Rebuilding GRUB with that change fixes the problem for me. So you'll just have to rebase your patch and we should be good to go. --- a/util/mkimage.c +++ b/util/mkimage.c @@ -841,7 +841,7 @@ init_pe_section(const struct grub_install_image_target_desc *image_target, section->raw_data_offset = grub_host_to_target32 (*rda); section->raw_data_size = grub_host_to_target32 (rsz); - (*rda) = ALIGN_UP (*rda + rsz, GRUB_PE32_FILE_ALIGNMENT); + (*rda) = *rda + rsz; section->characteristics = grub_host_to_target32 (characteristics); @@ -1418,15 +1418,15 @@ grub_install_generate_image (const char *dir, const char *prefix, section = init_pe_section (image_target, section, ".data", &vma, scn_size, image_target->section_align, - &raw_data, scn_size, + &raw_data, layout.kernel_size - layout.exec_size, GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ | GRUB_PE32_SCN_MEM_WRITE); - scn_size = pe_size - layout.reloc_size - sbat_size - raw_data; + scn_size = ALIGN_UP (pe_size - layout.reloc_size - sbat_size - raw_data, GRUB_PE32_FILE_ALIGNMENT); section = init_pe_section (image_target, section, "mods", &vma, scn_size, image_target->section_align, - &raw_data, scn_size, + &raw_data, pe_size - layout.reloc_size - raw_data, GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ | GRUB_PE32_SCN_MEM_WRITE); @@ -1444,13 +1444,13 @@ grub_install_generate_image (const char *dir, const char *prefix, GRUB_PE32_SCN_MEM_READ); } - scn_size = layout.reloc_size; + scn_size = ALIGN_UP (layout.reloc_size, GRUB_PE32_FILE_ALIGNMENT); PE_OHDR (o32, o64, base_relocation_table.rva) = grub_host_to_target32 (vma); PE_OHDR (o32, o64, base_relocation_table.size) = grub_host_to_target32 (scn_size); memcpy (pe_img + raw_data, layout.reloc_section, scn_size); init_pe_section (image_target, section, ".reloc", &vma, scn_size, image_target->section_align, - &raw_data, scn_size, + &raw_data, layout.reloc_size, GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_DISCARDABLE | GRUB_PE32_SCN_MEM_READ); Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913