* util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels.
Reported and tested by: Grégoire Sutre.
This commit is contained in:
parent
415502c26a
commit
014b68068d
2 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-01-07 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-setup.c (setup): Handle NetBSD and OpenBSD disklabels.
|
||||
Reported and tested by: Grégoire Sutre.
|
||||
|
||||
2011-01-06 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* tests/util/grub-shell.in: Set serial terminfo type to `dumb', to
|
||||
|
|
|
@ -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 @@ setup (const char *dir,
|
|||
{
|
||||
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 @@ setup (const char *dir,
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue