From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VpFOy-0006TE-6v for mharc-grub-devel@gnu.org; Sat, 07 Dec 2013 05:46:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpFOo-0006Qe-AW for grub-devel@gnu.org; Sat, 07 Dec 2013 05:46:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpFOf-0002Lu-TJ for grub-devel@gnu.org; Sat, 07 Dec 2013 05:46:14 -0500 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:64658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpFOf-0002Li-L9 for grub-devel@gnu.org; Sat, 07 Dec 2013 05:46:05 -0500 Received: by mail-lb0-f172.google.com with SMTP id z5so680516lbh.3 for ; Sat, 07 Dec 2013 02:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=0rU5ydgvZ/MA38HMZ3fb0qAHvFVt5MiP/3R/TU3icWY=; b=ks6FmFtDkGonWLUZ33KLOwCxDLNrHUX13dGrwOBuIfN3n4aq20D+FAi/omZ3nxbhqE i+lHHDy1MwdnG+OFg91JbSpv9XrhURisSYbvDgm7y92ohptdykIvefOqzS3Wp8Unqfbk lp05EVGlZrb5Uo2kvDQpgiFof5JtI7zEJ08Lm8MHfxuwHAsPkx5szTFbpAQxbMIr8T47 frSipCFwTcUSuep53ry3AmLrLwIBsTVVp6BX6xNKRyyt1xy536e+EACwiPmFtDnOubx6 0qMRLfgl2vfiOzZ83yVPiS29ZWSitxRVnRJteAqECkYuuSJNoaQE4v1tPZ/nPlk8oYU5 Nnsg== X-Received: by 10.152.184.35 with SMTP id er3mr2087971lac.23.1386413164510; Sat, 07 Dec 2013 02:46:04 -0800 (PST) Received: from localhost.localdomain (ppp91-76-134-134.pppoe.mtu-net.ru. [91.76.134.134]) by mx.google.com with ESMTPSA id r10sm2335097lag.7.2013.12.07.02.46.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Dec 2013 02:46:04 -0800 (PST) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH] fix partition module names when /boot is on diskfilter Date: Sat, 7 Dec 2013 14:46:01 +0400 Message-Id: <1386413161-15520-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 10:46:22 -0000 /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)