~townsend/unity8-preview-lxc/fix-proc-automount

« back to all changes in this revision

Viewing changes to bin/unity8-lxc-setup

  • Committer: CI Train Bot
  • Author(s): Chris Townsend
  • Date: 2015-03-05 14:47:56 UTC
  • mfrom: (45.1.1 fix-zsync-cross-mount)
  • Revision ID: ci-train-bot@canonical.com-20150305144756-o3ss7wh6npbo2zw9
Fix issue where zsync doesn't seem to handle cross linking across filesystems and also detect if the ISO did not download and throw an error. Fixes: #1418671
Approved by: Stephen M. Webb

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
 
67
67
container = lxc.Container(CONTAINER_NAME)
68
 
rootfs_path = "%s/%s/rootfs" % (lxc.default_config_path, CONTAINER_NAME)
69
 
iso_filename = "%s/%s/ubuntu-next.iso" % (lxc.default_config_path,
70
 
                                          CONTAINER_NAME)
71
 
iso_path = "%s/%s/iso" % (lxc.default_config_path, CONTAINER_NAME)
72
 
squashfs_path = "%s/%s/squashfs" % (lxc.default_config_path, CONTAINER_NAME)
 
68
container_path = "%s/%s" % (lxc.default_config_path, CONTAINER_NAME)
 
69
rootfs_path = "%s/rootfs" % container_path
 
70
iso_filename = "%s/ubuntu-next.iso" % container_path
 
71
iso_path = "%s/iso" % container_path
 
72
squashfs_path = "%s/squashfs" % container_path
73
73
 
74
74
# Actions
75
75
generate_config = True
193
193
        iso_url = iso_url.replace("RELEASE", devel_release)
194
194
 
195
195
        ### Use zsync to fetch the ISO
196
 
        subprocess.call(["zsync", "-i", iso_filename, "-o", iso_filename, iso_url])
 
196
        cmd = "cd %s && zsync -i %s -o %s %s" % (container_path, iso_filename, iso_filename, iso_url)
 
197
        os.system(cmd)
197
198
 
198
199
        ### Remove the ISO backup since it's not needed
199
200
        if os.path.exists(iso_filename+".zs-old"):
200
201
            os.remove(iso_filename+".zs-old")
201
202
 
 
203
    if not os.path.exists(iso_filename):
 
204
        parser.error("No Unity 8 Desktop Next ISO exists!")
 
205
 
202
206
    ## Mount the ISO
203
207
    os.mkdir(iso_path)
204
208
    subprocess.call(["mount", "-o", "loop,ro", iso_filename, iso_path])