From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Z21CN-0004Rh-L7 for mharc-grub-devel@gnu.org; Mon, 08 Jun 2015 13:50:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z21CK-0004Qb-Vu for grub-devel@gnu.org; Mon, 08 Jun 2015 13:50:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z21CE-0000xf-UQ for grub-devel@gnu.org; Mon, 08 Jun 2015 13:50:56 -0400 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:33848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z21CE-0000wf-Gj for grub-devel@gnu.org; Mon, 08 Jun 2015 13:50:50 -0400 Received: by lbcmx3 with SMTP id mx3so85594812lbc.1 for ; Mon, 08 Jun 2015 10:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=AYDtxiB6UUeu9gFJ3nNNKPKpqzy+0ekqV6pGCr1o4yU=; b=c9ckTgkYF4GNvaWCxnW/alasDpFtaXgmVGl+UecWyCj06gbm9WKDy4vW0/0WU5xs+J JJDWdU1GGVyGCOkC/qvw17b7r7UvPeiTVzhf721rkHnMl59z/Pm/wjpEuZNLYxFImHci 7nHX4GXQyN1AtrCRuJ2r5RrWFOvFzE+561vYHzWhrCD3ukbQieR8iaiAxiCk3CFizcJP oyQ8J5T9VCdu0ARy/qO2jZQRtllHDwr0G9U6Uh7JLV9sB5S+kJjAW7cGr7L8uJXZaTrx 3y/qB8KvQLmUZ4EfXDP1kAVnFpiUpXHp9rEcaSFad3vMtObCQYTO0dPqKXSkHbSInUI/ HYow== X-Received: by 10.152.29.161 with SMTP id l1mr18328627lah.76.1433785849683; Mon, 08 Jun 2015 10:50:49 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id rg6sm790060lbb.23.2015.06.08.10.50.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2015 10:50:49 -0700 (PDT) Date: Mon, 8 Jun 2015 20:50:48 +0300 From: Andrei Borzenkov To: Ross Lagerwall Subject: Re: [PATCH] core/partmap: Add El Torito boot catalog parsing Message-ID: <20150608205048.6f36750a@opensuse.site> In-Reply-To: <20150608173106.GA9456@hobo.lan> References: <1433672686-774-1-git-send-email-rosslagerwall@gmail.com> <20150608195144.69ed708c@opensuse.site> <20150608173106.GA9456@hobo.lan> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.28; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/l9w9b1xRfhZ_r=SQevhzu1E"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::229 Cc: grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2015 17:50:58 -0000 --Sig_/l9w9b1xRfhZ_r=SQevhzu1E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Mon, 8 Jun 2015 18:31:06 +0100 Ross Lagerwall =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Mon, Jun 08, 2015 at 07:51:44PM +0300, Andrei Borzenkov wrote: > > =D0=92 Sun, 7 Jun 2015 11:24:46 +0100 > > Ross Lagerwall =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >=20 > > > Add a module, part_eltorito, to allow parsing of the El Torito boot > > > catalog into partitions. This follows the El Torito Bootable CD-ROM > > > Format Specification Version 1.0 and the UEFI Specification 2.5. > > > In cases where the specification is unclear, the code follows the UEFI > > > reference implementation. > > >=20 > > > This is useful when booting CDs in UEFI mode. Before, GRUB would not = be > > > able to use the embedded ESP from which it was executed, so it would > > > have a root and prefix set to the top level of the CD. This could res= ult > > > in subtle configuration bugs, because the same ISO booted from a USB > > > disk (using isohybrid) would have its root and prefix set to the > > > embedded ESP because it can find it through the MBR. > >=20 > > You can already access ESP on hybrid image using e.g. (cd0,msdos1); why > > is it not enough? >=20 > This is about booting a CD in UEFI mode; it may not be a hybrid disc in > which case it doesn't have an MBR. >=20 So you need to either add partition label or add additional driver to grub.efi. The former works already and does not require any new code. > Also, in the case of a hybrid image booted using a CD, the mismatch betwe= en > the 2048 byte sectors of the CD and the 512 byte sector values used in the > MBR means that GRUB is not able to access the correctly ESP anyway. >=20 It may depend on how you create partition table. Neither openSUSE DVD nor images created by grub-mkrescue have problems. Did you actually try it? As example bor@opensuse:~/src/grub> xorriso --indev /datastore/iso/openSUSE-13.2-DVD-x= 86_64.iso --report-el-torito plain --report-system-area plain xorriso 1.3.8 : RockRidge filesystem manipulator, libburnia project. xorriso : NOTE : Loading ISO image tree from LBA 0 xorriso : UPDATE : 6102 nodes read in 1 seconds xorriso : NOTE : Detected El-Torito boot information which currently is set= to be discarded Drive current: -indev '/datastore/iso/openSUSE-13.2-DVD-x86_64.iso' Media current: stdio file, overwriteable Media status : is written , is appendable Boot record : El Torito , MBR isohybrid cyl-align-off Media summary: 1 session, 2284287 data blocks, 4461m data, 31.5g free Volume id : 'openSUSE-13.2-DVD-x86_640051' El Torito catalog : 20 1 El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA El Torito boot img : 1 BIOS y none 0x0000 0x00 4 5826 El Torito boot img : 2 UEFI y none 0x0000 0x00 1 896 El Torito img path : 1 /boot/x86_64/loader/isolinux.bin El Torito img opts : 1 boot-info-table isohybrid-suitable El Torito img path : 2 /boot/x86_64/efi System area options: 0x00000202 System area summary: MBR isohybrid cyl-align-off ISO image size/512 : 9137148 Partition offset : 0 MBR heads per cyl : 0 MBR secs per head : 0 MBR partition table: N Status Type Start Blocks MBR partition : 1 0x00 0xef 3584 8064 MBR partition : 2 0x80 0x17 11648 9126528 MBR partition path : 1 /boot/x86_64/efi bor@opensuse:~/src/grub>=20 You may consider using xorriso to create image, it does quite good job with hybrid images. > For these reasons, I think it is useful to parse the El Torito boot > catalog. >=20 I'm not entirely opposed to it, I just do not see compelling reasons to do it :) I actually think that viewing ESP as opaque binary executable and using ISO as primary data location is more generic and useful. This way you can have any amount of different platform binaries all sharing common /boot/grub on ISO with common configuration. Also information in El Torito boot image (as grub.cfg) is not as easily accessible as information on ISO. Making it hard to understand what image actually does. --Sig_/l9w9b1xRfhZ_r=SQevhzu1E Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlV11fgACgkQR6LMutpd94yjqgCdFoesWGk1oitxOWyv6fNeXr97 UqcAn1oWc9tdoMNDewZnQHg+2pthvTiY =Mmot -----END PGP SIGNATURE----- --Sig_/l9w9b1xRfhZ_r=SQevhzu1E--