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 User

 
 
LinkBack Thread Tools
 
Old 05-02-2012, 07:10 PM
David Lehman
 
Default Add kernel selection to YumPayload.

---
pyanaconda/packaging/__init__.py | 11 ++++++++---
pyanaconda/packaging/yumpayload.py | 31 +++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 61d0100..1002a2c 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -591,9 +591,14 @@ class ArchivePayload(ImagePayload):

class PackagePayload(Payload):
""" A PackagePayload installs a set of packages onto the target system. """
- def preInstall(self, packages=None):
- # TODO: kernel selection
- super(PackagePayload, self).preInstall(packages=packages)
+ @property
+ def kernelPackages(self):
+ from pyanaconda.isys import isPaeAvailable
+ kernels = ["kernel"]
+ if isPaeAvailable():
+ kernels.insert(0, "kernel-PAE")
+
+ return kernels

def payloadInitialize(storage, ksdata, payload):
from pyanaconda.kickstart import selectPackages
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 6bf24f4..d3625c5 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -789,6 +789,8 @@ reposdir=%s
for group in self.data.packages.excludedGroupList:
self._deselectYumGroup(group.name)

+ self.selectKernelPackage()
+
def checkSoftwareSelection(self):
log.info("checking software selection")

@@ -840,6 +842,35 @@ reposdir=%s

self._removeTxSaveFile()

+ def selectKernelPackage(self):
+ kernels = self.kernelPackages
+ selected = None
+ # XXX This is optimistic. I'm curious if yum will DTRT if I just say
+ # "select this kernel" without jumping through hoops to figure out
+ # which arch it should use.
+ for kernel in kernels:
+ try:
+ # XXX might need explicit arch specification
+ self._selectYumPackage(kernel)
+ except NoSuchPackage as e:
+ log.info("no %s package" % kernel)
+ continue
+ else:
+ log.info("selected %s" % kernel)
+ selected = kernel
+ # select module packages for this kernel
+
+ # select the devel package if gcc will be installed
+ if self._yum.tsInfo.matchNaevr(name="gcc"):
+ log.info("selecting %s-devel" % kernel)
+ # XXX might need explicit arch specification
+ self._selectYumPackage("%s-devel" % kernel)
+
+ break
+
+ if not selected:
+ log.error("failed to select a kernel from %s" % kernels)
+
def preInstall(self, packages=None):
""" Perform pre-installation tasks. """
super(YumPayload, self).preInstall(packages=packages)
--
1.7.7.6

_______________________________________________
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:49 AM.

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