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:
parent
8d4be0f87c
commit
cdff835357
@ -229,6 +229,15 @@ class Lorax(BaseLoraxClass):
|
||||
template = ltmpl.LoraxTemplate()
|
||||
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
|
||||
logger.info("getting list of required packages")
|
||||
required = [f[1:] for f in template if f[0] == "install"]
|
||||
|
Loading…
Reference in New Issue
Block a user