summaryrefslogtreecommitdiff
path: root/mic/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'mic/conf.py')
-rwxr-xr-x[-rw-r--r--]mic/conf.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mic/conf.py b/mic/conf.py
index d844c65..9299cfe 100644..100755
--- a/mic/conf.py
+++ b/mic/conf.py
@@ -71,10 +71,14 @@ class ConfigMgr(object):
"check_pkgs": [],
"repourl": {},
"localrepos": [], # save localrepos
+ "localtpkrepos":[],
"runtime": "bootstrap",
"extrarepos": {},
"ignore_ksrepo": False,
"strict_mode": False,
+ "run_script": None,
+ "tpk_install": None,
+ "use_mic_in_bootstrap": False,
},
'chroot': {
"saveto": None,
@@ -192,6 +196,13 @@ class ConfigMgr(object):
packages = packages.split()
self.bootstrap['packages'] = packages
+ if type(self.create['use_mic_in_bootstrap']) != 'bool':
+ use_mic_in_bootstrap = str(self.create['use_mic_in_bootstrap'])
+ if use_mic_in_bootstrap.lower() in ('on', 'yes', 'true', '1'):
+ self.create['use_mic_in_bootstrap'] = True
+ else:
+ self.create['use_mic_in_bootstrap'] = False
+
def _parse_kickstart(self, ksconf=None):
if not ksconf:
return
@@ -216,6 +227,12 @@ class ConfigMgr(object):
self.create['release'],
self.create['name'])
self.create['name'] = self.create['release'] + '_' + self.create['name']
+ if self.create['pack_to'] is not None:
+ if '@NAME@' in self.create['pack_to']:
+ self.create['pack_to'] = self.create['pack_to'].replace('@NAME@', self.create['name'])
+ self.create['name'] = misc.strip_archive_suffix(self.create['pack_to'])
+ if self.create['name'] is None:
+ raise errors.CreatorError("Not supported archive file format: %s" % self.create['pack_to'])
if not self.create['logfile']:
self.create['logfile'] = os.path.join(self.create['destdir'],
@@ -223,6 +240,13 @@ class ConfigMgr(object):
self.create['releaselog'] = True
self.set_logfile()
+ elif self.create['pack_to'] is not None:
+ if '@NAME@' in self.create['pack_to']:
+ self.create['pack_to'] = self.create['pack_to'].replace('@NAME@', self.create['name'])
+ self.create['name'] = misc.strip_archive_suffix(self.create['pack_to'])
+ if self.create['name'] is None:
+ raise errors.CreatorError("Not supported archive file format: %s" % self.create['pack_to'])
+
msger.info("Retrieving repo metadata:")
ksrepos = kickstart.get_repos(ks,
self.create['extrarepos'],
@@ -239,6 +263,14 @@ class ConfigMgr(object):
self.create['repomd'] = misc.get_metadata_from_repos(
ksrepos,
self.create['cachedir'])
+ kstpkrepos = kickstart.get_tpkrepos(ks)
+ if kstpkrepos:
+ for tpk_repo in kstpkrepos:
+ if hasattr(tpk_repo,'baseurl') and tpk_repo.baseurl.startswith("file:"):
+ tpk_repourl = tpk_repo.baseurl.replace('file:','')
+ tpk_repourl = "/%s" % tpk_repourl.lstrip('/')
+ self.create['localtpkrepos'].append(tpk_repourl)
+
msger.raw(" DONE")
target_archlist, archlist = misc.get_arch(self.create['repomd'])