Skip to contentSkip to conversation

Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem.

DISCUSSION Andrei Borzenkov 3 participants 3 messages May 3, 2015 – May 7, 2015

lore
Share & tools
lore
#0 lore raw

Could someone explain why this message is output here? It is absolutely not what condition checks for

    if (ctx.container
        && grub_strcmp (ctx.container->partmap->name, "msdos") == 0
        && ctx.dest_partmap
        && (ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_NETBSD
            || ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_OPENBSD))
      {
        grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem.  This is not supported yet."));
        goto unable_to_embed;
      }

Condition checks whether we are installing on a netbsd or openbsd partition with nested partition label. At this point we have really no idea whether any filesystem is present (we check for it later). So neither "multiple partition labels" nor "filesystem" appear to have anything to do with this check.

Also it actually skips further sanity check for reserved sector in nested partition label and jumps directly to embedding.

So it sounds like both error message is misleading and code is out of place (it probably should be moved after reserved sector check).

Comments?

#1 lore raw

Hi,

I think you may be looking for this commit:

$ git show -s 014b6806
commit 014b68068d4136812f2e3dc16c986351e6fb2779
Author: Vladimir 'phcoder' Serbinenko <[email protected]>
Date:   Fri Jan 7 13:27:34 2011 +0100

* util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels. Reported and tested by: Grégoire Sutre.

That's where the code seems to originate from.

It doesn't answer your question yet, though.

Best,

Sebastian

#2 lore raw
In reply to Andrei Borzenkov
Quoted 19 lines · Andrei Borzenkov

Could someone explain why this message is output here? It is absolutely not what condition checks for

    if (ctx.container
        && grub_strcmp (ctx.container->partmap->name, "msdos") == 0
        && ctx.dest_partmap
        && (ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_NETBSD
            || ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_OPENBSD))
      {
        grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem.  This is not supported yet."));
        goto unable_to_embed;
      }

Condition checks whether we are installing on a netbsd or openbsd partition with nested partition label. At this point we have really no idea whether any filesystem is present (we check for it later). So neither "multiple partition labels" nor "filesystem" appear to have anything to do with this check.

Quoted 8 lines

Also it actually skips further sanity check for reserved sector in nested partition label and jumps directly to embedding.

So it sounds like both error message is misleading and code is out of place (it probably should be moved after reserved sector check).

Comments?

It's just bad message. We need this special check because net- and openbsd labels have metadata in the partition and we have no code currently to avoid this metadata even if filesystem there could support embedding. So perhaps something like
"Embedding into partitions with OpenBSD or NetBSD metadata is not supported yet"
?

Quoted 5 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel