~ubuntu-branches/ubuntu/utopic/curtin/utopic

« back to all changes in this revision

Viewing changes to curtin/commands/install.py

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2014-07-22 18:53:38 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140722185338-2nm6ekaottq6ldge
Tags: 0.1.0~bzr142-0ubuntu1
* New upstream snapshot.
  * add utility for parsing /etc/network/interfaces
  * aarm64 support [Newell Jensen]
    * run update-initramfs in aarm64
    * create boot partition when necessary (LP: #1338851 LP: #1340942)
  * know kernel mapping for utopic (3.16)
  * properly write fstype into /etc/fstab per provided fstype
  * add support for disk images as type 'dd-tgz'
  * correctly call finalize in target (LP: #1328521)
  * support invoking tar with --xattrs if available (LP: #1307636)
  * increase size of uefi partition to 512M (LP: #1306164)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from . import populate_one_subcmd
31
31
 
 
32
 
32
33
CONFIG_BUILTIN = {
33
34
    'sources': {},
34
35
    'stages': ['early', 'partitioning', 'network', 'extract', 'curthooks',
35
36
               'hook', 'late'],
36
37
    'extract_commands': {'builtin': ['curtin', 'extract']},
37
38
    'hook_commands': {'builtin': ['curtin', 'hook']},
38
 
    'partitioning_commands': {'builtin': ['curtin', 'block-meta', 'simple']},
 
39
    'partitioning_commands': {
 
40
        'builtin': ['curtin', 'block-meta', 'simple']},
39
41
    'curthooks_commands': {'builtin': ['curtin', 'curthooks']},
40
42
    'late_commands': {'builtin': []},
41
43
    'network_commands': {'builtin': ['curtin', 'net-meta', 'auto']},
234
236
            config.merge_cmdarg(cfg, val)
235
237
 
236
238
    for source in args.source:
237
 
        cfg['sources']["%02d_cmdline" % len(cfg['sources'])] = source
 
239
        src = util.sanitize_source(source)
 
240
        cfg['sources']["%02d_cmdline" % len(cfg['sources'])] = src
238
241
 
239
242
    LOG.debug("merged config: %s" % cfg)
240
243
    if not len(cfg.get('sources', [])):
241
244
        raise util.BadUsage("no sources provided to install")
242
245
 
 
246
    for i in cfg['sources']:
 
247
        # we default to tgz for old style sources config
 
248
        cfg['sources'][i] = util.sanitize_source(cfg['sources'][i])
 
249
 
243
250
    if cfg.get('http_proxy'):
244
251
        os.environ['http_proxy'] = cfg['http_proxy']
245
252
 
246
253
    try:
 
254
        dd_images = util.get_dd_images(cfg.get('sources', {}))
 
255
        if len(dd_images) > 1:
 
256
            raise ValueError("You may not use more then one disk image")
247
257
        workingd = WorkingDir(cfg)
248
258
        LOG.debug(workingd.env())
249
259
 
263
273
    finally:
264
274
        for d in ('sys', 'dev', 'proc'):
265
275
            util.do_umount(os.path.join(workingd.target, d))
 
276
        if util.is_mounted(workingd.target, 'boot'):
 
277
            util.do_umount(os.path.join(workingd.target, 'boot'))
266
278
        util.do_umount(workingd.target)
267
279
        shutil.rmtree(workingd.top)
268
280