revisor/base.py | 4 +++-
revisor/image.py | 16 ++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
New commits:
commit bec23ff332c177b56a9f03c7502492dfbdfe2c08
Author: Jeroen van Meeuwen (Fedora Unity) <kanarip(a)fedoraunity.org>
Date: Fri Mar 13 05:33:12 2009 +0100
Do not set size from payload when in respin mode
Create a pseudo LiveImageCreator to circumvent cross-arch composes not matching rpmUtils.arch.getBaseArch()
diff --git a/revisor/base.py b/revisor/base.py
index 6de76ec..a7cb106 100644
--- a/revisor/base.py
+++ b/revisor/base.py
@@ -2161,7 +2161,9 @@ class RevisorBase:
def buildLiveMedia(self):
# Get our object from pilgrim
- liveImage = revisor.image.LiveImageCreator(self)
+ pseudo_creator = revisor.image.RevisorImageCreator(self, self.cfg.architecture)
+
+ liveImage = pseudo_creator.imagecreator
pbar = self.progress_bar(_("Creating ext3 filesystem"))
diff --git a/revisor/image.py b/revisor/image.py
index 2ce1b77..52d5e5a 100644
--- a/revisor/image.py
+++ b/revisor/image.py
@@ -33,6 +33,17 @@ import yum.Errors
# Translation
from rhpl.translate import _
+class RevisorImageCreator:
+ def __init__(self, base, architecture):
+ if architecture in ("i386", "i586", "i686", "x86_64"):
+ self.imagecreator = x86LiveImageCreator(base)
+ elif architecture in ("ppc",):
+ self.imagecreator = ppcLiveImageCreator(base)
+ elif architecture in ("ppc64",):
+ self.imagecreator = ppc64LiveImageCreator(base)
+ else:
+ raise CreatorError("Architecture not supported!")
+
class ImageCreator(imgcreate.creator.ImageCreator):
def __init__(self, cfg):
self.cfg = cfg
@@ -192,11 +203,12 @@ class LoopImageCreator(ImageCreator,imgcreate.creator.LoopImageCreator):
image_size_real_used = "%s %s" % revisor.misc.size_me(image_size)
image_size_real_notused = "%s %s" % revisor.misc.size_me(self.cfg.payload_livemedia)
self.log.debug(_("Setting self.cfg.payload_livemedia to %s (from 'part /' command in kickstart, instead of %s)") % (image_size_real_used,image_size_real_notused) , level=9)
- else:
+ elif not self.cfg.respin:
image_size_real_used = "%s %s" % revisor.misc.size_me(image_size)
image_size_real_notused = "%s %s" % revisor.misc.size_me(imgcreate.kickstart.get_image_size(self.ks, 0))
-
self.log.debug(_("Setting self.cfg.payload_livemedia to %s (from total installed size of RPMs, instead of %s)") % (image_size_real_used,image_size_real_notused), level=9)
+ else:
+ image_size = imgcreate.kickstart.get_image_size(self.ks, 0)
self.__image_size = image_size