From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YEiVQ-0006yK-47 for mharc-grub-devel@gnu.org; Fri, 23 Jan 2015 12:58:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEiVN-0006yB-Lv for grub-devel@gnu.org; Fri, 23 Jan 2015 12:58:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEiVI-0002Mp-Jm for grub-devel@gnu.org; Fri, 23 Jan 2015 12:58:49 -0500 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:34098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEiVH-0002Mf-Jl for grub-devel@gnu.org; Fri, 23 Jan 2015 12:58:44 -0500 Received: by mail-lb0-f177.google.com with SMTP id p9so8353502lbv.8 for ; Fri, 23 Jan 2015 09:58:42 -0800 (PST) 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=h6MmW2LObyHkJjuteGpvUT4hBlZFLnHzLcNW3PostW4=; b=WgzbzH9039Vxd/AaLgDrviwb2PYdXTzg9Eg9k/8GRiy0ZTmUVHPfegumDxKvrd9F/Y odLWO/MNAbqmgcf9wb28b/9Rx4/wKUp05sxW+BtvKs7y5xJ5THEauXk8jeVjz86KC22R EAzK5AdnTLCvF1d7fkZ/vRrHTkwRbhPoJk8hofHmMrmcit3VswbKJrJfQ2d4Lkg3iMI3 lSEZWmrmsNWND2LY61pvCZdUjEaN1kajBvKlvYm91MaOGhwvXzCOOsGn1FSjAHju6bl8 UGVM8DOWgBpJLLtzOqRf1rEHpKxVrM/caG535Gb8Xp9M2zJN+dxlrM8E1fVCojs3bNQj dJlQ== X-Received: by 10.152.29.6 with SMTP id f6mr8850507lah.32.1422035922599; Fri, 23 Jan 2015 09:58:42 -0800 (PST) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id ya4sm620345lbb.32.2015.01.23.09.58.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 09:58:41 -0800 (PST) Date: Fri, 23 Jan 2015 20:58:39 +0300 From: Andrei Borzenkov To: Vladimir =?UTF-8?B?J8+GLWNvZGVyL3BoY29kZXIn?= Serbinenko Subject: Re: Does grub-mkrescue support UEFI hybrid USB/DVD images? Message-ID: <20150123205839.1af3ce51@opensuse.site> In-Reply-To: <54C21824.6060407@gmail.com> References: <54C16AD2.7090808@pcbsd.org> <54C17680.9080804@gmail.com> <54C21824.6060407@gmail.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/UKwERp5oqa.I2RzyNFoE=XV"; 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::231 Cc: The development of GNU GRUB 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: Fri, 23 Jan 2015 17:58:51 -0000 --Sig_/UKwERp5oqa.I2RzyNFoE=XV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Fri, 23 Jan 2015 10:45:08 +0100 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > On 23.01.2015 10:40, Andrei Borzenkov wrote: > > On Fri, Jan 23, 2015 at 1:15 AM, Vladimir '=CF=86-coder/phcoder' Serbin= enko > > wrote: > >> On 22.01.2015 22:25, Kris Moore wrote: > >>> > >>> Hey all, > >>> > >>> We are trying to create hybrid USB/DVD images, and they work just fine > >>> on BIOS. However it doesn't seem to work when creating UEFI. > >>> > >> Try this: > >> diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk= .c > >> index 3b12c34..983afdb 100644 > >> --- a/grub-core/disk/efi/efidisk.c > >> +++ b/grub-core/disk/efi/efidisk.c > >> @@ -862,9 +862,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *h= andle) > >> if (! ctx.partition_name) > >> { > >> grub_disk_close (parent); > >> - if (is_cdrom) > >> - return grub_strdup (device_name); > >> - return 0; > >> + return grub_strdup (device_name); > >=20 > > How is it possible? So we have EFI device path that refers to > > partition (or at least to something that does not start on device > > first block) but grub does not see this partition? In case of CD-ROM > > this happens because CD-ROM media subtype actually refers to ESP and > > so points inside CD-ROM. But how it can happen for hard disk? > >=20 > I think his EFI uses eltorito even from the stick. In that case we end > up in exactly the same scenario as CD-ROM. Not eltorito, but normal ESP. Media paths Handle 0x2f241518 /ACPI(a0341d0,0)/PCI(0,4)/HD(1,40,8c,8678dcb08dcc6944,2,2)/EndEntire disk block device path Handle 0x2f241298 /ACPI(a0341d0,0)/PCI(0,4)/HD(2,cc,1680,8678dcb08dcc6944,2,2)/EndEntire simple FS disk c12a7328-f81f-11d2-ba4b-00a0c93ec93b block device path Handle 0x2f241018 /ACPI(a0341d0,0)/PCI(0,4)/HD(3,174c,3548,8678dcb08dcc6944,2,2)/EndEntire disk block device path All of them match existing partitions. EFI boots from ESP as it should. Boot path grub gets /ACPI(a0341d0,0)/PCI(0,4)/HD(2,cc,1680,8678dcb08dcc6944,2,2)/EndEntire which matches ESP. The reason it is not found at startup is missing part_gp= t: grub rescue> ls (hd0) (hd0,apple4) (hd0,apple3) (hd0,apple2) (hd0,apple1) (fd0) (fd1) (cd0)= =20 After adjusting prefix: grub> insmod part_gpt grub> ls (proc) (hd0) (hd0,apple4) (hd0,apple3) (hd0,apple2) (hd0,apple1) (hd0,gpt3)= =20 (hd0,gpt2) (hd0,gpt1) (fd0) (fd1) (cd0)=20 But returning (hd0,gpt2) would also be wrong here - ESP on CD image is empty, we need to somehow jump from ESP to full ISO image. So I guess your patch is the least evil. I will add some comments to grub_efidisk_get_device_name() and grub-mkrescue to explain what happens here after you push it. --Sig_/UKwERp5oqa.I2RzyNFoE=XV Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlTCi88ACgkQR6LMutpd94wq8wCgts3YqcuWVnAPxJ5V5QDuF4RA 0vUAoNO1HX2gU4ymyWllYyn4cI+TSXWJ =ZVRq -----END PGP SIGNATURE----- --Sig_/UKwERp5oqa.I2RzyNFoE=XV--