All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Does grub-mkrescue support UEFI hybrid USB/DVD images?
Date: Fri, 23 Jan 2015 20:58:39 +0300	[thread overview]
Message-ID: <20150123205839.1af3ce51@opensuse.site> (raw)
In-Reply-To: <54C21824.6060407@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2873 bytes --]

В Fri, 23 Jan 2015 10:45:08 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 23.01.2015 10:40, Andrei Borzenkov wrote:
> > On Fri, Jan 23, 2015 at 1:15 AM, Vladimir 'φ-coder/phcoder' Serbinenko
> > <phcoder@gmail.com> 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 *handle)
> >>           if (! ctx.partition_name)
> >>             {
> >>               grub_disk_close (parent);
> >> -             if (is_cdrom)
> >> -               return grub_strdup (device_name);
> >> -             return 0;
> >> +             return grub_strdup (device_name);
> > 
> > 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?
> > 
> 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_gpt:

grub rescue> ls
(hd0) (hd0,apple4) (hd0,apple3) (hd0,apple2) (hd0,apple1) (fd0) (fd1) (cd0) 

After adjusting prefix:

grub> insmod part_gpt
grub> ls
(proc) (hd0) (hd0,apple4) (hd0,apple3) (hd0,apple2) (hd0,apple1) (hd0,gpt3) 
(hd0,gpt2) (hd0,gpt1) (fd0) (fd1) (cd0) 

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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2015-01-23 17:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 21:25 Does grub-mkrescue support UEFI hybrid USB/DVD images? Kris Moore
2015-01-22 22:15 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-01-23  9:40   ` Andrei Borzenkov
2015-01-23  9:45     ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-01-23 10:10       ` Andrei Borzenkov
2015-01-23 10:14       ` Thomas Schmitt
2015-01-23 14:40         ` Kris Moore
2015-01-23 16:18           ` Thomas Schmitt
2015-01-23 17:58       ` Andrei Borzenkov [this message]
2015-01-23 18:27         ` Thomas Schmitt
2015-01-23 18:29         ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-01-23 18:38           ` Andrei Borzenkov
2015-01-23 19:03             ` Andrei Borzenkov
2015-01-24  0:12 ` adrian15
2015-01-25  8:03   ` adrian15
2015-01-25  8:15     ` adrian15
2015-01-25 10:51       ` adrian15

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150123205839.1af3ce51@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.