From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [RFT] nested partition issues
Date: Sun, 14 Nov 2010 23:31:02 +0100 [thread overview]
Message-ID: <4CE06326.8070606@gmail.com> (raw)
In-Reply-To: <4CD03517.9000500@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3446 bytes --]
On 11/02/2010 04:58 PM, Grégoire Sutre wrote:
> Hi,
>
> The main issue at hand is that, to support NetBSD, we need a working
> grub-setup for the (very common) case where the NetBSD disklabel is
> placed
> in an MSDOS partition.
>
> If we need to add yet other ``strcmp (..._partmap->name, ...)'' tests to
> grub-setup, then we likely have bad abstractions.
>
Usually I would have agreed with you. Unfortunately on-disk layout isn't
something that is well structured. There is a bunch of special cases,
exceptions and plain brain damage that the code to handle all
possibilities will necessarily be more complicated than it should. And I
feel like the abstractions taken for NetBSD are the right one.
As for embedding code it's written specially in the following way
if (<usual config 1>)
{
...
} else if (<usual config 2>)
{
...
} else {
error ("Something unusual, better fail than damage anything");
}
If you test the netbsd case and it works as it should you can add the
strcmp (..._partmap->name, ...) part.
>
>> Actually now we follow the actual nesting of partitions. Even though
>> net-/openbsd label metadate is placed inside a partition it still
>> describes the whole disk as is manifested by it having entries for
>> partitions not contained inside the partition containing label metadata.
>> E.g.
>> (hd0,netbsd6) may be physically contained within (hd0,msdos3) but still
>> be described inside the label present in second sector (hd0,msdos2).
>> Place of metadata is secondary to deciding what the nesting of
>> partitions is. Primary criteria is what this metadata describes.
>
> So, basically, as soon as a disklabel uses absolute offsets, this
> disklabel
> must be viewed as a top-level disklabel?
No. Even using absolute offsets the label can be limited to current
partition. It's the case of minix and FreeBSD. Main criteria is
"If there can be only one label of this type per disk and it may
describe (sub)partitions outside its own partition, then it's top-level"
>
> I'm afraid that this will make things more complicated than they should
> be. But that's just me.
>
>
>> This is, of course, very unfortunate design but since we support NetBSD
>> we need such hacks. It's better than being faced with the problems of
>> kind "My XYZOS handles my partition scheme perfectly but GRUB doesn't
>> see half of partitions."
>
> I did not see reports of such problems (for NetBSD partitions) since I
> merged the code to ``external'' partitions [1]. Could you please
> point me
> to such reports?
>
This was based on the image you sent me once.
> In the previous implementation, if partition e: in a NetBSD disklabel is
> discarded, it's because e: describes an ``external'' partition. This
> external partition is (in all useful cases) described in another
> partition
> map, where it is properly nested, hence it will be found by GRUB.
>
Hm, it doesn't seem to be what you told me previously. AFAIR you told me
that disklabel only handles first label found, and now you say that the
same information is duplicated in every NetBSD partition.
> Grégoire
>
> [1] http://lists.gnu.org/archive/html/grub-devel/2010-07/msg00109.html
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next prev parent reply other threads:[~2010-11-14 22:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-04 0:07 [RFT] nested partition issues Vladimir 'φ-coder/phcoder' Serbinenko
2010-11-02 0:31 ` Grégoire Sutre
2010-11-02 9:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-11-02 15:58 ` Grégoire Sutre
2010-11-14 22:31 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-01-05 10:50 ` [RFT] NetBSD embedding regression fix Vladimir 'φ-coder/phcoder' Serbinenko
2011-01-07 10:32 ` Grégoire Sutre
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=4CE06326.8070606@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).