Merge lp:~mvo/ubuntu-cdimage/mvo into lp:ubuntu-cdimage

Proposed by Michael Vogt
Status: Rejected
Rejected by: Steve Langasek
Proposed branch: lp:~mvo/ubuntu-cdimage/mvo
Merge into: lp:ubuntu-cdimage
Diff against target: 229 lines (+99/-23)
7 files modified
HACKING (+22/-0)
first-run.sh (+8/-0)
lib/cdimage/build.py (+5/-4)
lib/cdimage/livefs.py (+54/-17)
lib/cdimage/osextras.py (+4/-1)
lib/cdimage/tracker.py (+5/-0)
lib/cdimage/tree.py (+1/-1)
To merge this branch: bzr merge lp:~mvo/ubuntu-cdimage/mvo
Reviewer Review Type Date Requested Status
Steve Langasek Needs Resubmitting
Review via email: mp+228214@code.launchpad.net
To post a comment you must log in.
lp:~mvo/ubuntu-cdimage/mvo updated
1447. By Michael Vogt

merge from lp:ubuntu-cdimage

Revision history for this message
Steve Langasek (vorlon) wrote :

Unfortunately this "work in progress" branch is no longer appropriate to merge as-is (e.g. it tries to bzr checkouts of code bases that have moved to git). And now we are moving ubuntu-cdimage to git. So if there is anything here you still want landed, please resubmit it against git.

review: Needs Resubmitting

Unmerged revisions

1447. By Michael Vogt

merge from lp:ubuntu-cdimage

1446. By Michael Vogt

fix --subproject option

1445. By Michael Vogt

HACKING: updated

1444. By Michael Vogt

mention ./first-run.sh

1443. By Michael Vogt

remove debian-cd mention, thanks to Colin!

1442. By Michael Vogt

publish all daily-preinstaled as .tar.gz (not just ubuntu-touch)

1441. By Michael Vogt

WIP: UBUNTU_FORCE_LOCAL can create rootfs now with lp:~mvo/launchpad-buildd/mvo

1440. By Michael Vogt

merge latest changes

1439. By Michael Vogt

HACKING: add info about failures

1438. By Michael Vogt

