From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1hRFNA-0001Ug-Oo for mharc-grub-devel@gnu.org; Thu, 16 May 2019 08:20:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRFN6-0001Qf-K8 for grub-devel@gnu.org; Thu, 16 May 2019 08:20:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRFN2-0002bV-JZ for grub-devel@gnu.org; Thu, 16 May 2019 08:20:28 -0400 Received: from mout.gmx.net ([212.227.15.19]:41397) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRFMx-0002X5-JG for grub-devel@gnu.org; Thu, 16 May 2019 08:20:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558009216; bh=iYHy3Nm2LCgw9YAHAl11SIaazqz0r7F539zG0tyYDkU=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=gOew9519H3bcSEQdtNtDkHP1MUk3GZrGG4YWvwDEDyJR3v+LCWFl023tryVUG1Npz mjdM5AR6sZRLuJReNjewJnSSoiWdec4a0BoO17ao1Ga6oIFUIClPX44HQfkr2N9y/D n6wKuePtgivSrKw5glqC+mHz6YY+ruudsBB69+4I= 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 0MEnjW-1hU1Zd3aJe-00G4G7 for ; Thu, 16 May 2019 14:20:15 +0200 Date: Thu, 16 May 2019 14:18:51 +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" References: <20190516102930.sf7us6myi4u3ayot@tomti.i.net-space.pl> In-Reply-To: <20190516102930.sf7us6myi4u3ayot@tomti.i.net-space.pl> Message-Id: <10693678985239549894@scdbackup.webframe.org> X-Provags-ID: V03:K1:GfEmmCZxa3NbzZThSH54MCDwmnOY8wxNDNhWbhC2DWLT+HRpR+H ldv0arEaK3Kq9dAb7pJOJYh3/Yl76LckeqXNvk8fjIG8Qbgyl1jyZXHpuzFVm5MhqWz/r4u pIDxJRok02T13Pw0BiUSgjBm1thVMDRG9hzHpsLHXriVXf3BX2K9W6OeXyE8bjE6426A+uM rnFa4OjVlSs3RDdZ8AEow== X-UI-Out-Filterresults: notjunk:1;V03:K0:w00I+gDZszM=:kVGw3sWeuI/Y1m2nAglb7N oYpV7hdQG7Gmd8claz4TE2/d9m0/BN3CmJbPVthR5ACeyNMSOZBQZnlXLX26qO/cjBPqWz2Ld GpgBKW6xP3c0qkuHykItSNoB/99wvg2ehRAJwgFru+MH8lbqz+/H4vFwj8mYTMz/3WVwZV73v ZTp2emguSo1+ENrmMYYXmx1jIa5Xef+y0BkbDg/V2SpJZqM2dlq1KyRu2qUBaak4br2wjLmT9 ooH/pYqtlhg7tTXEGRr8EupMBK+Tb7Pi+YfKI0JmnV/Km76lsQLOHN5BSsi2SZoRNQEuXwEl3 qbEfjSgpwPljfT0TyMl6amGDemfY9nFfF6kO84VpTpF4/LKvw+ReEIntCHTxlzhz6cS+cEYUi ahQ3/6g0LxMC6oq30rhDJzrzP2pQHZVdFVX+MRYBWQGoB9KmPX2k602RNwyVHbhnOW8Tvlzxr cH0MlQeBe/wvPZ2s8w8S6uZXGHnJJi/b8TBExWzyLjlkQ8NhkjwvctTiDzDdFxV3M7Z6VvwG7 rNRfoytmGfukf02VxeODwHLnWWM6dksCKPW3mv9uYoqModMfrLEW90hIf1SoCI/6AD0reNi0j 1S85IBcSHXdJlGK1kQ2JSS3ctQHbXBoBUMQurd5CRuJOuuuXt5YdFOE7xucLTjXAe5Ymvh71B MXaDx1DV8KpqzS7cZoKDbuNiXMmnzgEggTUjm9D/DC2k3THIo9qqlZi1hdvMZF9CjKfP6sQXB NRRf381dgFTVLaCb3YT8wvuXUXMVUzkTfjpKufn14mYPSyhXAAffoUk6umnB5gBVaVNb9/aTV EWcdHi4Sz3wVZBQQBpDnQQvzHbgkpRDy2jjpkydiWjU41Dmfddz5DBRF9g9hyJCaz7gmShtc9 5Tronco5lNcjkYDvSi2XZuqJJGfoQ9f8paoyWGZ9a+nojShzYEdIprEx7KLF/AaspGkHIuR+m pzw770513SQcmWRiE6Qn8TCmXbgvWKp75fsya4s84mgo8i+GYCaug X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 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: Thu, 16 May 2019 12:20:31 -0000 Hi, i quoted mformat.c: > > /* install fake partition table pointing to itself */ Daniel Kiper wrote: > OK, but why it is also done for FDD images? According to its man page, mformat formats floppies. So the question would be why it creates a partition table at all. > > Either mformat's result is ok or it is not. > I would say that in most cases it works but is some it does not. This > is difficult to say right now where is the bug Whoever is the culprit when stepping into a pitfall, grub-mkrescue should try to avoid known bug triggers. I understand from Vladimir's reply that he did not think of partition tables or floppies when employing mformat in grub-mkrescue.c. He wanted a FAT filesystem with usual entrails. Usual is to have no data in it which look like a partition table entry which describes a partition starting at block 0. (Microsoft hasn't. The larger Linux distros haven't.) So i propose the change as fine tuning of the original developer's intention. (Vladimir will correct me if i'm wrong.) > So, first of all I would like to understand why somebody decided to do that As for the Macbook, my theory is that it tries to explore what it believes to be an extended partition. Newer Macbooks are said not to make this mistake any more. As for mtools, binary search on http://svn.savannah.gnu.org/viewvc/mtools/trunk/mformat.c?view=log yields that the comment came in with revision 4 in line 958 http://svn.savannah.gnu.org/viewvc/mtools/trunk/mformat.c?revision=4&view=markup Revision 2, line 800 shows no trace of a partition table until in the end 0xaa55 is written. Revision 4 is from 2002 and has as commit message "3.9.8, modified files". Committer is "aknaf", probably the same as "alainknaff" who committed to mtools last year. https://savannah.gnu.org/users/alainknaff Maybe he still can remember why he added the partition entry. -------------------------------------------------------------------------- > > After all it is quite easy to override the ideas of grub-mkrescue > > before the ISO gets packed up. In practice, it's preference for GPT > > makes more problems than its preference for mformat. > This is not good idea. I would like to see a fix or at least a kind of > workaround in GRUB upstream. I was not happy with Vladimir's decision to use GPT instead of MBR partition table. (Because of non-mountable partitions and the GPT backup, which needs to be relocated after copying the ISO onto USB stick.) Nevertheless, if GRUB wants then GRUB gets, provided that i understand what is desired and find a way to fiddle it into the existing libisofs code. In the course of a few bug hunts i developed the pseudo-xorriso script which can be put between grub-mkrescue and real xorriso by option --xorriso=. https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/frontend/grub-mkrescue-sed.sh It gets to see the xorriso arguments and the temporary directory with the prepared files. So it can modify them. It spares grub-mkrescue the work to implement options like --mbr-rather-than-gpt --without-hfsplus-and-apm --in-efi-no-partition-table, --do-it-like-isohybrid-u They all are more in the realm of xorriso than of GRUB. But the user can hardly influence those aspects by adding some xorriso options to the grub-mkrescue arguments. The script is part of xorriso's project and mainly applies to x86 EFI bootable ISOs. Of course it speculates that not much will change in grub-mkrescue's relation to xorriso. I am subscribed here and hope to notice any patch that would change the xorriso arguments or the fundamental layout of the prepared file tree. Have a nice day :) Thomas