Add mkdir support to template

Allow mkdir command in initrd template,
so we can specify directories we need
to create in install tree.
This commit is contained in:
Martin Gracik 2011-01-31 20:57:07 +01:00
parent 8d4be0f87c
commit cdff835357

View File

@ -229,6 +229,15 @@ class Lorax(BaseLoraxClass):
template = ltmpl.LoraxTemplate() template = ltmpl.LoraxTemplate()
template = template.parse(tfile, tvars) template = template.parse(tfile, tvars)
# get required directories
logger.info("creating tree directories")
dirs = [f[1:] for f in template if f[0] == "mkdir"]
dirs = itertools.chain.from_iterable(dirs)
# create directories
for d in dirs:
os.makedirs(joinpaths(self.installtree.root, d))
# get list of required packages # get list of required packages
logger.info("getting list of required packages") logger.info("getting list of required packages")
required = [f[1:] for f in template if f[0] == "install"] required = [f[1:] for f in template if f[0] == "install"]