[master/rhel7-branch] Show dialog if kernel cmdline in zipl.conf is too long. (#885011)

Samantha N. Bueno sbueno+anaconda at redhat.com
Fri Aug 29 19:27:44 UTC 2014


On Mon, Aug 04, 2014 at 12:33:28PM +0200, Vratislav Podzimek wrote:
> On Mon, 2014-08-04 at 05:20 -0400, Samantha N. Bueno wrote:
> > On s390x, the kernel cmdline has a hard limit of 896 bytes in length.
> > There is nothing we can do to circumvent this, so instead of just
> > crashing, handle the error gracefully by behaving the same as when
> > unsupported hardware is detected.
> > 
> > Resolves: rhbz#885011
> > ---
> >  pyanaconda/bootloader.py | 5 +++++
> >  pyanaconda/exception.py  | 9 +++++++++
> >  2 files changed, 14 insertions(+)
> > 
> > diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> > index a30f2cd..400314a 100644
> > --- a/pyanaconda/bootloader.py
> > +++ b/pyanaconda/bootloader.py
> > @@ -2150,6 +2150,11 @@ class ZIPL(BootLoader):
> >                  # We want to extract the device name and pass that.
> >                  name = re.sub(r".+?: ", "", line)
> >                  self.stage1_name = re.sub(r"(\s\(.+\))?\.$", "", name)
> > +            # a limitation of s390x is that the kernel parameter list must not
> > +            # exceed 896 bytes; there is nothing we can do about this, so just
> > +            # catch the error and show it to the user instead of crashing
> > +            elif line.startswith("Error: The length of the parameters "):
> > +                raise BootLoaderError(line)
> >  
> >          if not self.stage1_name:
> >              raise BootLoaderError("could not find IPL device")
> > diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
> > index 9767c00..b8ca97a 100644
> > --- a/pyanaconda/exception.py
> > +++ b/pyanaconda/exception.py
> > @@ -33,6 +33,7 @@ import time
> >  import kickstart
> >  import blivet.errors
> >  from pyanaconda.errors import CmdlineError
> > +from pyanaconda.bootloader import BootLoaderError
> >  from pyanaconda.ui.communication import hubQ
> >  from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
> >  from pyanaconda.threads import threadMgr
> > @@ -92,6 +93,14 @@ class AnacondaExceptionHandler(ExceptionHandler):
> >                               "The installer will now terminate.") % str(value)
> >              self.intf.messageWindow(_("Hardware error occured"), hw_error_msg)
> >              sys.exit(0)
> > +        elif issubclass(ty, BootLoaderError) and str(value).startswith("Error: The length of the parameters line"):
> > +            # this only is a risk for s390(x) since there's a hardware limit on
> > +            # the length of the kernel parameter list for bootloader entries
> > +            bl_error_msg = _("The installation was stopped due to an error "
> > +                             "installing the bootloader. The exact error "
> > +                             "message is:\n\n%s.\n\n "
> > +                             "The installer will now terminate.") % str(value)
> > +            self.intf.messageWindow(_("Boot loader error occured"), bl_error_msg)
> Do we have to catch this so "globally"? I'd think this exception can
> appear only in very few places and thus should use the try-catch block.
> Or is it necessary because of the lack of the self.intf reference in
> those places?

No, I think perhaps a new exception class might be reasonable and a bit
cleaner actually since this is such a specific error, and other
extremely specific s390x errors that'll likely crop up in the future can
be lumped under the same umbrella.
I'll post another patch soon once I've tested.
 
> -- 
> Vratislav Podzimek
> 
> Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic
> 
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list