From 735a306e92df9571dac6e250e1a967d3ea1c3382 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 20 Feb 2013 00:13:49 +0000 Subject: prevent installing grub2 somewhere else than MBR --- perl-install/any.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index b12546115..6c6857cab 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -426,6 +426,14 @@ sub setupBootloader__general { $in->ask_from_({ #messages => N("Bootloader main options"), title => N("Bootloader main options"), interactive_help_id => 'setupBootloader', + validate => sub { + if ($b->{method} eq 'grub2' && $b->{boot} =~ /\d$/) { + log::l("Impossible to install Grub2 on something else than a MBR.\nWe should chain load grub2 when not on MBR"); + $in->ask_warn(N("Error"), N("Grub2 cannot be installed on a partition, only on the MBR (whole disk)")); + return 0; + } + return 1; + }, }, [ #title => N("Bootloader main options"), { label => N("Bootloader"), title => 1 }, -- cgit v1.2.1