From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1hQQZE-0008NU-IJ for mharc-grub-devel@gnu.org; Tue, 14 May 2019 02:05:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQQZC-0008NG-OJ for grub-devel@gnu.org; Tue, 14 May 2019 02:05:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQQZB-0003Zr-S6 for grub-devel@gnu.org; Tue, 14 May 2019 02:05:34 -0400 Received: from mout.gmx.net ([212.227.15.15]:41809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQQZB-0003Y0-Ir for grub-devel@gnu.org; Tue, 14 May 2019 02:05:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1557813931; bh=5hZixP5sPxgmWdciLCMoJvOauyWcN40cqtjdPatWWjg=; h=X-UI-Sender-Class:Date:From:To:Subject:Cc:References:In-Reply-To; b=Y9B2KWen5E6rIIYKJRExDASpeJwB0ZC2wGt27shq7sKsmCsKybZLBdEnUPlnrNbHg iNbQ2Mty1KtxX/ME/zcDqcDTJpkoLRaTMEBgX9DSnwFFyH3DU42+3yAfT95WYjVSS5 Gk784oW/7Um6BJ/J05uO0wBDiN2PYllRbJsA0Ykk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from scdbackup.webframe.org ([79.222.46.132]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MgL1q-1h4tZt1qEg-00NfA0; Tue, 14 May 2019 08:05:31 +0200 Date: Tue, 14 May 2019 08:04:01 +0200 From: "Thomas Schmitt" To: grub-devel@gnu.org Subject: Re: grub-mkrescue: Problem with MBR partition table at start of EFI partition Content-Type: text/plain; charset="utf-8" Cc: References: <20190513210436.wdtmjtrertczuwf7@tomti.i.net-space.pl> In-Reply-To: <20190513210436.wdtmjtrertczuwf7@tomti.i.net-space.pl> Message-Id: <281286794407496054@scdbackup.webframe.org> X-Provags-ID: V03:K1:hHNqw10lwIx4D3vmpk+qM/NWtdXhaQII4MbmJWodV8Y6LSemC5W kE07a3Jiw1kUL3/mNcTSiI7iW6ACWoKIVnappiAGkoATi+GbyjtZaaj+Wy0cRXS1fw4xDv2 NpIeaMzabl8qyevnuL16pqeNqP9j7LsZcNsVN2UqN4nqnc5TsgfjSTywOFeG/+4HrKts+zZ 9l2hdV2rWlwTt47UuaE6Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:DzY2buqzd4w=:Nffs+OT7w97n1aWgkcligh JDP6xdXVYvut1UkI4SriBcylbHQAjTicCk/AN9NhIw8oQTaRkorT7G9zpwAbRIlybrXGgDpsd 1uTG0DkNBzUBJBw7E+6jDEknZ2pGxVyrPYRZi1QlxQd+rzjnjwgedte25zR6DMLg0l7mJ/BkV 6NCQ5WXsuiO1rI13iuHOoNydVl+AxzZ6l1SmwxeQt16Yq26SMm2Ll+udo9HBtjZv45LLZme9N R+omR3ch1m8cSke8dorj9F5uJdl+FkfN0A8DsjppiwjTwdjIsnGG6Wh4mvwCWpSNeU2NFVlJe 35sfjZKVjAIOxyHWFKc9wxHqDYFQmLBObHzzRyIW7mMwbvBT//Do+vE6O1fpmYhK9K4AFsFJb Z4RbqVy10GtgACufe00UtrPzY4dEUdYe6k5eZobUHNTejya6a9SCD+vLtADcc9xl0azH9SQ5/ DF+i3q0B79j0wuEw/1RcZmGGY6d3Qpb3+Dpnn56+iwsRVFjTdeW6RiezcbA/pNpoJWfWKgEX8 KrFtYDbRPdK1Q63cV57gCNOYizvcWQ0lAiP9MPAK3nFZwm0Huuo9+ZMeB0L4IXE8CgIH76OsP 5U4qZk3An1Vx0CL+tCCoeTg2gk8YbvWZZ8bO1nM/jno4pAvHGpORL7lvLrJLav2Jt8kbvk2CI WCi5JcTt02htGhQqKP7VjV1mL0hq9zeakltNVjHYq6bZLMpEb4SLTlxy7X3HNoMVc+4tMu7vs t4qxc14bxaJrL3KjcGU3wY3UUSha+f+4mJkWHwJrspSsgmSYfo/VgkLKTD+l+weLD4MD+8W3b kYQfaOe2eiA5yhx/P3iGWEvTS7I5IIF9jUJlWp1FhMdB5FCQ5KgGH6HwAYUuV0xYR7RJbMeXq baDBlylVn58en7F5jI6vnQMez09bVrc6XczslEN3eglDwM3vle9QQ8DBeq+BNzmMzvrB3+Toy Dhg5hLvRInw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 May 2019 06:05:35 -0000 Hi, Daniel Kiper wrote: > may I ask you to write a summary of your findings, A Macbook took offense from the MBR partition table entry in the EFI FAT image which grub-mkrescue produces by help of mformat(1). Vladimir stated that this partition table entry is not intentional and that the information in block 0, which would be missing after using mformat option -k, is probably not needed. Vladimir's proposal to look into the EFI partitions of MS-Windows ISOs led to the insight that their MBR partition table space is filled with cleartext. I.e. not-zero is usual. Credibly looking partition table entry starting at LBA 0 is not usual. (Further we learned that Microsoft has its own protocol implemented in EFIs by which they boot USB sticks with MBR partitioning and no partition of type 0xEF.) > what works and what does not The only thing that was found to not work is a MBR partition entry 1 which starts at LBA 0. Probably it needs to have non-zero block count and non-zero type. > how the issue should be fixed Safest seems to be not to change the mformat run in grub-mkrescue but rather to postprocess its result, e.g. before the run of mcopy which populates the image. Postprocessing would mean to zeroize the whole range of MBR partition table entries. That's bytes 446 to 509 of the FAT image. > why this fix should land in the upcoming release. It may well wait until the start of the next release cycle, although i deem it easy to test and of low risk. Most Linux distros have zeros where i propose to put them. They make their EFI images by mkfs.fat(8). Have a nice day :) Thomas