On 10.02.2012 20:12, Lennart Sorensen wrote:
On Fri, Feb 10, 2012 at 08:01:23PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
I agree that it should be fixed but the question is how.
I can't think of a way that would work if the disks were in fact using
different setups, which they could be.
No
OK, fair enough if the below worked then.
Currently it only
tries to include partition table support for grub_device, which being
an md raid returns nothing.
This is a problem. It should return the partmap of underlying device
and we have code for that. What does grub-probe -t partmap -d
/dev/mdX is?
root@rceng03new:~# grub-probe -t partmap -d /dev/md0
root@rceng03new:~#
So that would be a problem of course.
root@rceng03new:~# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md1 : active raid5 sda3[0] sdb3[1]
284773376 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_]
md0 : active raid1 sda2[0] sdb2[1]
976884 blocks super 1.2 [2/2] [UU]
unused devices:<none>
md0 is /boot
md1 is /
When I do the final install I will probably but lvm on md1 and put /
and swap and other things on that.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'docs/grub.texi'
--- docs/grub.texi 2012-01-31 21:59:32 +0000
+++ docs/grub.texi 2012-02-10 17:11:59 +0000
@@ -20,7 +20,7 @@
This manual is for GNU GRUB (version @value{VERSION},
@value{UPDATED}).
-Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008,2009,2010 Free Software Foundation, Inc.
+Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
=== modified file 'gentpl.py'
--- gentpl.py 2011-12-24 14:09:26 +0000
+++ gentpl.py 2012-02-10 17:10:18 +0000
@@ -1,4 +1,19 @@
#! /usr/bin/python
+# GRUB -- GRand Unified Bootloader
+# Copyright (C) 2010,2011 Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
#
# This is the python script used to generate Makefile.tpl
=== modified file 'grub-core/disk/diskfilter.c'
--- grub-core/disk/diskfilter.c 2012-02-09 22:43:43 +0000
+++ grub-core/disk/diskfilter.c 2012-02-10 19:54:58 +0000
@@ -260,6 +260,24 @@
return list;
}
+void
+grub_diskfilter_print_partmap (grub_disk_t disk)
+{
+ struct grub_diskfilter_lv *lv = disk->data;
+ struct grub_diskfilter_pv *pv;
+
+ if (lv->vg->pvs)
+ for (pv = lv->vg->pvs; pv; pv = pv->next)
+ {
+ grub_size_t s;
+ if (!pv->disk)
+ grub_util_error (_("Couldn't find physical volume `%s'."
+ " Check your device.map"), pv->name);
+ for (s = 0; pv->partmaps[s]; s++)
+ grub_printf ("%s ", pv->partmaps[s]);
+ }
+}
+
static const char *
grub_diskfilter_getname (struct grub_disk *disk)
{
@@ -964,6 +982,19 @@
pv->part_start = grub_partition_get_start (disk->partition);
pv->part_size = grub_disk_get_size (disk);
+#ifdef GRUB_UTIL
+ {
+ grub_size_t s = 1;
+ grub_partition_t p;
+ for (p = disk->partition; p; p = p->parent)
+ s++;
+ pv->partmaps = xmalloc (s * sizeof (pv->partmaps[0]));
+ s = 0;
+ for (p = disk->partition; p; p = p->parent)
+ pv->partmaps[s++] = xstrdup (p->partmap->name);
+ pv->partmaps[s++] = 0;
+ }
+#endif
if (start_sector != (grub_uint64_t)-1)
pv->start_sector = start_sector;
pv->start_sector += pv->part_start;
=== modified file 'include/grub/diskfilter.h'
--- include/grub/diskfilter.h 2012-01-29 13:28:01 +0000
+++ include/grub/diskfilter.h 2012-02-10 19:53:29 +0000
@@ -72,6 +72,9 @@
struct grub_diskfilter_pv *next;
/* Optional. */
grub_uint8_t *internal_id;
+#ifdef GRUB_UTIL
+ char **partmaps;
+#endif
};
struct grub_diskfilter_lv {
@@ -186,6 +189,8 @@
struct grub_diskfilter_pv *
grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
struct grub_diskfilter_vg **vg);
+void
+grub_diskfilter_print_partmap (grub_disk_t disk);
#endif
#endif /* ! GRUB_RAID_H */
=== modified file 'util/getroot.c'
--- util/getroot.c 2012-02-10 12:17:12 +0000
+++ util/getroot.c 2012-02-10 18:48:24 +0000
@@ -372,7 +372,7 @@
char *buf = NULL;
size_t len = 0;
char **ret = NULL;
- int entry_len = 0, entry_max = 4;
+ grub_size_t entry_len = 0, entry_max = 4;
struct mountinfo_entry *entries;
struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" };
int i;
@@ -1991,7 +1991,7 @@
const grub_partition_t partition)
{
grub_disk_addr_t part_start = 0;
- grub_util_info ("Partition %d starts from %lu",
+ grub_util_info ("Partition %d starts from %" PRIuGRUB_UINT64_T,
partition->number, partition->start);
part_start = grub_partition_get_start (partition);
@@ -2022,7 +2022,7 @@
return 0;
}
- grub_util_info ("%s starts from %lu", os_dev, start);
+ grub_util_info ("%s starts from %" PRIuGRUB_UINT64_T, os_dev, start);
if (start == 0 && device_is_wholedisk (os_dev))
return name;
=== modified file 'util/grub-probe.c'
--- util/grub-probe.c 2012-02-10 11:57:00 +0000
+++ util/grub-probe.c 2012-02-10 19:56:18 +0000
@@ -87,6 +87,9 @@
for (part = disk->partition; part; part = part->parent)
printf ("%s ", part->partmap->name);
+ if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
+ grub_diskfilter_print_partmap (disk);
+
/* In case of LVM/RAID, check the member devices as well. */
if (disk->dev->memberlist)
{
@@ -304,7 +307,7 @@
raid_level = probe_raid_level (disk);
if (raid_level >= 0)
{
- printf ("raid ");
+ printf ("diskfilter ");
if (disk->dev->raidname)
printf ("%s ", disk->dev->raidname (disk));
}
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel