fix partition module names when /boot is on diskfilter
PATCH 1/1 fix partition module names when /boot is on diskfilter
/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(-)
util/grub-install.c +17 -12
@@ -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 ; }
Signature · 1 line
tg: (5ffdfb2..) u/fix-part-modules-for-diskfilter (depends on: master u/fix-grub-install-on-hdX)
Go ahead.
Quoted 62 lines · Andrey Borzenkov
/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(-)util/grub-install.c +17
-12@@ -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 ; }