From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] nested partitions
Date: Mon, 3 Aug 2009 00:02:36 +0200 [thread overview]
Message-ID: <20090802220236.GG15139@thorin> (raw)
In-Reply-To: <d7ead6de0907161352n34fa7ce6se64416fead1a7b02@mail.gmail.com>
On Thu, Jul 16, 2009 at 10:52:37PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> @@ -94,10 +95,28 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
> dev = grub_device_open (0);
> if (dev && dev->disk && dev->disk->partition)
> {
> - grub_disk_read (dev->disk, dev->disk->partition->offset, 446, 64,
> - (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
> - part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR
> - + (dev->disk->partition->index << 4));
> + grub_disk_t disk = dev->disk;
> +
> + if (disk)
> + {
> + grub_partition_t p = disk->partition;
> +
> + /* In i386-pc, the id is equal to the BIOS drive number. */
> + drive = (int) disk->id;
> +
> + if (p && grub_strcmp (p->partmap->name, "pc_partition_map") == 0)
> + {
> + disk->partition = p->parent;
> + grub_disk_read (disk, p->offset, 446, 64,
> + (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
> + part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR
> + + (((struct grub_pc_partition *) p->data)
> + ->index << 4));
> + disk->partition = p;
> + }
> + }
> +
> + grub_device_close (dev);
I don't think we should allow chainload at all in partitions other than msdos
ones. There's no existing use of this for other labels "in the wild", and we
shouldn't encourage it to appear IMO.
If we have partitions and the "pc_partition_map" match fails, I would just
abort.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
next prev parent reply other threads:[~2009-08-02 22:02 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 15:51 [PATCH] nested partitions Vladimir 'phcoder' Serbinenko
2009-07-16 20:52 ` Vladimir 'phcoder' Serbinenko
2009-07-31 7:58 ` Marco Gerards
2009-07-31 9:39 ` Vladimir 'phcoder' Serbinenko
2009-07-31 19:48 ` Vladimir 'phcoder' Serbinenko
2009-07-31 20:25 ` Vladimir 'phcoder' Serbinenko
2009-08-02 22:17 ` Robert Millan
2009-08-02 22:36 ` Vladimir 'phcoder' Serbinenko
2009-08-02 22:02 ` Robert Millan [this message]
2009-08-02 22:09 ` Vladimir 'phcoder' Serbinenko
2009-08-02 22:25 ` Robert Millan
2009-08-02 22:44 ` Vladimir 'phcoder' Serbinenko
2009-08-04 20:15 ` Robert Millan
2009-08-17 13:00 ` Vladimir 'phcoder' Serbinenko
2009-08-17 14:06 ` Robert Millan
2009-08-17 14:34 ` Vladimir 'phcoder' Serbinenko
2009-08-23 22:57 ` Vladimir 'phcoder' Serbinenko
2009-08-24 13:39 ` Vladimir 'phcoder' Serbinenko
2009-08-25 20:14 ` Vladimir 'phcoder' Serbinenko
2009-08-25 23:07 ` Robert Millan
2009-08-25 23:13 ` Vladimir 'phcoder' Serbinenko
2009-08-26 0:50 ` Robert Millan
2009-08-25 20:35 ` Seth Goldberg
2009-08-25 21:12 ` Vladimir 'phcoder' Serbinenko
2010-01-22 16:53 ` Robert Millan
2010-01-22 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-24 20:41 ` Robert Millan
2010-01-24 21:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-01-25 7:23 ` Robert Millan
2010-01-25 0:38 ` Bruce Dubbs
2010-01-25 4:56 ` Michal Suchanek
2010-01-25 7:31 ` Robert Millan
2010-01-25 7:52 ` Robert Millan
2010-01-25 8:25 ` Grégoire Sutre
2010-01-22 18:43 ` Seth Goldberg
2010-01-24 20:44 ` Robert Millan
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=20090802220236.GG15139@thorin \
--to=rmh@aybabtu.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.