grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: "Grégoire Sutre" <gregoire.sutre@gmail.com>
Subject: [RFT] NetBSD embedding regression fix
Date: Wed, 05 Jan 2011 11:50:59 +0100	[thread overview]
Message-ID: <4D244D13.4060106@gmail.com> (raw)
In-Reply-To: <4CD03517.9000500@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 90 bytes --]

Please test the attached patch

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: bsd.diff --]
[-- Type: text/x-diff; name="bsd.diff", Size: 1343 bytes --]

=== modified file 'util/grub-setup.c'
--- util/grub-setup.c	2010-11-26 21:03:16 +0000
+++ util/grub-setup.c	2011-01-05 10:48:40 +0000
@@ -49,6 +49,7 @@
 #include <grub/emu/getroot.h>
 #include "progname.h"
 #include <grub/reed_solomon.h>
+#include <grub/msdos_partition.h>
 
 #define _GNU_SOURCE	1
 #include <argp.h>
@@ -339,6 +340,12 @@
     {
       if (p->parent != container)
 	return 0;
+      /* NetBSD and OpenBSD subpartitions have metadata inside a partition,
+	 so they are safe to ignore.
+       */
+      if (grub_strcmp (p->partmap->name, "netbsd") == 0
+	  || grub_strcmp (p->partmap->name, "openbsd") == 0)
+	return 0;
       if (dest_partmap == NULL)
 	{
 	  dest_partmap = p->partmap;
@@ -352,6 +359,15 @@
 
     grub_partition_iterate (dest_dev->disk, identify_partmap);
 
+    if (container && grub_strcmp (container->partmap->name, "msdos") == 0
+	&& dest_partmap
+	&& (container->msdostype == GRUB_PC_PARTITION_TYPE_NETBSD
+	    || container->msdostype == GRUB_PC_PARTITION_TYPE_OPENBSD))
+      {
+	grub_util_warn (_("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;
+      }
+
     fs = grub_fs_probe (dest_dev);
     if (!fs)
       grub_errno = GRUB_ERR_NONE;


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

  parent reply	other threads:[~2011-01-05 10:51 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
2011-01-05 10:50       ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-01-07 10:32         ` [RFT] NetBSD embedding regression fix 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=4D244D13.4060106@gmail.com \
    --to=phcoder@gmail.com \
    --cc=gregoire.sutre@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).