HACKING: use local config instead of example config

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'HACKING'
2--- HACKING 1970-01-01 00:00:00 +0000
3+++ HACKING 2014-11-11 12:49:49 +0000
4@@ -0,0 +1,22 @@
5+Hacking on ubuntu-cdimage
6+=========================
7+
8+
9+Livefs based images
10+-------------------
11+If you want to test build livefs based image you need to run:
12+
13+$ sudo apt-get install procmail
14+ - lockfile is needed from procmail
15+$ ./first-run.sh
16+
17+Run:
18+$ export PATH=$(pwd)/bin:$PATH
19+create a chroot:
20+$ mkdir -p ~/build-ubuntu-core/chroot-autobuild/build
21+$ sudo debootstrap utopic ~/build-ubuntu-core/chroot-autobuild/
22+$ UBUNTU_FORCE_LOCAL=1 DEBUG=1 for-project ubuntu-core cron.daily-preinstalled --live
23+
24+
25+The resulting image(s) are available under ./scratch
26+etc/resolv.conf
27\ No newline at end of file
28
29=== added file 'first-run.sh'
30--- first-run.sh 1970-01-01 00:00:00 +0000
31+++ first-run.sh 2014-11-11 12:49:49 +0000
32@@ -0,0 +1,8 @@
33+#!/bin/sh
34+
35+for p in germinate britney ubuntu-archive-tools launchpad-buildd ; do
36+ if [ ! -d $p ]; then
37+ bzr branch lp:$p
38+ fi
39+done
40+
41
42=== modified file 'lib/cdimage/build.py'
43--- lib/cdimage/build.py 2014-10-10 10:52:42 +0000
44+++ lib/cdimage/build.py 2014-11-11 12:49:49 +0000
45@@ -186,7 +186,7 @@
46 if subprocess.call(
47 ["lockfile", "-!", "-l", "43200", "-r", "0", lock]) == 0:
48 raise Exception(
49- "%s is unable to start rsync; lock file exists." % fqdn)
50+ "%s is unable to start rsync; lock file %s exists." % (fqdn, lock))
51 try:
52 log_path = os.path.join(config.root, "log", "rsync.log")
53 osextras.ensuredir(os.path.dirname(log_path))
54@@ -200,7 +200,7 @@
55 exclude = env.get("RSYNC_EXCLUDE", "").split()
56 source_target = ["%s/" % env["RSYNC_SRC"], "%s/" % target]
57
58- subprocess.call(
59+ subprocess.check_call(
60 command_base + [
61 "--exclude", "Packages*", "--exclude", "Sources*",
62 "--exclude", "Release*", "--exclude", "InRelease",
63@@ -208,7 +208,7 @@
64 stdout=log, stderr=subprocess.STDOUT, env=env)
65
66 # Second pass to update metadata and clean up old files.
67- subprocess.call(
68+ subprocess.check_call(
69 command_base + [
70 "--delay-updates", "--delete", "--delete-after",
71 ] + exclude + source_target,
72@@ -486,9 +486,10 @@
73 print("tar archive", file=f)
74 shutil.copy2(
75 "%s.manifest" % live_prefix, "%s.manifest" % output_prefix)
76- if config.project == "ubuntu-touch":
77+ if config.image_type == "daily-preinstalled":
78 osextras.link_force(
79 "%s.raw" % output_prefix, "%s.tar.gz" % output_prefix)
80+ if config.project == "ubuntu-touch":
81 add_android_support(config, arch, output_dir)
82 custom = "%s.custom.tar.gz" % live_prefix
83 if os.path.exists(custom):
84
85=== modified file 'lib/cdimage/livefs.py'
86--- lib/cdimage/livefs.py 2014-10-10 10:46:16 +0000
87+++ lib/cdimage/livefs.py 2014-11-11 12:49:49 +0000
88@@ -158,6 +158,28 @@
89
90 return liveproject
91
92+def live_build_command_buildlivefs(config, arch):
93+ command = ["./launchpad-buildd/buildlivefs"]
94+ command.append("--build-id=%s" % live_project(config, arch))
95+ if config["UBUNTU_DEFAULTS_LOCALE"]:
96+ command.append("--locale=%s" % config["UBUNTU_DEFAULTS_LOCALE"])
97+ if config.project in ("ubuntu-core", "ubuntu-touch"):
98+ command.append("--image-format=plain")
99+ cpuarch, subarch = split_arch(arch)
100+ if cpuarch:
101+ command.extend(["--arch", cpuarch])
102+ if subarch:
103+ command.extend(["--subarch", subarch])
104+ if config["PROPOSED"]:
105+ command.append("--proposed")
106+ if config.series:
107+ command.extend(["--series", config.series])
108+ command.append("--project=%s" % config.project)
109+ if config.subproject:
110+ command.extend(["--subproject", config.subproject])
111+ command.append(live_project(config, arch))
112+ return command
113+
114
115 def live_build_command(config, arch):
116 command = [
117@@ -354,22 +376,34 @@
118 continue
119 full_name = live_build_full_name(config, arch)
120 timestamp = time.strftime("%F %T")
121- lp, lp_livefs = get_lp_livefs(config, arch)
122- if lp_livefs is None:
123- machine = live_builder(config, arch)
124- else:
125- machine = "Launchpad"
126- logger.info(
127- "%s on %s starting at %s" % (full_name, machine, timestamp))
128- tracker_set_rebuild_status(config, [0, 1], 2, arch)
129- if lp_livefs is not None:
130- lp_kwargs = live_build_lp_kwargs(config, lp, lp_livefs, arch)
131- lp_build = lp_livefs.requestBuild(**lp_kwargs)
132- logger.info("%s: %s" % (full_name, lp_build.web_link))
133- lp_builds.append((lp_build, arch, full_name, machine, None))
134- else:
135- proc = subprocess.Popen(live_build_command(config, arch))
136+
137+ if os.environ.get("UBUNTU_FORCE_LOCAL", ""):
138+ machine = "local"
139+ name = live_project(config, arch)
140+ basedir = os.path.expanduser(
141+ "~/build-%s/chroot-autobuild/build/" % name)
142+ config["LIVECD_BASE"] = basedir
143+ proc = subprocess.Popen(
144+ live_build_command_buildlivefs(config, arch))
145 builds[proc.pid] = (proc, arch, full_name, machine)
146+ else:
147+ lp, lp_livefs = get_lp_livefs(config, arch)
148+ if lp_livefs is None:
149+ machine = live_builder(config, arch)
150+ else:
151+ machine = "Launchpad"
152+ logger.info(
153+ "%s on %s starting at %s" % (full_name, machine, timestamp))
154+ tracker_set_rebuild_status(config, [0, 1], 2, arch)
155+
156+ if lp_livefs is not None:
157+ lp_kwargs = live_build_lp_kwargs(config, lp, lp_livefs, arch)
158+ lp_build = lp_livefs.requestBuild(**lp_kwargs)
159+ logger.info("%s: %s" % (full_name, lp_build.web_link))
160+ lp_builds.append((lp_build, arch, full_name, machine, None))
161+ else:
162+ proc = subprocess.Popen(live_build_command(config, arch))
163+ builds[proc.pid] = (proc, arch, full_name, machine)
164
165 successful = set()
166
167@@ -606,8 +640,11 @@
168 liveproject_subarch = "%s-%s" % (liveproject, subarch)
169 else:
170 liveproject_subarch = liveproject
171-
172- lp, lp_livefs = get_lp_livefs(config, arch)
173+
174+ if os.environ.get("UBUNTU_FORCE_LOCAL", ""):
175+ lp, lp_livefs = None, None
176+ else:
177+ lp, lp_livefs = get_lp_livefs(config, arch)
178 if lp_livefs is not None:
179 lp_kwargs = live_build_lp_kwargs(config, lp, lp_livefs, arch)
180 lp_build = lp_livefs.getLatestBuild(
181
182=== modified file 'lib/cdimage/osextras.py'
183--- lib/cdimage/osextras.py 2014-05-28 09:18:44 +0000
184+++ lib/cdimage/osextras.py 2014-11-11 12:49:49 +0000
185@@ -144,7 +144,10 @@
186 raise FetchError("empty source URL (downloading to %s)" % target)
187
188 if source.startswith("/"):
189- os.link(source, target)
190+ try:
191+ os.link(source, target)
192+ except OSError as e:
193+ raise FetchError("Can not link %s->%s: %s" % (source, target, e))
194 return
195
196 # Match lazr.restfulclient, for convenience when working with
197
198=== modified file 'lib/cdimage/tracker.py'
199--- lib/cdimage/tracker.py 2014-10-30 10:00:49 +0000
200+++ lib/cdimage/tracker.py 2014-11-11 12:49:49 +0000
201@@ -17,6 +17,7 @@
202
203 """QATracker integration functions."""
204
205+import os
206 import xmlrpclib
207
208 from cdimage.log import logger
209@@ -35,6 +36,10 @@
210 except ImportError:
211 # Become a no-op if the isotracker module can't be found
212 return
213+ # iso tracker runs sys.exit(1) *inside* the ISOTracker class
214+ # if this file does not exist
215+ if not os.path.exists(os.path.expanduser('~/.isotracker.conf')):
216+ return
217
218 if not arches:
219 arches = config.arches
220
221=== modified file 'lib/cdimage/tree.py'
222--- lib/cdimage/tree.py 2014-10-30 11:30:48 +0000
223+++ lib/cdimage/tree.py 2014-11-11 12:49:49 +0000
224@@ -1,4 +1,4 @@
225-# -*- coding: UTF-8 -*-
226+# -*- coding: utf-8 -*-
227
228 # Copyright (C) 2012, 2013 Canonical Ltd.
229 # Author: Colin Watson <cjwatson@ubuntu.com>

Subscribers

People subscribed via source and target branches