From 64428ce76de42bb29cdcb355181727310a035d2a Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Mon, 26 Nov 2012 16:05:16 +0800 Subject: [PATCH] fix local repo unavailable in bootstrap Signed-off-by: Gui Chen --- mic/conf.py | 7 +++++++ mic/rt_util.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/mic/conf.py b/mic/conf.py index 153f139..82d9049 100644 --- a/mic/conf.py +++ b/mic/conf.py @@ -61,6 +61,7 @@ class ConfigMgr(object): "no_proxy": None, "copy_kernel": False, "repourl": {}, + "localrepos": [], # save localrepos "runtime": "bootstrap", }, 'chroot': { @@ -190,6 +191,12 @@ class ConfigMgr(object): if not ksrepos: raise errors.KsError('no valid repos found in ks file') + for repo in ksrepos: + if 'baseurl' in repo and repo['baseurl'].startswith("file:"): + repourl = repo['baseurl'].replace('file:', '') + repourl = "/%s" % repourl.lstrip('/') + self.create['localrepos'].append(repourl) + self.create['repomd'] = misc.get_metadata_from_repos( ksrepos, self.create['cachedir']) diff --git a/mic/rt_util.py b/mic/rt_util.py index e91feb4..6dfbbb2 100644 --- a/mic/rt_util.py +++ b/mic/rt_util.py @@ -104,6 +104,9 @@ def get_bindmounts(cropts): configmgr._ksconf, ] + for lrepo in cropts['localrepos']: + binddirs.append(lrepo) + bindlist = map(expath, filter(None, binddirs)) bindlist += map(os.path.dirname, map(expath, filter(None, bindfiles))) bindlist = sorted(set(bindlist)) -- 2.7.4