grub2/grub2-install-opt-skip-fs-probe.patch
Stephan Kulow e03f5192ff Accepting request 128513 from devel:openSUSE:Factory
Hi,
Please help to review the patches. Thanks. (forwarded request 128468 from michael-chang)

OBS-URL: https://build.opensuse.org/request/show/128513
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=41
2012-07-23 08:00:52 +00:00

46 lines
2.0 KiB
Diff

From: Michael Chang <mchang@suse.com>
To be able to install grub on an extended partition, user, if they are
convinced it is a good idea, has to use --skip-fs-probe for grub-setup.
For convenience, let us support --skip-fs-probe directly in
grub-install and pass it to grub-setup internally.
Otherwise with such a setup:
Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 213921791 104856576 f W95 Ext'd (LBA)
/dev/sda5 4210688 46153727 20971520 83 Linux
This fails:
$ grub2-install --force /dev/sda2
/usr/sbin/grub2-probe: error: cannot find a GRUB drive for /dev/sda2. Check your device.map.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
References: https://bugzilla.novell.com/show_bug.cgi?id=750897
---
Index: grub-1.99/util/grub-install.in
===================================================================
--- grub-1.99.orig/util/grub-install.in
+++ grub-1.99/util/grub-install.in
@@ -248,6 +248,9 @@ do
-f | --force)
setup_force="--force" ;;
+ -s | --skip-fs-probe)
+ setup_skip_fs_probe="--skip-fs-probe" ;;
+
-*)
gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
@@ -581,7 +584,7 @@ fi
# Perform the grub_modinfo_platform-dependent install
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-pc" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "sparc64-ieee1275" ] ; then
# Now perform the installation.
- "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} --directory="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform" \
+ "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} ${setup_skip_fs_probe} --directory="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform" \
--device-map="${device_map}" "${install_device}" || exit 1
elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ]; then