From b73132af75f93354a9bd444bf00e0865ccee2105 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Thu, 23 Jun 2011 10:46:28 -0400 Subject: [PATCH] rename "runtime" template arg to "runtime_img" Mako uses "runtime" internally for things, and if you clobber it stuff will just break in weird ways. So don't do that. --- share/ppc.tmpl | 2 +- share/s390.tmpl | 2 +- share/sparc.tmpl | 4 ++-- share/x86.tmpl | 4 ++-- src/pylorax/treebuilder.py | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/share/ppc.tmpl b/share/ppc.tmpl index 8ec2946c..52ed197c 100644 --- a/share/ppc.tmpl +++ b/share/ppc.tmpl @@ -16,7 +16,7 @@ macboot = "" %> mkdir images -install ${runtime} images +install ${runtime_img} images mkdir ${BOOTDIR} ${BOOTDIR}/chrp etc install ${ANABOOTDIR}/bootinfo.txt ${BOOTDIR} diff --git a/share/s390.tmpl b/share/s390.tmpl index c58f8d46..8ab4621c 100644 --- a/share/s390.tmpl +++ b/share/s390.tmpl @@ -9,7 +9,7 @@ kernel = kernels[0] %> mkdir images -install ${runtime} images +install ${runtime_img} images install ${ANABOOTDIR}/redhat.exec ${BOOTDIR} install ${ANABOOTDIR}/generic.prm ${BOOTDIR} diff --git a/share/sparc.tmpl b/share/sparc.tmpl index faeff017..858995a9 100644 --- a/share/sparc.tmpl +++ b/share/sparc.tmpl @@ -5,7 +5,7 @@ KERNELDIR=BOOTDIR %> mkdir images -install ${runtime} images +install ${runtime_img} images install boot/*.b ${BOOTDIR} install ${ANABOOTDIR}/silo.conf ${BOOTDIR} @@ -26,5 +26,5 @@ runcmd mkisofs -R -J -T -G /${BOOTDIR}/isofs.b -B ... \ -sparc-label "${product.name} ${product.version} Boot Disc" \ -o ${outroot}/images/boot.iso \ -graft-points boot=${outroot}/${BOOTDIR} \ - ${runtime}=${outroot}/${runtime} + ${runtime_img}=${outroot}/${runtime_img} treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/share/x86.tmpl b/share/x86.tmpl index c43a9787..d6184a8a 100644 --- a/share/x86.tmpl +++ b/share/x86.tmpl @@ -7,7 +7,7 @@ KERNELDIR=PXEBOOTDIR %> mkdir images -install ${runtime} images +install ${runtime_img} images mkdir ${BOOTDIR} ${KERNELDIR} install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR} @@ -66,7 +66,7 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \ ${efiargs} -R -J -V '${product.name}' -T -graft-points \ ${BOOTDIR}=${outroot}/${BOOTDIR} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \ - ${runtime}=${outroot}/${runtime} \ + ${runtime_img}=${outroot}/${runtime_img} \ ${efigraft} runcmd isohybrid ${outroot}/images/boot.iso treeinfo images-${basearch} boot.iso images/boot.iso diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index ad155bc4..28414f6f 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -143,8 +143,10 @@ class TreeBuilder(object): '''Builds the arch-specific boot images. inroot should be the installtree root (the newly-built runtime dir)''' def __init__(self, product, arch, inroot, outroot, runtime, templatedir=None): + # NOTE: if you pass an arg named "runtime" to a mako template it'll + # clobber some mako internal variables - hence "runtime_img". v = DataHolder(arch=arch, product=product, - inroot=inroot, outroot=outroot, runtime=runtime, + inroot=inroot, outroot=outroot, runtime_img=runtime, basearch=arch.basearch, libdir=arch.libdir, exists = lambda p: _exists(p, root=inroot)) self.vars = v