summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--backend.py4
-rw-r--r--livecd.py12
-rw-r--r--yuminstall.py2
4 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index cbbb285a7..8962329a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-06 Jeremy Katz <katzj@redhat.com>
+
+ * livecd.py (LiveCDCopyBackend.kernelVersionList): Check the rpmdb
+ of the installed root (based on feedback from Jerry Vonau)
+ * backend.py (AnacondaBackend.kernelVersionList): Take the
+ rootPath as an argument
+ * yuminstall.py (YumBackend.kernelVersionList): Likewise.
+
2007-08-06 Chris Lumens <clumens@redhat.com>
* image.py (CdromInstallMethod.systemMounted): Add a more specific
diff --git a/backend.py b/backend.py
index 7070dadad..6bd5593bf 100644
--- a/backend.py
+++ b/backend.py
@@ -72,7 +72,7 @@ class AnacondaBackend:
if anaconda.id.extraModules:
self.copyFirmware(anaconda)
- for (n, arch, tag) in self.kernelVersionList():
+ for (n, arch, tag) in self.kernelVersionList(anaconda.rootPath):
packages.recreateInitrd(n, anaconda.rootPath)
sys.stdout.flush()
@@ -118,7 +118,7 @@ class AnacondaBackend:
else:
self.modeText = _("Installing %s\n")
- def kernelVersionList(self):
+ def kernelVersionList(self, rootPath="/"):
return []
def doInitialSetup(self, anaconda):
diff --git a/livecd.py b/livecd.py
index 5f977c117..6ccd2937e 100644
--- a/livecd.py
+++ b/livecd.py
@@ -325,13 +325,21 @@ class LiveCDCopyBackend(backend.AnacondaBackend):
def writeConfiguration(self):
pass
- def kernelVersionList(self):
+ def kernelVersionList(self, rootPath = "/"):
versions = []
# FIXME: we should understand more types of kernel versions and not
# be tied to rpm...
import rpm
- ts = rpm.TransactionSet()
+ ts = rpm.TransactionSet(rootPath)
+
+ # FIXME: and make sure that the rpmdb doesn't have stale locks :/
+ for rpmfile in ["__db.000", "__db.001", "__db.002", "__db.003"]:
+ try:
+ os.unlink("%s/var/lib/rpm/%s" %(rootPath, rpmfile))
+ except:
+ log.debug("failed to unlink /var/lib/rpm/%s" %(rpmfile,))
+
mi = ts.dbMatch('name', 'kernel')
for h in mi:
v = "%s-%s" %(h['version'], h['release'])
diff --git a/yuminstall.py b/yuminstall.py
index ad1744f4a..db553eac4 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1293,7 +1293,7 @@ class YumBackend(AnacondaBackend):
AnacondaBackend.doPostInstall(self, anaconda)
w.pop()
- def kernelVersionList(self):
+ def kernelVersionList(self, rootPath="/"):
kernelVersions = []
# nick is used to generate the lilo name