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

Brian C. Lane bcl at redhat.com
Mon Oct 21 21:35:07 UTC 2013


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 :)

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

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list