~smoser/curtin/doc-updates

« back to all changes in this revision

Viewing changes to curtin/commands/curthooks.py

  • Committer: Scott Moser
  • Date: 2014-06-12 17:14:27 UTC
  • mfrom: (129.1.7 curtin)
  • Revision ID: smoser@ubuntu.com-20140612171427-n3y79mlosyehc52q
add support for disk images

Disk images (as opposed to root-filesystem tarfiles) can now be used.
The expected input would be created with something like:
 dd if=/dev/sda of=my.img
 tar -Scvzf my.img.tar.gz my.img

Ie, its a single file inside a tar file (for sparseness).

command line urls can be prefixed with 'dd:' to explicitly specify that
this is a dd image.  This can be specified in config.

sources:
 05_primary:
  uri: "http://example.com/ubuntu-12.04-server-cloudimg-amd64-root.tar.gz"
  type: "tgz"

* old config and command line variants still work, and default to tgz
  curt-hooks, net-meta will now look for os.path.join(target, '/curtin',
  hook_name) before executing the buitin. If a hook is present, then the
  builtin will not be executed.
  * curthooks --> curtin-hooks
  * net-meta --> network-config

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
                         "Use --target or set TARGET_MOUNT_POINT\n")
369
369
        sys.exit(2)
370
370
 
 
371
    # if network-config hook exists in target,
 
372
    # we do not run the builtin
 
373
    if util.run_hook_if_exists(target, 'curtin-hooks'):
 
374
        sys.exit(0)
 
375
 
371
376
    cfg = util.load_command_config(args, state)
372
377
 
373
378
    write_files(cfg, target)