treebuilder fixups: fix rb.postinstall(), inroot/root confusion
This commit is contained in:
parent
7feb3d4572
commit
bf9ca1ddc7
@ -183,7 +183,7 @@ class Lorax(BaseLoraxClass):
|
|||||||
logger.debug("product data: %s" % product)
|
logger.debug("product data: %s" % product)
|
||||||
|
|
||||||
templatedir = self.conf.get("lorax", "sharedir")
|
templatedir = self.conf.get("lorax", "sharedir")
|
||||||
rb = RuntimeBuilder(self.product, self.arch, self.outputdir, ybo, templatedir)
|
rb = RuntimeBuilder(self.product, self.arch, ybo, templatedir)
|
||||||
|
|
||||||
logger.info("installing runtime packages")
|
logger.info("installing runtime packages")
|
||||||
rb.yum.conf.skip_broken = self.conf.getboolean("yum", "skipbroken")
|
rb.yum.conf.skip_broken = self.conf.getboolean("yum", "skipbroken")
|
||||||
@ -204,7 +204,7 @@ class Lorax(BaseLoraxClass):
|
|||||||
fobj.write("{0}\n".format(fname))
|
fobj.write("{0}\n".format(fname))
|
||||||
|
|
||||||
logger.info("doing post-install configuration")
|
logger.info("doing post-install configuration")
|
||||||
rb.postinstall()
|
rb.postinstall() # FIXME: configdir=
|
||||||
|
|
||||||
# write .discinfo
|
# write .discinfo
|
||||||
discinfo = DiscInfo(self.product.release, self.arch.basearch)
|
discinfo = DiscInfo(self.product.release, self.arch.basearch)
|
||||||
|
@ -88,15 +88,14 @@ class TemplateParser(object):
|
|||||||
return t.parse(templatefile, variables)
|
return t.parse(templatefile, variables)
|
||||||
|
|
||||||
class RuntimeBuilder(object):
|
class RuntimeBuilder(object):
|
||||||
'''Builds the anaconda runtime image.
|
'''Builds the anaconda runtime image.'''
|
||||||
inroot will be the same as outroot, so 'install' == 'copy'.'''
|
|
||||||
# XXX product.name = product.name.lower()?
|
# XXX product.name = product.name.lower()?
|
||||||
def __init__(self, product, arch, outroot, yum, templatedir=None):
|
def __init__(self, product, arch, yum, templatedir=None):
|
||||||
v = DataHolder(arch=arch, product=product, yum=yum,
|
root = yum.conf.installroot
|
||||||
outroot=outroot, inroot=outroot, root=outroot,
|
v = DataHolder(arch=arch, product=product, yum=yum, root=root,
|
||||||
basearch=arch.basearch, libdir=arch.libdir,
|
basearch=arch.basearch, libdir=arch.libdir,
|
||||||
exists = lambda p: _exists(p, root=self.root),
|
exists = lambda p: _exists(p, root=root),
|
||||||
glob = lambda g: _glob(g, root=self.root, Fatal=False))
|
glob = lambda g: _glob(g, root=root, Fatal=False))
|
||||||
self.vars = v
|
self.vars = v
|
||||||
self.yum = yum
|
self.yum = yum
|
||||||
self.templatedir = templatedir
|
self.templatedir = templatedir
|
||||||
@ -104,7 +103,7 @@ class RuntimeBuilder(object):
|
|||||||
def runtemplate(self, templatefile, **variables):
|
def runtemplate(self, templatefile, **variables):
|
||||||
parser = TemplateParser(self.templatedir, self.vars)
|
parser = TemplateParser(self.templatedir, self.vars)
|
||||||
template = parser.parse(templatefile, variables)
|
template = parser.parse(templatefile, variables)
|
||||||
runner = TemplateRunner(self.vars.inroot, self.vars.outroot, self.vars.yum)
|
runner = TemplateRunner(self.vars.root, self.vars.root, self.vars.yum)
|
||||||
runner.run(template)
|
runner.run(template)
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
@ -113,10 +112,10 @@ class RuntimeBuilder(object):
|
|||||||
|
|
||||||
def postinstall(self, configdir="/usr/share/lorax/config_files"):
|
def postinstall(self, configdir="/usr/share/lorax/config_files"):
|
||||||
'''Do some post-install setup work with runtime-postinstall.tmpl'''
|
'''Do some post-install setup work with runtime-postinstall.tmpl'''
|
||||||
# link configdir into outroot beforehand
|
# link configdir into runtime root beforehand
|
||||||
configdir_outroot = "tmp/config_files"
|
configdir_path = "tmp/config_files"
|
||||||
linktree(configdir, join(self.vars.outroot, configdir_outroot))
|
linktree(configdir, join(self.vars.root, configdir_path))
|
||||||
self.runtemplate("runtime-postinstall.tmpl", configdir=configdir_outroot)
|
self.runtemplate("runtime-postinstall.tmpl", configdir=configdir_path)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
'''Remove unneeded packages and files with runtime-cleanup.tmpl'''
|
'''Remove unneeded packages and files with runtime-cleanup.tmpl'''
|
||||||
@ -163,9 +162,9 @@ class TreeBuilder(object):
|
|||||||
inroot should be the installtree root (the newly-built runtime dir)'''
|
inroot should be the installtree root (the newly-built runtime dir)'''
|
||||||
def __init__(self, product, arch, inroot, outroot, templatedir=None):
|
def __init__(self, product, arch, inroot, outroot, templatedir=None):
|
||||||
v = DataHolder(arch=arch, product=product,
|
v = DataHolder(arch=arch, product=product,
|
||||||
inroot = inroot, outroot=outroot,
|
inroot=inroot, outroot=outroot,
|
||||||
basearch=arch.basearch, libdir=arch.libdir,
|
basearch=arch.basearch, libdir=arch.libdir,
|
||||||
exists = lambda p: _exists(p, root=self.root))
|
exists = lambda p: _exists(p, root=inroot))
|
||||||
self.vars = v
|
self.vars = v
|
||||||
self.templatedir = templatedir
|
self.templatedir = templatedir
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user