From cd339589cc2748f4d74c6b0a3ea4ca0fca77c292 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Sun, 9 Jan 2011 12:50:39 +0100 Subject: [PATCH] Add the initd and kernel lines to .treeinfo --- src/pylorax/__init__.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 057800cc..315693cd 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -378,6 +378,10 @@ class Lorax(BaseLoraxClass): logger.info("cleaning up python files") self.installtree.cleanup_python_files() + # create .treeinfo + treeinfo = TreeInfo(self.workdir, self.product, self.version, + self.variant, self.basearch) + # compress install tree (create initrd) initrds = [] for kernel in self.outputtree.kernels: @@ -402,6 +406,13 @@ class Lorax(BaseLoraxClass): initrds.append(initrd) + # add kernel and initrd paths to .treeinfo + section = "images{0}".format(suffix or ("-" + self.basearch)) + data = {"kernel": "images/pxeboot/{0}".format(kernel.fname)} + treeinfo.add_section(section, data) + data = {"initrd": "images/pxeboot/{0}".format(initrd.fname)} + treeinfo.add_section(section, data) + # copy initrds to outputtree shutil.copy2(initrds[0].fpath, self.outputtree.isolinuxdir) @@ -460,12 +471,8 @@ class Lorax(BaseLoraxClass): shutil.move(bootiso, self.outputtree.imgdir) - # write .treeinfo - treeinfo = TreeInfo(self.workdir, self.product, self.version, - self.variant, self.basearch) - # add the boot.iso - section = "general" + section = "images-{0}".format(self.basearch) data = {"boot.iso": "images/{0}".format(os.path.basename(bootiso))} treeinfo.add_section(section, data)