FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 04-05-2011, 04:00 PM
Will Woods
 
Default Ensure kernel-xen is the default kernel for Xen guests (#480031)

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

-w

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-05-2011, 04:09 PM
David Cantrell
 
Default Ensure kernel-xen is the default kernel for Xen guests (#480031)

Will Woods <wwoods@redhat.com> 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@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-05-2011, 10:09 PM
Will Woods
 
Default Ensure kernel-xen is the default kernel for Xen guests (#480031)

On Tue, 2011-04-05 at 06:09 -1000, David Cantrell wrote:

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

Yes - not in a Xen guest, but it worked just fine for a non-Xen guest
machine. Should I find someone with a Xen host to test it before
pushing?

-w

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

Thread Tools




All times are GMT. The time now is 05:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org