[blivet][PATCH] Provide more meaningful error message if bootloader installation fails

Martin Kolman mkolman at redhat.com
Wed Oct 23 15:58:12 UTC 2013


On Mon, 2013-10-21 at 14:35 -0700, Brian C. Lane wrote:
> On Mon, Oct 21, 2013 at 07:46:05PM +0200, Martin Kolman wrote:
> > If bootloader installation fails due to missing stage 1 target,
> > provide a more meaningful error messages for the MBR and EFI
> > installation methods.
> > 
> > Related: rhbz#1012132
> > Signed-off-by: Martin Kolman <mkolman at redhat.com>
> > ---
> >  blivet/__init__.py | 19 +++++++++++++++++--
> >  1 file changed, 17 insertions(+), 2 deletions(-)
> > 
> > diff --git a/blivet/__init__.py b/blivet/__init__.py
> > index 0aa4897..a4b7fef 100644
> > --- a/blivet/__init__.py
> > +++ b/blivet/__init__.py
> > @@ -106,11 +106,15 @@ def enable_installer_mode():
> >      global BootLoaderError
> >      global errorHandler
> >      global ERROR_RAISE
> > +    global BOOT_METHOD_MBR
> > +    global BOOT_METHOD_EFI
> >  
> >      from pyanaconda import isys
> >      from pyanaconda.constants import ROOT_PATH
> >      from pyanaconda.constants import shortProductName
> >      from pyanaconda.constants import productName
> > +    from pyanaconda.constants import BOOT_METHOD_MBR
> > +    from pyanaconda.constants import BOOT_METHOD_EFI
> >      from pyanaconda.bootloader import get_bootloader
> >      from pyanaconda.bootloader import BootLoaderError
> >      from pyanaconda.errors import errorHandler
> > @@ -1546,8 +1550,19 @@ class Blivet(object):
> >          if self.bootloader and not self.bootloader.skip_bootloader:
> >              stage1 = self.bootloader.stage1_device
> >              if not stage1:
> > -                errors.append(_("you have not created a bootloader stage1 "
> > -                                "target device"))
> > +                # check which boot method would have been used
> > +                # and show appropriate error message about missing
> > +                # stage1 boot target device
> > +                if self.bootloader.boot_method == BOOT_METHOD_MBR:
> > +                    # MBR specific error message
> > +                    errors.append(_("you need to create BIOSBoot mountpoint"))
> 
> I don't think this is any more helpful. For example for grub a stage1
> device is a partitioned disk, not a mountpoint.
> 
> I agree that we need something more clear, but I'm not quite sure how to
> get there :)
Well sure, there are more possible configurations and any actually
useful error messages would be pretty long.

One possible solution might be to check during partitioning if there
is a bootloader target specified and either create it automatically
or at least require confirmation from the user that he really wants
to install an unbootable system. Looks like there is even already a
RFE[1] for this. Like this, either there would always be a target
and if not, it is not an error because the user wants it that way.

> 
> I also think that the actual messages should come from the bootloader
> classes themselves.
> 

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1022316



More information about the anaconda-patches mailing list