Re: [PATCH 1/2] Ensure kernel-xen is the default kernel for Xen guests (#480031)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will Woods <wwoods@xxxxxxxxxx> wrote:

> On Tue, 2011-04-05 at 11:51 -0400, Will Woods wrote:
> > Whichever kernel is listed first by kernelVersionList() will be
> > set as the default kernel by writeBootloader. That's a problem if
> > you're on a Xen guest and the first kernel isn't kernel-xen.
> > 
> > This patch sorts the list returned by kernelVersionList() to put
> > the xenU/xen kernels at the top.
>
> Argh. This patch is for rhel5-branch, and there's no 2/2. I messed up my
> format-patch command. Sorry for any confusion!
>
> > diff --git a/bootloader.py b/bootloader.py
> > index 940478d..371092b 100644
> > --- a/bootloader.py
> > +++ b/bootloader.py
> > @@ -175,7 +175,11 @@ def writeBootloader(anaconda):
> >  
> >      plainLabelUsed = 0
> >      defkern = "kernel"
> > -    for (version, arch, nick) in anaconda.backend.kernelVersionList():
> > +    backendKernelList = anaconda.backend.kernelVersionList()
> > +    if iutil.inXen():
> > +        kernel_rank = {'xenU':1, 'xen':2} # sort based on this ranking
> > +        backendKernelList.sort(key=lambda (v,a,n): kernel_rank.get(n,9))
>
> For the record, I checked to make sure python2.4 supports
> list.sort(key=...) before sending this:
>
> "Starting with Python 2.4, both list.sort() and sorted() added a key
> parameter to specify a function to be called on each list element prior
> to making comparisons."
> -- http://docs.python.org/howto/sorting.html

The patch looks fine, but have you tested it on a RHEL-5 nightly?

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux