* [PATCH] fix partition module names when /boot is on diskfilter
@ 2013-12-07 10:46 Andrey Borzenkov
2013-12-07 10:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Borzenkov @ 2013-12-07 10:46 UTC (permalink / raw)
To: grub-devel
/usr/local/grub2/sbin/grub-install: info: grub-mkimage --directory '/usr/local/grub2/lib/grub/i386-pc' --prefix '(mduuid/e6d1dcf06cea72140bafae74a8677f36)/grub' --output '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto' 'ext2' 'msdos' 'msdos' 'diskfilter' 'mdraid1x' 'biosdisk'
.
/usr/local/grub2/sbin/grub-install: error: cannot open `/usr/local/grub2/lib/grub/i386-pc/msdos.mod': No such file or directory.
Introduce common helper for both diskfilter and non-diskfilter case that
converts partition map names into module names.
---
util/grub-install.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/util/grub-install.c b/util/grub-install.c
index e0d942f..4cc557e 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -323,6 +323,21 @@ probe_raid_level (grub_disk_t disk)
}
static void
+push_partmap_module (const char *map)
+{
+ char buf[50];
+
+ if (strcmp (map, "openbsd") == 0 || strcmp (map, "netbsd") == 0)
+ {
+ grub_install_push_module ("part_bsd");
+ return;
+ }
+
+ snprintf (buf, sizeof (buf), "part_%s", map);
+ grub_install_push_module (buf);
+}
+
+static void
probe_mods (grub_disk_t disk)
{
grub_partition_t part;
@@ -333,21 +348,11 @@ probe_mods (grub_disk_t disk)
grub_util_info ("no partition map found for %s", disk->name);
for (part = disk->partition; part; part = part->parent)
- {
- char buf[50];
- if (strcmp (part->partmap->name, "openbsd") == 0
- || strcmp (part->partmap->name, "netbsd") == 0)
- {
- grub_install_push_module ("part_bsd");
- continue;
- }
- snprintf (buf, sizeof (buf), "part_%s", part->partmap->name);
- grub_install_push_module (buf);
- }
+ push_partmap_module (part->partmap->name);
if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
{
- grub_diskfilter_get_partmap (disk, grub_install_push_module);
+ grub_diskfilter_get_partmap (disk, push_partmap_module);
have_abstractions = 1;
}
--
tg: (5ffdfb2..) u/fix-part-modules-for-diskfilter (depends on: master u/fix-grub-install-on-hdX)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix partition module names when /boot is on diskfilter
2013-12-07 10:46 [PATCH] fix partition module names when /boot is on diskfilter Andrey Borzenkov
@ 2013-12-07 10:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-12-07 10:53 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]
Go ahead.
On 07.12.2013 11:46, Andrey Borzenkov wrote:
> /usr/local/grub2/sbin/grub-install: info: grub-mkimage --directory '/usr/local/grub2/lib/grub/i386-pc' --prefix '(mduuid/e6d1dcf06cea72140bafae74a8677f36)/grub' --output '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto' 'ext2' 'msdos' 'msdos' 'diskfilter' 'mdraid1x' 'biosdisk'
> .
> /usr/local/grub2/sbin/grub-install: error: cannot open `/usr/local/grub2/lib/grub/i386-pc/msdos.mod': No such file or directory.
>
> Introduce common helper for both diskfilter and non-diskfilter case that
> converts partition map names into module names.
>
> ---
> util/grub-install.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/util/grub-install.c b/util/grub-install.c
> index e0d942f..4cc557e 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -323,6 +323,21 @@ probe_raid_level (grub_disk_t disk)
> }
>
> static void
> +push_partmap_module (const char *map)
> +{
> + char buf[50];
> +
> + if (strcmp (map, "openbsd") == 0 || strcmp (map, "netbsd") == 0)
> + {
> + grub_install_push_module ("part_bsd");
> + return;
> + }
> +
> + snprintf (buf, sizeof (buf), "part_%s", map);
> + grub_install_push_module (buf);
> +}
> +
> +static void
> probe_mods (grub_disk_t disk)
> {
> grub_partition_t part;
> @@ -333,21 +348,11 @@ probe_mods (grub_disk_t disk)
> grub_util_info ("no partition map found for %s", disk->name);
>
> for (part = disk->partition; part; part = part->parent)
> - {
> - char buf[50];
> - if (strcmp (part->partmap->name, "openbsd") == 0
> - || strcmp (part->partmap->name, "netbsd") == 0)
> - {
> - grub_install_push_module ("part_bsd");
> - continue;
> - }
> - snprintf (buf, sizeof (buf), "part_%s", part->partmap->name);
> - grub_install_push_module (buf);
> - }
> + push_partmap_module (part->partmap->name);
>
> if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
> {
> - grub_diskfilter_get_partmap (disk, grub_install_push_module);
> + grub_diskfilter_get_partmap (disk, push_partmap_module);
> have_abstractions = 1;
> }
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-07 10:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-07 10:46 [PATCH] fix partition module names when /boot is on diskfilter Andrey Borzenkov
2013-12-07 10:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
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).