Merge lp:~brian-murray/ubuntu-release-upgrader/remove-aufs into lp:ubuntu-release-upgrader
- remove-aufs
- Merge into trunk
Proposed by
Brian Murray
Status: | Merged |
---|---|
Merged at revision: | 3053 |
Proposed branch: | lp:~brian-murray/ubuntu-release-upgrader/remove-aufs |
Merge into: | lp:ubuntu-release-upgrader |
Diff against target: |
480 lines (+9/-352) 8 files modified
DistUpgrade/DistUpgradeAufs.py (+0/-289) DistUpgrade/DistUpgradeController.py (+0/-25) DistUpgrade/DistUpgradeMain.py (+2/-5) DistUpgrade/DistUpgradeView.py (+0/-15) data/DistUpgrade.cfg (+0/-11) data/do-release-upgrade.8 (+0/-3) debian/changelog (+7/-0) do-release-upgrade (+0/-4) |
To merge this branch: | bzr merge lp:~brian-murray/ubuntu-release-upgrader/remove-aufs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Approve | ||
Review via email: mp+324216@code.launchpad.net |
Commit message
Description of the change
I spoke with Michael about the --sandbox option failing and he recommended just removing the aufs support so I did.
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote : | # |
Okay, I'll make that change.
- 3054. By Brian Murray
-
Remove error handling for AUFS option in environ.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file 'DistUpgrade/DistUpgradeAufs.py' | |||
2 | --- DistUpgrade/DistUpgradeAufs.py 2015-01-20 22:44:02 +0000 | |||
3 | +++ DistUpgrade/DistUpgradeAufs.py 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,289 +0,0 @@ | |||
5 | 1 | # DistUpgradeAufs.py | ||
6 | 2 | # | ||
7 | 3 | # Copyright (c) 2009-2012 Canonical | ||
8 | 4 | # | ||
9 | 5 | # Author: Michael Vogt <michael.vogt@ubuntu.com> | ||
10 | 6 | # | ||
11 | 7 | # This program is free software; you can redistribute it and/or | ||
12 | 8 | # modify it under the terms of the GNU General Public License as | ||
13 | 9 | # published by the Free Software Foundation; either version 2 of the | ||
14 | 10 | # License, or (at your option) any later version. | ||
15 | 11 | # | ||
16 | 12 | # This program is distributed in the hope that it will be useful, | ||
17 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | 15 | # GNU General Public License for more details. | ||
20 | 16 | # | ||
21 | 17 | # You should have received a copy of the GNU General Public License | ||
22 | 18 | # along with this program; if not, write to the Free Software | ||
23 | 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
24 | 20 | # USA | ||
25 | 21 | |||
26 | 22 | import logging | ||
27 | 23 | import os | ||
28 | 24 | import subprocess | ||
29 | 25 | import tempfile | ||
30 | 26 | |||
31 | 27 | |||
32 | 28 | def aufsOptionsAndEnvironmentSetup(options, config): | ||
33 | 29 | """ setup the environment based on the config and options | ||
34 | 30 | It will use | ||
35 | 31 | config("Aufs","Enabled") - to show if its enabled | ||
36 | 32 | and | ||
37 | 33 | config("Aufs","RWDir") - for the writable overlay dir | ||
38 | 34 | """ | ||
39 | 35 | logging.debug("aufsOptionsAndEnvironmentSetup()") | ||
40 | 36 | # enabled from the commandline (full overlay by default) | ||
41 | 37 | if options and options.useAufs: | ||
42 | 38 | logging.debug("enabling full overlay from commandline") | ||
43 | 39 | config.set("Aufs", "Enabled", "True") | ||
44 | 40 | config.set("Aufs", "EnableFullOverlay", "True") | ||
45 | 41 | |||
46 | 42 | # setup environment based on config | ||
47 | 43 | tmprw = tempfile.mkdtemp(prefix="upgrade-rw-") | ||
48 | 44 | aufs_rw_dir = config.getWithDefault("Aufs", "RWDir", tmprw) | ||
49 | 45 | logging.debug("using '%s' as aufs_rw_dir" % aufs_rw_dir) | ||
50 | 46 | os.environ["RELEASE_UPGRADE_AUFS_RWDIR"] = aufs_rw_dir | ||
51 | 47 | config.set("Aufs", "RWDir", aufs_rw_dir) | ||
52 | 48 | # now the chroot tmpdir | ||
53 | 49 | tmpchroot = tempfile.mkdtemp(prefix="upgrade-chroot-") | ||
54 | 50 | os.chmod(tmpchroot, 0o755) | ||
55 | 51 | aufs_chroot_dir = config.getWithDefault("Aufs", "ChrootDir", tmpchroot) | ||
56 | 52 | logging.debug("using '%s' as aufs chroot dir" % aufs_chroot_dir) | ||
57 | 53 | |||
58 | 54 | if config.getWithDefault("Aufs", "EnableFullOverlay", False): | ||
59 | 55 | logging.debug("enabling aufs full overlay (from config)") | ||
60 | 56 | config.set("Aufs", "Enabled", "True") | ||
61 | 57 | os.environ["RELEASE_UPGRADE_USE_AUFS_FULL_OVERLAY"] = "1" | ||
62 | 58 | if config.getWithDefault("Aufs", "EnableChrootOverlay", False): | ||
63 | 59 | logging.debug("enabling aufs chroot overlay") | ||
64 | 60 | config.set("Aufs", "Enabled", "True") | ||
65 | 61 | os.environ["RELEASE_UPGRADE_USE_AUFS_CHROOT"] = aufs_chroot_dir | ||
66 | 62 | if config.getWithDefault("Aufs", "EnableChrootRsync", False): | ||
67 | 63 | logging.debug("enable aufs chroot rsync back to real system") | ||
68 | 64 | os.environ["RELEASE_UPGRADE_RSYNC_AUFS_CHROOT"] = "1" | ||
69 | 65 | |||
70 | 66 | |||
71 | 67 | def _bindMount(from_dir, to_dir, rbind=False): | ||
72 | 68 | " helper that bind mounts a given dir to a new place " | ||
73 | 69 | if not os.path.exists(to_dir): | ||
74 | 70 | os.makedirs(to_dir) | ||
75 | 71 | if rbind: | ||
76 | 72 | bind = "--rbind" | ||
77 | 73 | else: | ||
78 | 74 | bind = "--bind" | ||
79 | 75 | cmd = ["mount", bind, from_dir, to_dir] | ||
80 | 76 | logging.debug("cmd: %s" % cmd) | ||
81 | 77 | res = subprocess.call(cmd) | ||
82 | 78 | if res != 0: | ||
83 | 79 | # FIXME: revert already mounted stuff | ||
84 | 80 | logging.error( | ||
85 | 81 | "Failed to bind mount from '%s' to '%s'" % (from_dir, to_dir)) | ||
86 | 82 | return False | ||
87 | 83 | return True | ||
88 | 84 | |||
89 | 85 | |||
90 | 86 | def _aufsOverlayMount(target, rw_dir, chroot_dir="/"): | ||
91 | 87 | """ | ||
92 | 88 | helper that takes a target dir and mounts a rw dir over it, e.g. | ||
93 | 89 | /var , /tmp/upgrade-rw | ||
94 | 90 | """ | ||
95 | 91 | if not os.path.exists(rw_dir + target): | ||
96 | 92 | os.makedirs(rw_dir + target) | ||
97 | 93 | if not os.path.exists(chroot_dir + target): | ||
98 | 94 | os.makedirs(chroot_dir + target) | ||
99 | 95 | # FIXME: figure out when to use aufs and when to use overlayfs | ||
100 | 96 | use_overlayfs = False | ||
101 | 97 | if use_overlayfs: | ||
102 | 98 | cmd = ["mount", | ||
103 | 99 | "-t", "overlayfs", | ||
104 | 100 | "-o", "upperdir=%s,lowerdir=%s" % (rw_dir + target, target), | ||
105 | 101 | "none", | ||
106 | 102 | chroot_dir + target] | ||
107 | 103 | else: | ||
108 | 104 | cmd = ["mount", | ||
109 | 105 | "-t", "aufs", | ||
110 | 106 | "-o", "br:%s:%s=ro" % (rw_dir + target, target), | ||
111 | 107 | "none", | ||
112 | 108 | chroot_dir + target] | ||
113 | 109 | res = subprocess.call(cmd) | ||
114 | 110 | if res != 0: | ||
115 | 111 | # FIXME: revert already mounted stuff | ||
116 | 112 | logging.error("Failed to mount rw aufs overlay for '%s'" % target) | ||
117 | 113 | return False | ||
118 | 114 | logging.debug("cmd '%s' return '%s' " % (cmd, res)) | ||
119 | 115 | return True | ||
120 | 116 | |||
121 | 117 | |||
122 | 118 | def is_aufs_mount(dir): | ||
123 | 119 | " test if the given dir is already mounted with aufs overlay " | ||
124 | 120 | with open("/proc/mounts") as f: | ||
125 | 121 | for line in f: | ||
126 | 122 | (device, mountpoint, fstype, options, a, b) = line.split() | ||
127 | 123 | if device == "none" and fstype == "aufs" and mountpoint == dir: | ||
128 | 124 | return True | ||
129 | 125 | return False | ||
130 | 126 | |||
131 | 127 | |||
132 | 128 | def is_submount(mountpoint, systemdirs): | ||
133 | 129 | " helper: check if the given mountpoint is a submount of a systemdir " | ||
134 | 130 | logging.debug("is_submount: %s %s" % (mountpoint, systemdirs)) | ||
135 | 131 | for d in systemdirs: | ||
136 | 132 | if not d.endswith("/"): | ||
137 | 133 | d += "/" | ||
138 | 134 | if mountpoint.startswith(d): | ||
139 | 135 | return True | ||
140 | 136 | return False | ||
141 | 137 | |||
142 | 138 | |||
143 | 139 | def is_real_fs(fs): | ||
144 | 140 | if fs.startswith("fuse"): | ||
145 | 141 | return False | ||
146 | 142 | if fs in ["rootfs", "tmpfs", "proc", "fusectrl", "aufs", | ||
147 | 143 | "devpts", "binfmt_misc", "sysfs"]: | ||
148 | 144 | return False | ||
149 | 145 | return True | ||
150 | 146 | |||
151 | 147 | |||
152 | 148 | def doAufsChrootRsync(aufs_chroot_dir): | ||
153 | 149 | """ | ||
154 | 150 | helper that rsyncs the changes in the aufs chroot back to the | ||
155 | 151 | real system | ||
156 | 152 | """ | ||
157 | 153 | from .DistUpgradeMain import SYSTEM_DIRS | ||
158 | 154 | for d in SYSTEM_DIRS: | ||
159 | 155 | if not os.path.exists(d): | ||
160 | 156 | continue | ||
161 | 157 | # its important to have the "/" at the end of source | ||
162 | 158 | # and dest so that rsync knows what to do | ||
163 | 159 | cmd = ["rsync", "-aHAX", "--del", "-v", "--progress", | ||
164 | 160 | "/%s/%s/" % (aufs_chroot_dir, d), | ||
165 | 161 | "/%s/" % d] | ||
166 | 162 | logging.debug("running: '%s'" % cmd) | ||
167 | 163 | ret = subprocess.call(cmd) | ||
168 | 164 | logging.debug("rsync back result for %s: %i" % (d, ret)) | ||
169 | 165 | return True | ||
170 | 166 | |||
171 | 167 | |||
172 | 168 | def doAufsChroot(aufs_rw_dir, aufs_chroot_dir): | ||
173 | 169 | " helper that sets the chroot up and does chroot() into it " | ||
174 | 170 | if not setupAufsChroot(aufs_rw_dir, aufs_chroot_dir): | ||
175 | 171 | return False | ||
176 | 172 | os.chroot(aufs_chroot_dir) | ||
177 | 173 | os.chdir("/") | ||
178 | 174 | return True | ||
179 | 175 | |||
180 | 176 | |||
181 | 177 | def setupAufsChroot(rw_dir, chroot_dir): | ||
182 | 178 | " setup aufs chroot that is based on / but with a writable overlay " | ||
183 | 179 | # with the chroot aufs we can just rsync the changes back | ||
184 | 180 | # from the chroot dir to the real dirs | ||
185 | 181 | # | ||
186 | 182 | # (if we run rsync with --backup --backup-dir we could even | ||
187 | 183 | # create something vaguely rollbackable | ||
188 | 184 | |||
189 | 185 | # get the mount points before the aufs buisiness starts | ||
190 | 186 | with open("/proc/mounts") as f: | ||
191 | 187 | mounts = f.read() | ||
192 | 188 | from .DistUpgradeMain import SYSTEM_DIRS | ||
193 | 189 | systemdirs = SYSTEM_DIRS | ||
194 | 190 | |||
195 | 191 | # aufs mount or bind mount required dirs | ||
196 | 192 | for d in os.listdir("/"): | ||
197 | 193 | d = os.path.join("/", d) | ||
198 | 194 | if os.path.isdir(d): | ||
199 | 195 | if d in systemdirs: | ||
200 | 196 | logging.debug("bind mounting %s" % d) | ||
201 | 197 | if not _aufsOverlayMount(d, rw_dir, chroot_dir): | ||
202 | 198 | return False | ||
203 | 199 | else: | ||
204 | 200 | logging.debug("overlay mounting %s" % d) | ||
205 | 201 | if not _bindMount(d, chroot_dir + d, rbind=True): | ||
206 | 202 | return False | ||
207 | 203 | |||
208 | 204 | # create binds for the systemdirs | ||
209 | 205 | #needs_bind_mount = set() | ||
210 | 206 | for line in mounts.split("\n"): | ||
211 | 207 | line = line.strip() | ||
212 | 208 | if not line: | ||
213 | 209 | continue | ||
214 | 210 | (device, mountpoint, fstype, options, a, b) = line.split() | ||
215 | 211 | if (fstype != "aufs" and | ||
216 | 212 | not is_real_fs(fstype) and | ||
217 | 213 | is_submount(mountpoint, systemdirs)): | ||
218 | 214 | logging.debug("found %s that needs bind mount", mountpoint) | ||
219 | 215 | if not _bindMount(mountpoint, chroot_dir + mountpoint): | ||
220 | 216 | return False | ||
221 | 217 | return True | ||
222 | 218 | |||
223 | 219 | |||
224 | 220 | def setupAufs(rw_dir): | ||
225 | 221 | " setup aufs overlay over the rootfs " | ||
226 | 222 | # * we need to find a way to tell all the existing daemon | ||
227 | 223 | # to look into the new namespace. so probably something | ||
228 | 224 | # like a reboot is required and some hackery in initramfs-tools | ||
229 | 225 | # to ensure that we boot into a overlay ready system | ||
230 | 226 | # * this is much less of a issue with the aufsChroot code | ||
231 | 227 | logging.debug("setupAufs") | ||
232 | 228 | if not os.path.exists("/proc/mounts"): | ||
233 | 229 | logging.debug("no /proc/mounts, can not do aufs overlay") | ||
234 | 230 | return False | ||
235 | 231 | |||
236 | 232 | from .DistUpgradeMain import SYSTEM_DIRS | ||
237 | 233 | systemdirs = SYSTEM_DIRS | ||
238 | 234 | # verify that there are no submounts of a systemdir and collect | ||
239 | 235 | # the stuff that needs bind mounting (because a aufs does not | ||
240 | 236 | # include sub mounts) | ||
241 | 237 | needs_bind_mount = set() | ||
242 | 238 | needs_bind_mount.add("/var/cache/apt/archives") | ||
243 | 239 | with open("/proc/mounts") as f: | ||
244 | 240 | for line in f: | ||
245 | 241 | (device, mountpoint, fstype, options, a, b) = line.split() | ||
246 | 242 | if is_real_fs(fstype) and is_submount(mountpoint, systemdirs): | ||
247 | 243 | logging.warning("mountpoint %s submount of systemdir" % | ||
248 | 244 | mountpoint) | ||
249 | 245 | return False | ||
250 | 246 | if (fstype != "aufs" and | ||
251 | 247 | not is_real_fs(fstype) and | ||
252 | 248 | is_submount(mountpoint, systemdirs)): | ||
253 | 249 | logging.debug("found %s that needs bind mount", mountpoint) | ||
254 | 250 | needs_bind_mount.add(mountpoint) | ||
255 | 251 | |||
256 | 252 | # aufs mounts do not support stacked filesystems, so | ||
257 | 253 | # if we mount /var we will loose the tmpfs stuff | ||
258 | 254 | # first bind mount varun and varlock into the tmpfs | ||
259 | 255 | for d in needs_bind_mount: | ||
260 | 256 | if not _bindMount(d, rw_dir + "/needs_bind_mount/" + d): | ||
261 | 257 | return False | ||
262 | 258 | # setup writable overlay into /tmp/upgrade-rw so that all | ||
263 | 259 | # changes are written there instead of the real fs | ||
264 | 260 | for d in systemdirs: | ||
265 | 261 | if not is_aufs_mount(d): | ||
266 | 262 | if not _aufsOverlayMount(d, rw_dir): | ||
267 | 263 | return False | ||
268 | 264 | # now bind back the tempfs to the original location | ||
269 | 265 | for d in needs_bind_mount: | ||
270 | 266 | if not _bindMount(rw_dir + "/needs_bind_mount/" + d, d): | ||
271 | 267 | return False | ||
272 | 268 | |||
273 | 269 | # The below information is only of historical relevance: | ||
274 | 270 | # now what we *could* do to apply the changes is to | ||
275 | 271 | # mount -o bind / /orig | ||
276 | 272 | # (bind is important, *not* rbind that includes submounts) | ||
277 | 273 | # | ||
278 | 274 | # This will give us the original "/" without the | ||
279 | 275 | # aufs rw overlay - *BUT* only if "/" is all on one parition | ||
280 | 276 | # | ||
281 | 277 | # then apply the diff (including the whiteouts) to /orig | ||
282 | 278 | # e.g. by "rsync -av /tmp/upgrade-rw /orig" | ||
283 | 279 | # "script that search for whiteouts and removes them" | ||
284 | 280 | # (whiteout files start with .wh.$name | ||
285 | 281 | # whiteout dirs with .wh..? - check with aufs man page) | ||
286 | 282 | return True | ||
287 | 283 | |||
288 | 284 | |||
289 | 285 | if __name__ == "__main__": | ||
290 | 286 | logging.basicConfig(level=logging.DEBUG) | ||
291 | 287 | #print(setupAufs("/tmp/upgrade-rw")) | ||
292 | 288 | print(setupAufsChroot("/tmp/upgrade-chroot-rw", | ||
293 | 289 | "/tmp/upgrade-chroot")) | ||
294 | 290 | 0 | ||
295 | === modified file 'DistUpgrade/DistUpgradeController.py' | |||
296 | --- DistUpgrade/DistUpgradeController.py 2016-08-10 15:09:46 +0000 | |||
297 | +++ DistUpgrade/DistUpgradeController.py 2017-05-18 17:34:09 +0000 | |||
298 | @@ -57,7 +57,6 @@ | |||
299 | 57 | from .DistUpgradeConfigParser import DistUpgradeConfig | 57 | from .DistUpgradeConfigParser import DistUpgradeConfig |
300 | 58 | from .DistUpgradeQuirks import DistUpgradeQuirks | 58 | from .DistUpgradeQuirks import DistUpgradeQuirks |
301 | 59 | from .DistUpgradeAptCdrom import AptCdrom | 59 | from .DistUpgradeAptCdrom import AptCdrom |
302 | 60 | from .DistUpgradeAufs import setupAufs, aufsOptionsAndEnvironmentSetup | ||
303 | 61 | 60 | ||
304 | 62 | # workaround broken relative import in python-apt (LP: #871007), we | 61 | # workaround broken relative import in python-apt (LP: #871007), we |
305 | 63 | # want the local version of distinfo.py from oneiric, but because of | 62 | # want the local version of distinfo.py from oneiric, but because of |
306 | @@ -138,9 +137,6 @@ | |||
307 | 138 | self.config.add_section("Options") | 137 | self.config.add_section("Options") |
308 | 139 | self.config.set("Options","withNetwork", str(self.useNetwork)) | 138 | self.config.set("Options","withNetwork", str(self.useNetwork)) |
309 | 140 | 139 | ||
310 | 141 | # aufs stuff | ||
311 | 142 | aufsOptionsAndEnvironmentSetup(self.options, self.config) | ||
312 | 143 | |||
313 | 144 | # some constants here | 140 | # some constants here |
314 | 145 | self.fromDist = self.config.get("Sources","From") | 141 | self.fromDist = self.config.get("Sources","From") |
315 | 146 | self.toDist = self.config.get("Sources","To") | 142 | self.toDist = self.config.get("Sources","To") |
316 | @@ -399,27 +395,6 @@ | |||
317 | 399 | "supported with this tool." % (release, self.toDist))) | 395 | "supported with this tool." % (release, self.toDist))) |
318 | 400 | sys.exit(1) | 396 | sys.exit(1) |
319 | 401 | 397 | ||
320 | 402 | # setup aufs | ||
321 | 403 | if self.config.getWithDefault("Aufs", "EnableFullOverlay", False): | ||
322 | 404 | aufs_rw_dir = self.config.get("Aufs","RWDir") | ||
323 | 405 | if not setupAufs(aufs_rw_dir): | ||
324 | 406 | logging.error("aufs setup failed") | ||
325 | 407 | self._view.error(_("Sandbox setup failed"), | ||
326 | 408 | _("It was not possible to create the sandbox " | ||
327 | 409 | "environment.")) | ||
328 | 410 | return False | ||
329 | 411 | |||
330 | 412 | # all good, tell the user about the sandbox mode | ||
331 | 413 | logging.info("running in aufs overlay mode") | ||
332 | 414 | self._view.information(_("Sandbox mode"), | ||
333 | 415 | _("This upgrade is running in sandbox " | ||
334 | 416 | "(test) mode. All changes are written " | ||
335 | 417 | "to '%s' and will be lost on the next " | ||
336 | 418 | "reboot.\n\n" | ||
337 | 419 | "*No* changes written to a system directory " | ||
338 | 420 | "from now until the next reboot are " | ||
339 | 421 | "permanent.") % aufs_rw_dir) | ||
340 | 422 | |||
341 | 423 | # setup backports (if we have them) | 398 | # setup backports (if we have them) |
342 | 424 | if self.options and self.options.havePrerequists: | 399 | if self.options and self.options.havePrerequists: |
343 | 425 | backportsdir = os.getcwd()+"/backports" | 400 | backportsdir = os.getcwd()+"/backports" |
344 | 426 | 401 | ||
345 | === modified file 'DistUpgrade/DistUpgradeMain.py' | |||
346 | --- DistUpgrade/DistUpgradeMain.py 2017-05-03 10:03:08 +0000 | |||
347 | +++ DistUpgrade/DistUpgradeMain.py 2017-05-18 17:34:09 +0000 | |||
348 | @@ -33,8 +33,8 @@ | |||
349 | 33 | from optparse import OptionParser | 33 | from optparse import OptionParser |
350 | 34 | from gettext import gettext as _ | 34 | from gettext import gettext as _ |
351 | 35 | 35 | ||
354 | 36 | # dirs that the packages will touch, this is needed for AUFS/overlayfs | 36 | # dirs that the packages will touch, this is needed for the sanity check |
355 | 37 | # and also for the sanity check before the upgrade | 37 | # before the upgrade |
356 | 38 | SYSTEM_DIRS = ["/bin", | 38 | SYSTEM_DIRS = ["/bin", |
357 | 39 | "/boot", | 39 | "/boot", |
358 | 40 | "/etc", | 40 | "/etc", |
359 | @@ -54,9 +54,6 @@ | |||
360 | 54 | def do_commandline(): | 54 | def do_commandline(): |
361 | 55 | " setup option parser and parse the commandline " | 55 | " setup option parser and parse the commandline " |
362 | 56 | parser = OptionParser() | 56 | parser = OptionParser() |
363 | 57 | parser.add_option("-s", "--sandbox", dest="useAufs", default=False, | ||
364 | 58 | action="store_true", | ||
365 | 59 | help=_("Sandbox upgrade using aufs")) | ||
366 | 60 | parser.add_option("-c", "--cdrom", dest="cdromPath", default=None, | 57 | parser.add_option("-c", "--cdrom", dest="cdromPath", default=None, |
367 | 61 | help=_("Use the given path to search for a cdrom with upgradable packages")) | 58 | help=_("Use the given path to search for a cdrom with upgradable packages")) |
368 | 62 | parser.add_option("--have-prerequists", dest="havePrerequists", | 59 | parser.add_option("--have-prerequists", dest="havePrerequists", |
369 | 63 | 60 | ||
370 | === modified file 'DistUpgrade/DistUpgradeView.py' | |||
371 | --- DistUpgrade/DistUpgradeView.py 2016-02-08 22:40:04 +0000 | |||
372 | +++ DistUpgrade/DistUpgradeView.py 2017-05-18 17:34:09 +0000 | |||
373 | @@ -30,7 +30,6 @@ | |||
374 | 30 | import signal | 30 | import signal |
375 | 31 | import select | 31 | import select |
376 | 32 | 32 | ||
377 | 33 | from .DistUpgradeAufs import doAufsChroot, doAufsChrootRsync | ||
378 | 34 | from .DistUpgradeApport import apport_pkgfailure | 33 | from .DistUpgradeApport import apport_pkgfailure |
379 | 35 | 34 | ||
380 | 36 | 35 | ||
381 | @@ -212,12 +211,6 @@ | |||
382 | 212 | def run(self, pm): | 211 | def run(self, pm): |
383 | 213 | pid = self.fork() | 212 | pid = self.fork() |
384 | 214 | if pid == 0: | 213 | if pid == 0: |
385 | 215 | # check if we need to setup/enable the aufs chroot stuff | ||
386 | 216 | if "RELEASE_UPGRADE_USE_AUFS_CHROOT" in os.environ: | ||
387 | 217 | if not doAufsChroot(os.environ["RELEASE_UPGRADE_AUFS_RWDIR"], | ||
388 | 218 | os.environ["RELEASE_UPGRADE_USE_AUFS_CHROOT"]): | ||
389 | 219 | print("ERROR: failed to setup aufs chroot overlay") | ||
390 | 220 | os._exit(1) | ||
391 | 221 | # child, ignore sigpipe, there are broken scripts out there | 214 | # child, ignore sigpipe, there are broken scripts out there |
392 | 222 | # like etckeeper (LP: #283642) | 215 | # like etckeeper (LP: #283642) |
393 | 223 | signal.signal(signal.SIGPIPE,signal.SIG_IGN) | 216 | signal.signal(signal.SIGPIPE,signal.SIG_IGN) |
394 | @@ -232,14 +225,6 @@ | |||
395 | 232 | os._exit(res) | 225 | os._exit(res) |
396 | 233 | self.child_pid = pid | 226 | self.child_pid = pid |
397 | 234 | res = os.WEXITSTATUS(self.wait_child()) | 227 | res = os.WEXITSTATUS(self.wait_child()) |
398 | 235 | # check if we want to sync the changes back, *only* do that | ||
399 | 236 | # if res is positive | ||
400 | 237 | if (res == 0 and | ||
401 | 238 | "RELEASE_UPGRADE_RSYNC_AUFS_CHROOT" in os.environ): | ||
402 | 239 | logging.info("doing rsync commit of the update") | ||
403 | 240 | if not doAufsChrootRsync(os.environ["RELEASE_UPGRADE_USE_AUFS_CHROOT"]): | ||
404 | 241 | logging.error("FATAL ERROR: doAufsChrootRsync() returned FALSE") | ||
405 | 242 | return pm.RESULT_FAILED | ||
406 | 243 | return res | 228 | return res |
407 | 244 | 229 | ||
408 | 245 | def error(self, pkg, errormsg): | 230 | def error(self, pkg, errormsg): |
409 | 246 | 231 | ||
410 | === modified file 'data/DistUpgrade.cfg' | |||
411 | --- data/DistUpgrade.cfg 2017-04-24 21:15:03 +0000 | |||
412 | +++ data/DistUpgrade.cfg 2017-05-18 17:34:09 +0000 | |||
413 | @@ -128,17 +128,6 @@ | |||
414 | 128 | ;SourcesList-ia64=prerequists-sources.ports.list | 128 | ;SourcesList-ia64=prerequists-sources.ports.list |
415 | 129 | ;SourcesList-hppa=prerequists-sources.ports.list | 129 | ;SourcesList-hppa=prerequists-sources.ports.list |
416 | 130 | 130 | ||
417 | 131 | [Aufs] | ||
418 | 132 | ; this is a xor option, either full or chroot overlay | ||
419 | 133 | ;EnableFullOverlay=yes | ||
420 | 134 | ;EnableChrootOverlay=yes | ||
421 | 135 | ; sync changes from the chroot back to the real system | ||
422 | 136 | ;EnableChrootRsync=yes | ||
423 | 137 | ; what chroot dir to use | ||
424 | 138 | ;ChrootDir=/tmp/upgrade-chroot | ||
425 | 139 | ; the RW dir to use (either for full overlay or chroot overlay) | ||
426 | 140 | ;RWDir=/tmp/upgrade-rw | ||
427 | 141 | |||
428 | 142 | [Network] | 131 | [Network] |
429 | 143 | MaxRetries=3 | 132 | MaxRetries=3 |
430 | 144 | 133 | ||
431 | 145 | 134 | ||
432 | === modified file 'data/do-release-upgrade.8' | |||
433 | --- data/do-release-upgrade.8 2012-06-13 11:47:22 +0000 | |||
434 | +++ data/do-release-upgrade.8 2017-05-18 17:34:09 +0000 | |||
435 | @@ -28,8 +28,5 @@ | |||
436 | 28 | .TP | 28 | .TP |
437 | 29 | \fB\-f\fR FRONTEND, \fB\-\-frontend\fR=\fIFRONTEND\fR | 29 | \fB\-f\fR FRONTEND, \fB\-\-frontend\fR=\fIFRONTEND\fR |
438 | 30 | Run the specified frontend | 30 | Run the specified frontend |
439 | 31 | .TP | ||
440 | 32 | \fB\-s\fR, \fB\-\-sandbox\fR | ||
441 | 33 | Test upgrade with a sandbox aufs overlay | ||
442 | 34 | .SH "SEE ALSO" | 31 | .SH "SEE ALSO" |
443 | 35 | \fBupdate\-manager\fR(8), \fBapt\-get\fR(8) | 32 | \fBupdate\-manager\fR(8), \fBapt\-get\fR(8) |
444 | 36 | 33 | ||
445 | === modified file 'debian/changelog' | |||
446 | --- debian/changelog 2017-05-03 16:12:01 +0000 | |||
447 | +++ debian/changelog 2017-05-18 17:34:09 +0000 | |||
448 | @@ -1,3 +1,10 @@ | |||
449 | 1 | ubuntu-release-upgrader (1:17.10.3) UNRELEASED; urgency=medium | ||
450 | 2 | |||
451 | 3 | * Remove --sandbox (aufs support) as it has been broken for some time and | ||
452 | 4 | was rather unused. (LP: #1605259) | ||
453 | 5 | |||
454 | 6 | -- Brian Murray <brian@ubuntu.com> Wed, 17 May 2017 14:38:24 -0700 | ||
455 | 7 | |||
456 | 1 | ubuntu-release-upgrader (1:17.10.2) artful; urgency=medium | 8 | ubuntu-release-upgrader (1:17.10.2) artful; urgency=medium |
457 | 2 | 9 | ||
458 | 3 | [ Balint Reczey ] | 10 | [ Balint Reczey ] |
459 | 4 | 11 | ||
460 | === modified file 'do-release-upgrade' | |||
461 | --- do-release-upgrade 2015-04-16 23:00:33 +0000 | |||
462 | +++ do-release-upgrade 2017-05-18 17:34:09 +0000 | |||
463 | @@ -96,8 +96,6 @@ | |||
464 | 96 | parser.add_option ("-f", "--frontend", default="DistUpgradeViewText", | 96 | parser.add_option ("-f", "--frontend", default="DistUpgradeViewText", |
465 | 97 | dest="frontend", | 97 | dest="frontend", |
466 | 98 | help=_("Run the specified frontend")) | 98 | help=_("Run the specified frontend")) |
467 | 99 | parser.add_option ("-s","--sandbox", action="store_true", default=False, | ||
468 | 100 | help=_("Test upgrade with a sandbox aufs overlay")) | ||
469 | 101 | parser.add_option ("-c", "--check-dist-upgrade-only", action="store_true", | 99 | parser.add_option ("-c", "--check-dist-upgrade-only", action="store_true", |
470 | 102 | default=check_only, | 100 | default=check_only, |
471 | 103 | help=_("Check only if a new distribution release is " | 101 | help=_("Check only if a new distribution release is " |
472 | @@ -158,8 +156,6 @@ | |||
473 | 158 | fetcher.run_options += ["--mode=%s" % options.mode, | 156 | fetcher.run_options += ["--mode=%s" % options.mode, |
474 | 159 | "--frontend=%s" % options.frontend, | 157 | "--frontend=%s" % options.frontend, |
475 | 160 | ] | 158 | ] |
476 | 161 | if options.sandbox: | ||
477 | 162 | fetcher.run_options.append("--sandbox") | ||
478 | 163 | if options.devel_release: | 159 | if options.devel_release: |
479 | 164 | fetcher.run_options.append("--devel-release") | 160 | fetcher.run_options.append("--devel-release") |
480 | 165 | fetcher.run() | 161 | fetcher.run() |
LGTM, one minor comment inline.