diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index d842b0f7..758d6563 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -181,6 +181,15 @@ class Lorax(BaseLoraxClass): self.product = product logger.debug("product data: %s" % product) + # NOTE: if you change isolabel, you need to change pungi to match, or + # the pungi images won't boot. + isolabel = volid or "{0.name} {0.version} {1.basearch}".format(self.product, + self.arch) + + if len(isolabel) > 32: + logger.fatal("the volume id cannot be longer than 32 characters") + sys.exit(1) + templatedir = self.conf.get("lorax", "sharedir") # NOTE: rb.root = ybo.conf.installroot (== self.inroot) rb = RuntimeBuilder(product=self.product, arch=self.arch, @@ -235,8 +244,8 @@ class Lorax(BaseLoraxClass): logger.info("preparing to build output tree and boot images") treebuilder = TreeBuilder(product=self.product, arch=self.arch, inroot=installroot, outroot=self.outputdir, - runtime=runtime, templatedir=templatedir, - volid=volid) + runtime=runtime, isolabel=isolabel, + templatedir=templatedir) logger.info("rebuilding initramfs images") dracut_args=["--xz", "--add", "livenet", "--add", "convertfs", "--omit", "plymouth"] diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 686db1e9..2e3c47fc 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -151,11 +151,7 @@ class RuntimeBuilder(object): 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, volid=None): - # NOTE: if you change isolabel, you need to change pungi to match, or - # the pungi images won't boot. - isolabel = volid or "{0.name} {0.version} {1.basearch}".format(product, arch) - + def __init__(self, product, arch, inroot, outroot, runtime, isolabel, templatedir=None): # NOTE: if you pass an arg named "runtime" to a mako template it'll # clobber some mako internal variables - hence "runtime_img". self.vars = DataHolder(arch=arch, product=product, runtime_img=runtime,