All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Fix prefix autodetection when booting from EFI CD-ROM
Date: Fri, 05 Apr 2013 15:12:26 +0200	[thread overview]
Message-ID: <515ECDBA.40507@gmail.com> (raw)
In-Reply-To: <1359635040-23786-1-git-send-email-arvidjaar@gmail.com>

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

On 31.01.2013 13:24, Andrey Borzenkov wrote:

> Fix autodetection of $prefix when booted from EFI CD-ROM.
> 
> Based on patch from Matthew Garrett, modified to not overwrite
> memory returned by device path protocol handler and rebased to
> current trunk.
> 
> Additionally fixes potential memory leak - dup_dp was not deallocated
> if device path was not found.

Why any special treatement for CD-ROMs? They can have partitions and do
so on CD-ROMs intended for macs. What about following patch:

phcoder@debian.x201.phnet:15:02:18:~/grub2/bzr/mainline$ bzr diff
=== modified file 'grub-core/disk/efi/efidisk.c'
--- grub-core/disk/efi/efidisk.c	2013-04-05 08:59:26 +0000
+++ grub-core/disk/efi/efidisk.c	2013-04-05 13:07:39 +0000
@@ -633,9 +633,6 @@
       return d->handle;

     case 'c':
-      /* FIXME: probably this is not correct.  */
-      return d->handle;
-
     case 'h':
       /* If this is the whole disk, just return its own data.  */
       if (! disk->partition)
@@ -657,7 +654,9 @@
 	    if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path)
 		 == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
 		&& (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path)
-		    == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)
+		    == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE
+		    || GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path)
+		    == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE)
 		&& (grub_partition_get_start (disk->partition)
 		    == (hd.partition_start << (disk->log_sector_size
 					       - GRUB_DISK_SECTOR_BITS)))
@@ -770,7 +769,9 @@

   if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE
       && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp)
-	  == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))
+	  == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE
+	  || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp)
+	  == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE))
     {
       struct grub_efidisk_get_device_name_ctx ctx;
       char *dev_name;




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

  parent reply	other threads:[~2013-04-05 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31 12:24 [PATCH] Fix prefix autodetection when booting from EFI CD-ROM Andrey Borzenkov
2013-02-03 20:13 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-05 13:12 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-04-05 15:28   ` Andrey Borzenkov
2013-10-14 15:07 ` Vladimir 'φ-coder/phcoder' Serbinenko

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=515ECDBA.40507@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.