summaryrefslogtreecommitdiffstats
path: root/scripts/lib/mic/conf.py
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2013-09-19 04:32:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-01 22:56:03 +0100
commit75c143a7aef46ecea07cf33edd2b1a0192e10149 (patch)
treefe0eb61a0dfda72e52b01385129f6282814581b6 /scripts/lib/mic/conf.py
parent9fc88f96d40b17c90bac53b90045a87b2d2cff84 (diff)
downloadast2050-yocto-poky-75c143a7aef46ecea07cf33edd2b1a0192e10149.zip
ast2050-yocto-poky-75c143a7aef46ecea07cf33edd2b1a0192e10149.tar.gz
wic: Add OpenEmbedded-specific implementation
Reuses the mic/livecd infrastructure but heavily subclasses and modifies it to adapt to the special needs of building images from existing OpenEmbedded build artifacts. In addition to the OE-specific mic objects and modifications to the underlying infrastructure, this adds a mechanism to allow OE kickstart files to be 'canned' and made available to users via the 'wic list images' command. Two initial OE kickstart files have been added as canned .wks files: directdisk, which implements the same thing as the images created by directdisk.bbclass, and mkefidisk, which can essentially be used as a replacement for mkefidisk.sh. Of course, since creation of these images are now driven by .wks files rather than being hard-coded into class files or scripts, they can be easily modified to generate different variations on those images. They also don't require root priveleges, since they don't use mount to create the images. They don't however write to media like mkefidisk.sh does, but rather create images that can be written onto media. (From OE-Core rev: f87acc5e59d3c2c39ff171b5557977dab4c8f4a6) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/conf.py')
-rw-r--r--scripts/lib/mic/conf.py54
1 files changed, 8 insertions, 46 deletions
diff --git a/scripts/lib/mic/conf.py b/scripts/lib/mic/conf.py
index e37334c..58fad51 100644
--- a/scripts/lib/mic/conf.py
+++ b/scripts/lib/mic/conf.py
@@ -23,29 +23,24 @@ from mic import kickstart
from mic.utils import misc, runner, proxy, errors
-DEFAULT_GSITECONF = '/etc/mic/mic.conf'
-
-
def get_siteconf():
mic_path = os.path.dirname(__file__)
+ eos = mic_path.find('scripts') + len('scripts')
+ scripts_path = mic_path[:eos]
- m = re.match(r"(?P<prefix>.*)\/lib(64)?\/.*", mic_path)
- if m and m.group('prefix') != "/usr":
- return os.path.join(m.group('prefix'), "etc/mic/mic.conf")
-
- return DEFAULT_GSITECONF
+ return scripts_path + "/lib/image/config/wic.conf"
class ConfigMgr(object):
prefer_backends = ["zypp", "yum"]
DEFAULTS = {'common': {
"distro_name": "Default Distribution",
- "plugin_dir": "/usr/lib/mic/plugins", # TODO use prefix also?
+ "plugin_dir": "/usr/lib/wic/plugins", # TODO use prefix also?
},
'create': {
- "tmpdir": '/var/tmp/mic',
- "cachedir": '/var/tmp/mic/cache',
- "outdir": './mic-output',
+ "tmpdir": '/var/tmp/wic',
+ "cachedir": '/var/tmp/wic/cache',
+ "outdir": './wic-output',
"arch": None, # None means auto-detect
"pkgmgr": "auto",
@@ -75,7 +70,7 @@ class ConfigMgr(object):
"shell": False,
},
'bootstrap': {
- "rootdir": '/var/tmp/mic-bootstrap',
+ "rootdir": '/var/tmp/wic-bootstrap',
"packages": [],
},
}
@@ -191,39 +186,6 @@ class ConfigMgr(object):
self.create['name_prefix'],
self.create['name_suffix'])
- msger.info("Retrieving repo metadata:")
- ksrepos = misc.get_repostrs_from_ks(ks)
- 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'])
- msger.raw(" DONE")
-
- target_archlist, archlist = misc.get_arch(self.create['repomd'])
- if self.create['arch']:
- if self.create['arch'] not in archlist:
- raise errors.ConfigError("Invalid arch %s for repository. "
- "Valid arches: %s" \
- % (self.create['arch'], ', '.join(archlist)))
- else:
- if len(target_archlist) == 1:
- self.create['arch'] = str(target_archlist[0])
- msger.info("\nUse detected arch %s." % target_archlist[0])
- else:
- raise errors.ConfigError("Please specify a valid arch, "
- "the choice can be: %s" \
- % ', '.join(archlist))
-
- kickstart.resolve_groups(self.create, self.create['repomd'])
-
# check selinux, it will block arm and btrfs image creation
misc.selinux_check(self.create['arch'],
[p.fstype for p in ks.handler.partition.partitions])
OpenPOWER on IntegriCloud