Merge lp:~tribaal/livecd-rootfs/xenial-proposed-build-info-minimal into lp:livecd-rootfs
- xenial-proposed-build-info-minimal
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~tribaal/livecd-rootfs/xenial-proposed-build-info-minimal |
Merge into: | lp:livecd-rootfs |
Diff against target: |
2194 lines (+1501/-92) (has conflicts) 20 files modified
debian/changelog (+335/-0) debian/control (+30/-1) debian/tests/control (+7/-0) debian/tests/default-bootstraps (+96/-0) debian/tests/minimized (+3/-0) live-build/auto/build (+135/-2) live-build/auto/config (+228/-17) live-build/ubuntu-cpc/functions.OTHER (+320/-0) live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER (+27/-0) live-build/ubuntu-cpc/hooks/032-disk-image.binary (+6/-0) live-build/ubuntu-cpc/hooks/032-root-squashfs.binary (+3/-0) live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary (+39/-0) live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary (+9/-0) live-build/ubuntu-cpc/hooks/040-qcow2-image.binary (+10/-1) live-build/ubuntu-cpc/hooks/040-vmdk-image.binary (+25/-8) live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary (+44/-13) live-build/ubuntu-cpc/hooks/042-vagrant.binary (+135/-50) live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot (+9/-0) live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot (+35/-0) live-build/ubuntu-cpc/hooks/999-extras.binary (+5/-0) Text conflict in debian/changelog Text conflict in debian/control Conflict adding file debian/tests. Moved existing file to debian/tests.moved. Text conflict in live-build/auto/build Text conflict in live-build/auto/config Contents conflict in live-build/ubuntu-cpc/functions Contents conflict in live-build/ubuntu-cpc/hooks/030-root-tarball.binary Text conflict in live-build/ubuntu-cpc/hooks/032-disk-image.binary Text conflict in live-build/ubuntu-cpc/hooks/032-root-squashfs.binary Text conflict in live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary Text conflict in live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary Text conflict in live-build/ubuntu-cpc/hooks/040-qcow2-image.binary Text conflict in live-build/ubuntu-cpc/hooks/040-vmdk-image.binary Text conflict in live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary Text conflict in live-build/ubuntu-cpc/hooks/042-vagrant.binary Conflict adding file live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot. Moved existing file to live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot.moved. Text conflict in live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot Text conflict in live-build/ubuntu-cpc/hooks/999-extras.binary Conflict adding file live-build/ubuntu-touch-custom. Moved existing file to live-build/ubuntu-touch-custom.moved. |
To merge this branch: | bzr merge lp:~tribaal/livecd-rootfs/xenial-proposed-build-info-minimal |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Core Development Team | Pending | ||
Review via email: mp+342297@code.launchpad.net |
This proposal has been superseded by a proposal from 2018-03-28.
Commit message
Description of the change
This change backports changes from bionic where the /etc/cloud/
Unmerged revisions
- 1455. By Chris Glass
-
ubuntu-cpc: When performing a minimized build make sure the
/etc/cloud/build.info file says "minimal" (LP: #1759519) - 1454. By Steve Langasek
-
Merge lp:~daniel-thewatkins/livecd-rootfs/minimized-skips-xenial
- 1453. By Balint Reczey
-
releasing package livecd-rootfs version 2.408.27
- 1452. By Balint Reczey
- 1451. By Łukasz Zemczak
-
releasing package livecd-rootfs version 2.408.26
- 1450. By Łukasz Zemczak
-
Changed default user configuration in the vagrant image, in accordance with the vagrant community's expectations
- 1449. By Balint Reczey
-
releasing package livecd-rootfs version 2.408.25
- 1448. By Balint Reczey
- 1447. By Łukasz Zemczak
-
releasing package livecd-rootfs version 2.408.24
- 1446. By Łukasz Zemczak
-
For the IMAGEFORMAT=none parts to work for ubuntu-image classic builds, we need to make sure IMAGEFORMAT is preserved and not overwritten if defined. Backporting from trunk.
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2018-03-27 19:12:35 +0000 |
3 | +++ debian/changelog 2018-03-28 13:08:01 +0000 |
4 | @@ -1,3 +1,4 @@ |
5 | +<<<<<<< TREE |
6 | livecd-rootfs (2.516) bionic; urgency=medium |
7 | |
8 | [ Chris Glass ] |
9 | @@ -1042,6 +1043,340 @@ |
10 | |
11 | -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 04 May 2016 12:49:23 +0200 |
12 | |
13 | +======= |
14 | +livecd-rootfs (2.408.29) UNRELEASED; urgency=medium |
15 | + |
16 | + * ubuntu-cpc: When performing a minimized build make sure the |
17 | + /etc/cloud/build.info file says "minimal" (LP: #1759519) |
18 | + |
19 | + -- Christopher Glass (Ubuntu) <tribaal@ubuntu.com> Wed, 28 Mar 2018 12:08:48 +0200 |
20 | + |
21 | +livecd-rootfs (2.408.28) xenial; urgency=medium |
22 | + |
23 | + * ubuntu-cpc: When performing a minimized build, don't generate artifacts |
24 | + that won't boot with the linux-kvm kernel (LP: #1757223). |
25 | + |
26 | + -- Daniel Watkins <daniel.watkins@canonical.com> Tue, 20 Mar 2018 12:42:25 -0400 |
27 | + |
28 | +livecd-rootfs (2.408.27) xenial; urgency=medium |
29 | + |
30 | + * Don't ask for password and GECOS while creating vagrant user |
31 | + (LP: #1569237) |
32 | + |
33 | + -- Balint Reczey <rbalint@ubuntu.com> Thu, 21 Dec 2017 09:20:32 +0100 |
34 | + |
35 | +livecd-rootfs (2.408.26) xenial; urgency=medium |
36 | + |
37 | + * Added a "vagrant" user to the vagrant image in addition to the "ubuntu" |
38 | + user, in accordance with the vagrant community's expectations (LP: #1569237) |
39 | + |
40 | + -- Christopher Glass (Ubuntu) <tribaal@ubuntu.com> Thu, 07 Dec 2017 14:00:59 +0100 |
41 | + |
42 | +livecd-rootfs (2.408.25) xenial; urgency=medium |
43 | + |
44 | + * Sort and list dependencies nicely |
45 | + * Depend on packages instead of installing them at run time |
46 | + * Use xz -T4 instead of pxz. |
47 | + Supported xz versions before 5.2 accept the -T4 option but ignore it. |
48 | + Also depend on xz-utils instead of downloading pxz. (LP: #1701132) |
49 | + |
50 | + -- Balint Reczey <rbalint@ubuntu.com> Wed, 06 Dec 2017 11:34:04 +0100 |
51 | + |
52 | +livecd-rootfs (2.408.24) xenial; urgency=medium |
53 | + |
54 | + * For the IMAGEFORMAT=none parts to work for ubuntu-image classic builds, we |
55 | + need to make sure IMAGEFORMAT is preserved and not overwritten if defined. |
56 | + Backporting from artful. |
57 | + |
58 | + -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 21 Nov 2017 17:01:14 +0100 |
59 | + |
60 | +livecd-rootfs (2.408.23) xenial; urgency=medium |
61 | + |
62 | + [ Gary Wang ] |
63 | + * Add the IMAGEFORMAT=none to support generating a single rootfs |
64 | + (LP: #1730642) |
65 | + |
66 | + [ Christopher Glass (Ubuntu) ] |
67 | + * Backport "minimized round 2" changes from trunk to Xenial (LP: #1731492) |
68 | + * Remove apt, debconf, dpkg cruft files from /var/cache and /var/lib in |
69 | + all our livefses. |
70 | + * Pass --cache false to lb config; otherwise we copy around caches of |
71 | + .debs that are never used properly, and which prevent us from emptying |
72 | + /var/cache/apt in images. |
73 | + * When building minimized cloud images, remove various packages that we |
74 | + don't want installed by default. Some are tools that aren't needed for |
75 | + non-interactive use; some are libraries whose reverse-dependencies |
76 | + will have already been removed; and one, open-vm-tools, should only be |
77 | + included in images that are targeted to VMWare (which is not the case |
78 | + for any of the current minimal images), rather than being included |
79 | + directly in the cloud-image seed. |
80 | + |
81 | + -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 14 Nov 2017 11:21:48 -0800 |
82 | + |
83 | +livecd-rootfs (2.408.22) xenial; urgency=medium |
84 | + |
85 | + * Make sure to remove any initramfs that was generated in a minimized |
86 | + image. |
87 | + * divert /usr/bin/systemd-detect-virt as part of the grub diversions, so |
88 | + that the grub kernel postinst hook is operational when we're building |
89 | + in a container. LP: #1729034. |
90 | + |
91 | + -- Steve Langasek <steve.langasek@ubuntu.com> Sat, 21 Oct 2017 20:53:02 -0700 |
92 | + |
93 | +livecd-rootfs (2.408.21) xenial; urgency=medium |
94 | + |
95 | + [ Balint Reczey ] |
96 | + * Use kvm kernel only on amd64. |
97 | + * Make non-x86 minimized images consistent with x86 by not explicitly |
98 | + installing the server task. |
99 | + * Clean up dangling /boot/initrd.img symlink left behind on minimized |
100 | + builds. |
101 | + |
102 | + -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 20 Oct 2017 23:10:29 -0700 |
103 | + |
104 | +livecd-rootfs (2.408.20) xenial; urgency=medium |
105 | + |
106 | + * Now that grub-related diversions have been factored out in 2.466 |
107 | + instead of having bogus root=stuff arg generated in grub.cfg, it is |
108 | + actually empty. Therefore update the sed command to make the arg in |
109 | + the root= token optional. This should resolve non-booting livecd cpc |
110 | + images. |
111 | + |
112 | + -- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 10 Oct 2017 13:49:49 +0100 |
113 | + |
114 | +livecd-rootfs (2.408.19) xenial; urgency=medium |
115 | + |
116 | + [ Nishanth Aravamudan ] |
117 | + * live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI |
118 | + Initiator Name at first iscsid run for cloud images to ensure it is |
119 | + unique (LP: #1444992). |
120 | + |
121 | + [ Steve Langasek ] |
122 | + * Improve teardown_mountpoint to recursively find all submounts and |
123 | + unmount them, instead of working from a hard-coded list. This makes |
124 | + the code resilient against other submounts being added later, including |
125 | + downstream. LP: #1721279. |
126 | + * Also nuke the sleep / udevadm settle calls in the process, which should |
127 | + never be required and slow down the builds. |
128 | + * Fix a reference to an undefined variable in a script that's set -u. |
129 | + * Use /bin/sh, not /bin/bash, for autopkgtest. |
130 | + * debian/tests/default-bootstraps: minor adjustments to shell syntax, |
131 | + syncing with artful where this originated. |
132 | + |
133 | + [ Steve Langasek, Balint Reczey ] |
134 | + * Introduce a new project-independent 'minimized' subproject |
135 | + (LP: #1721261): |
136 | + - omit ubuntu-minimal in favor of using only the minbase package set. |
137 | + - boot directly by partuuid, avoiding the use of an initramfs. |
138 | + - Bump needed live-build version which can build images without initrd |
139 | + - drop man pages and most of the documentation from minimized images |
140 | + (/usr/share/doc/*/copyright and changelog.Debian.gz files are still |
141 | + kept) |
142 | + - Add unminimize script for reverting minimization on a running system |
143 | + - Mention unminimize script in motd |
144 | + - Run autopkgtest for SUBPROJECT=minimized |
145 | + - If we're using SUBPROJECT=minimized, and tzdata is not installed, |
146 | + remove files that have been left behind. This is a workaround for a |
147 | + bug that should be fixed in tzdata. |
148 | + * Factor out grub-related diversions and use them consistently, so we |
149 | + don't end up with wrong os-probe output in our grub.cfg. |
150 | + |
151 | + [ Balint Reczey ] |
152 | + * Mount using --make-rslave to ensure safe unmounts for rbind mounts |
153 | + * When SUBPROJECT environment variable is not set assume it to be "" |
154 | + |
155 | + -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 04 Oct 2017 18:43:48 +0000 |
156 | + |
157 | +livecd-rootfs (2.408.18) xenial; urgency=medium |
158 | + |
159 | + [ Robert C Jennings ] |
160 | + * Install udev before calls to udevadm |
161 | + |
162 | + -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 22:10:11 -0700 |
163 | + |
164 | +livecd-rootfs (2.408.17) xenial; urgency=medium |
165 | + |
166 | + [ Robert C Jennings ] |
167 | + * live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint, |
168 | + to reverse the work done in setup_mountpoint. Lack of this function |
169 | + has forced users of setup_mountpoint to implement this separately |
170 | + and the implementations have diverged. (LP: #1716992) |
171 | + * live-build/ubuntu-cpc/functions: Remove umount_settle function. |
172 | + The was only used where teardown_mountpoint was lacking. |
173 | + |
174 | + -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 12:21:30 -0700 |
175 | + |
176 | +livecd-rootfs (2.408.16) xenial; urgency=medium |
177 | + |
178 | + * live-build/ubuntu-cpc/functions: call apt-get update in the chroot |
179 | + after mounting a blank /var/lib/apt, so that further operations work |
180 | + as expected; otherwise, 'apt-get purge ^grub-.*' fails on s390x because |
181 | + no such packages are known to apt. |
182 | + * live-build/ubuntu-cpc/hooks/030-root-tarball.binary: correct a missing |
183 | + unmount of /var/{lib,cache}/apt on cleanup, detected via autopkgtests. |
184 | + |
185 | + -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 12 Sep 2017 13:25:58 -0700 |
186 | + |
187 | +livecd-rootfs (2.408.15) xenial; urgency=medium |
188 | + |
189 | + [ Mathieu Trudel-Lapierre ] |
190 | + * Drop preloading of grub modules that are built into the grub signed |
191 | + image. This is functionally a no-op, changed only to clean up the code. |
192 | + |
193 | + [ Steve Langasek ] |
194 | + * live-build/ubuntu-cpc/functions: mount tmpfs on /var/cache/apt and |
195 | + /var/lib/apt, so we don't have to leave empty space in our derivative |
196 | + images for packages that have been downloaded/installed/removed. This |
197 | + normally isn't relevant for the installed system, since the root |
198 | + filesystem will auto-expand in place on the target disk, but lets us |
199 | + ship smaller images. |
200 | + * live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get |
201 | + update *before* installing packages, not after. |
202 | + |
203 | + [ Colin Watson ] |
204 | + * Mount and unmount /dev recursively, to cope with setups where there are |
205 | + interesting bind-mounts under /dev (e.g. loop devices bind-mounted by |
206 | + LXD). LP: #1716465. |
207 | + |
208 | + [ Balint Reczey ] |
209 | + * Fix suppression of kpartx error. LP: #1684090. |
210 | + |
211 | + -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 11 Sep 2017 14:38:42 -0700 |
212 | + |
213 | +livecd-rootfs (2.408.14) xenial; urgency=medium |
214 | + |
215 | + * live-build/auto/config: Filter libgles1-mesa out of tasks, as it is not a |
216 | + dependency of anything in updates anymore, fixing mate/myth (LP: #1704013) |
217 | + |
218 | + -- Adam Conrad <adconrad@ubuntu.com> Wed, 12 Jul 2017 16:28:13 -0600 |
219 | + |
220 | +livecd-rootfs (2.408.13) xenial; urgency=medium |
221 | + |
222 | + [ Balint Reczey ] |
223 | + * Source ubuntu-cpc functions from the right place |
224 | + * Use all config hooks from the proper place, not from /build/ |
225 | + * Add basic but configurable autopkgtest (LP: #1690440) |
226 | + * sync before calling kpartx to let writing to loop devices finish |
227 | + * wrap kpartx and trap spurious errors, to work around kpartx |
228 | + unreliability. |
229 | + |
230 | + -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 06 Jun 2017 21:52:21 -0700 |
231 | + |
232 | +livecd-rootfs (2.408.12) xenial; urgency=medium |
233 | + |
234 | + * live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure. |
235 | + (LP: #1687752) |
236 | + |
237 | + -- Robert C Jennings <robert.jennings@canonical.com> Tue, 09 May 2017 13:57:44 -0700 |
238 | + |
239 | +livecd-rootfs (2.408.11) xenial; urgency=medium |
240 | + |
241 | + * Add `apt-get update` to ubuntu-cpc ppc64el builds so they use the new |
242 | + sources. |
243 | + |
244 | + -- Daniel Watkins <daniel.watkins@canonical.com> Fri, 07 Apr 2017 16:12:53 -0400 |
245 | + |
246 | +livecd-rootfs (2.408.10) xenial; urgency=medium |
247 | + |
248 | + [ Adam Conrad ] |
249 | + * Fix security mirror sources.list entries for non-x86 architectures. |
250 | + (LP: #1679252) |
251 | + |
252 | + -- Daniel Watkins <daniel.watkins@canonical.com> Mon, 03 Apr 2017 14:05:25 -0400 |
253 | + |
254 | +livecd-rootfs (2.408.9) xenial; urgency=medium |
255 | + |
256 | + [ Daniel Watkins ] |
257 | + * Don't overwrite the default sources.list in cloud images. |
258 | + * Replace sources.list generated using COMPONENTS with the sources.list from |
259 | + an Ubuntu Server installation (i.e. with all components enabled, and all |
260 | + deb-src lines commented). LP: #1513529. |
261 | + |
262 | + [ Chris Glass ] |
263 | + * Fix the manifest generation in OVA files so that ovf files don't have |
264 | + double extensions. (LP: #1627931) |
265 | + * Fix the OVF's metadata to include Ubuntu specific identifiers and |
266 | + descriptions instead of the generic Linux ones. (LP: #1656293) |
267 | + |
268 | + [ Daniel Watkins ] |
269 | + * Add replace_grub_root_with_label function thereby consolidating multiple |
270 | + uses of the same calls to sed. |
271 | + |
272 | + [ Robert C Jennings ] |
273 | + * ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290) |
274 | + |
275 | + -- Robert C Jennings <robert.jennings@canonical.com> Thu, 23 Mar 2017 14:40:59 -0400 |
276 | + |
277 | +livecd-rootfs (2.408.8) xenial; urgency=medium |
278 | + |
279 | + * Set device_tree_address for the new kernel in the RPi bootloader config.txt |
280 | + |
281 | + -- Adam Conrad <adconrad@ubuntu.com> Thu, 16 Feb 2017 10:21:51 -0700 |
282 | + |
283 | +livecd-rootfs (2.408.7) xenial; urgency=medium |
284 | + |
285 | + [ Łukasz 'sil2100' Zemczak ] |
286 | + * Add additional hints to ubuntu-touch* i386/amd64 image builds to pull in |
287 | + the gles version of the UITK. |
288 | + * Now that we have have systemd working on ubuntu-touch, remove the |
289 | + systemd-sysv- in add_package config to make sure we can build an image with |
290 | + systemd as the init system. |
291 | + |
292 | + [ Adam Conrad ] |
293 | + * Forward-port hardware enablement delta from trusty to xenial, with changes: |
294 | + - Implement hwe stack swapping as task filters instead of install hints |
295 | + - Revert ubuntu-desktop and ubuntu-gnome to use tasks again for the above |
296 | + |
297 | + -- Adam Conrad <adconrad@ubuntu.com> Wed, 08 Feb 2017 11:50:52 -0700 |
298 | + |
299 | +livecd-rootfs (2.408.5) xenial; urgency=medium |
300 | + |
301 | + * Temporarily change the 60-install-click.chroot script to pull in clicks for |
302 | + arm64 builds from a different location for ubuntu-touch. |
303 | + * Add the new dhcpd user to touch hooks introduced by latest archive changes. |
304 | + * Remove the ubuntu-pd project logic. |
305 | + * Synced ubuntu-touch-custom changes from the vivid branch to xenial. This |
306 | + also adds a new symlink called ubuntu-touch-custom to the ubuntu-touch hooks |
307 | + dir. |
308 | + * Stop using the overlay PPA for touch livecd-rootfs changes (LP: #1628085). |
309 | + |
310 | + -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 27 Sep 2016 13:27:28 +0200 |
311 | + |
312 | +livecd-rootfs (2.408.4) xenial; urgency=medium |
313 | + |
314 | + * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling |
315 | + so that the teardown is done properly /before/ we try to make an |
316 | + image from our filesystem, since otherwise /etc/resolv.conf is broken. |
317 | + LP: #1621393. |
318 | + |
319 | + -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 09 Sep 2016 17:04:54 -0700 |
320 | + |
321 | +livecd-rootfs (2.408.3) xenial-proposed; urgency=medium |
322 | + |
323 | + [ Louis Zuckerman ] |
324 | + * Fixes for vagrant box builder in ubuntu-cpc LP: #1565985 |
325 | + - Install virtualbox-guest-utils |
326 | + - Don't disable default synced folder |
327 | + - Don't set vm name |
328 | + - Add cloud-init config to manage /etc/hosts LP: #1561250 |
329 | + |
330 | + -- Brian Murray <brian@ubuntu.com> Tue, 30 Aug 2016 13:17:55 -0700 |
331 | + |
332 | +livecd-rootfs (2.408.2) xenial; urgency=medium |
333 | + |
334 | + * Switch ubuntu-gnome from using tasks to metapackages (LP: #1602035) |
335 | + |
336 | + -- Adam Conrad <adconrad@ubuntu.com> Wed, 20 Jul 2016 01:46:41 -0600 |
337 | + |
338 | +livecd-rootfs (2.408.1) xenial; urgency=medium |
339 | + |
340 | + * Rename old ubuntu-core tarballs to ubuntu-base, for consistency with |
341 | + the changes already made to yakkety and the ubuntu-cdimage project. |
342 | + LP: #1579950. |
343 | + |
344 | + -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 09 May 2016 17:00:19 -0700 |
345 | + |
346 | +>>>>>>> MERGE-SOURCE |
347 | livecd-rootfs (2.408) xenial; urgency=medium |
348 | |
349 | * drop linux-firmware-raspi2, it does not actually contain driver |
350 | |
351 | === modified file 'debian/control' |
352 | --- debian/control 2018-03-06 09:15:41 +0000 |
353 | +++ debian/control 2018-03-28 13:08:01 +0000 |
354 | @@ -4,10 +4,11 @@ |
355 | Build-Depends: debhelper (>= 7) |
356 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
357 | Standards-Version: 3.9.6 |
358 | -Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk |
359 | +Vcs-Bzr: lp:~ubuntu-core-dev/livecd-rootfs/xenial-proposed/ |
360 | |
361 | Package: livecd-rootfs |
362 | Architecture: any |
363 | +<<<<<<< TREE |
364 | Depends: ${misc:Depends}, |
365 | apt-utils, |
366 | debootstrap, |
367 | @@ -36,6 +37,34 @@ |
368 | vmdk-stream-converter [amd64 i386], |
369 | xz-utils, |
370 | zerofree |
371 | +======= |
372 | +Depends: ${misc:Depends}, |
373 | + android-tools-fsutils [armhf], |
374 | + apt-utils, |
375 | + debootstrap, |
376 | + dosfstools, |
377 | + e2fsprogs, |
378 | + gdisk, |
379 | + genisoimage, |
380 | + germinate (>= 1.25.1), |
381 | + gnupg, |
382 | + grep-dctrl, |
383 | + kpartx, |
384 | + live-build (>= 3.0~a57-1ubuntu25.5~), |
385 | + lsb-release, |
386 | + lzma, |
387 | + parted, |
388 | + procps, |
389 | + python-minimal | python, |
390 | + python3-software-properties, |
391 | + qemu-utils, |
392 | + rsync, |
393 | + squashfs-tools (>= 1:3.3-1), |
394 | + vmdk-stream-converter [amd64 i386], |
395 | + xz-utils, |
396 | + zerofree |
397 | +Suggests: partimage |
398 | +>>>>>>> MERGE-SOURCE |
399 | Breaks: ubuntu-defaults-builder (<< 0.32) |
400 | Description: construction script for the livecd rootfs |
401 | livecd-rootfs provides the script used to create the root filesystem |
402 | |
403 | === added directory 'debian/tests' |
404 | === renamed directory 'debian/tests' => 'debian/tests.moved' |
405 | === added file 'debian/tests/control' |
406 | --- debian/tests/control 1970-01-01 00:00:00 +0000 |
407 | +++ debian/tests/control 2018-03-28 13:08:01 +0000 |
408 | @@ -0,0 +1,7 @@ |
409 | +Tests: default-bootstraps |
410 | +Depends: @, lsb-release |
411 | +Restrictions: needs-root isolation-machine |
412 | + |
413 | +Tests: minimized |
414 | +Depends: @, lsb-release |
415 | +Restrictions: needs-root isolation-machine |
416 | |
417 | === added file 'debian/tests/default-bootstraps' |
418 | --- debian/tests/default-bootstraps 1970-01-01 00:00:00 +0000 |
419 | +++ debian/tests/default-bootstraps 2018-03-28 13:08:01 +0000 |
420 | @@ -0,0 +1,96 @@ |
421 | +#!/bin/sh |
422 | +# autopkgtest check: Build default rootfs for all supported project:subproject pairs |
423 | +# (C) 2017 Canonical Ltd. |
424 | +# Author: Balint Reczey <balint.reczey@canonical.com> |
425 | + |
426 | +set -e |
427 | + |
428 | +if [ -z "$SUITE" ]; then |
429 | + SUITE=$(lsb_release -c -s) |
430 | +fi |
431 | + |
432 | +# Known project:subproject:template combinations. |
433 | +# Listed subprojects can be combined with other projects as well, |
434 | +# but this list gives reasonable coverage. |
435 | +ALL_TRIPLETS=" |
436 | + base:: |
437 | + edubuntu:: |
438 | + edubuntu-dvd:: |
439 | + kubuntu:: |
440 | + kubuntu-active:: |
441 | + kubuntu-dvd:: |
442 | + kubuntu-plasma5:: |
443 | + lubuntu:: |
444 | + lubuntu-next:: |
445 | + mythbuntu:: |
446 | + ubuntu:: |
447 | + ubuntu-base:: |
448 | + ubuntu-budgie:: |
449 | + ubuntu-budgie-desktop:: |
450 | + ubuntu-budgie-live:: |
451 | + ubuntu-core:system-image:ubuntu-core |
452 | + ubuntu-cpc::ubuntu-cpc |
453 | + ubuntu-cpc:minimized:ubuntu-cpc |
454 | + ubuntu-desktop-next:system-image:ubuntu-desktop-next |
455 | + ubuntu-desktop-next::ubuntu-desktop-next |
456 | + ubuntu-dvd:: |
457 | + ubuntu-gnome:: |
458 | + ubuntukylin:: |
459 | + ubuntu-mate:: |
460 | + ubuntu-mate-core:: |
461 | + ubuntu-mate-desktop:: |
462 | + ubuntu-mate-live:: |
463 | + ubuntu-netbook:: |
464 | + ubuntu-server:: |
465 | + ubuntu-server:ubuntu-rtm: |
466 | + ubuntu-server:ubuntu-rtm/foo: |
467 | + ubuntu-server:wubi: |
468 | + ubuntu-touch-custom::ubuntu-touch-custom |
469 | + ubuntu-touch::ubuntu-touch |
470 | + xubuntu::" |
471 | + |
472 | +if [ -z "$SELECTED_TRIPLETS" ]; then |
473 | + SELECTED_TRIPLETS=" |
474 | + ubuntu-base:: |
475 | + ubuntu-cpc::ubuntu-cpc |
476 | +" |
477 | +fi |
478 | + |
479 | +live_build_rootfs() { |
480 | + PROJECT=${1%%:*} |
481 | + local SUBPROJECT_TMP=${1%:*} |
482 | + SUBPROJECT=${SUBPROJECT_TMP#*:} |
483 | + TEMPLATE=${1##*:} |
484 | + ARCH=$(dpkg --print-architecture) |
485 | + echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD" |
486 | + cp -a /usr/share/livecd-rootfs/live-build/auto . |
487 | + if [ -n "$TEMPLATE" ]; then |
488 | + cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE . |
489 | + fi |
490 | + env PROJECT=$PROJECT \ |
491 | + SUBPROJECT=$SUBPROJECT \ |
492 | + SUITE=$SUITE \ |
493 | + ARCH=$ARCH \ |
494 | + lb config |
495 | + mkdir chroot |
496 | + # this part needs root rights, but right now the whole script ran as root by autopkgtest |
497 | + env PROJECT=$PROJECT \ |
498 | + SUBPROJECT=$SUBPROJECT \ |
499 | + ARCH=$ARCH \ |
500 | + lb build |
501 | + echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD" |
502 | + du -sh * |
503 | + echo "" |
504 | +} |
505 | + |
506 | +WORKDIR=$(mktemp -d) |
507 | +trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM |
508 | +cd $WORKDIR |
509 | + |
510 | +for i in $SELECTED_TRIPLETS; do |
511 | + mkdir $i |
512 | + (cd $i && live_build_rootfs $i) |
513 | + # clean up after build to avoid filling the disk, needs root rights |
514 | + rm -rf $i |
515 | +done |
516 | + |
517 | |
518 | === added file 'debian/tests/minimized' |
519 | --- debian/tests/minimized 1970-01-01 00:00:00 +0000 |
520 | +++ debian/tests/minimized 2018-03-28 13:08:01 +0000 |
521 | @@ -0,0 +1,3 @@ |
522 | +#!/bin/sh |
523 | + |
524 | +env SELECTED_TRIPLETS=ubuntu-cpc:minimized:ubuntu-cpc debian/tests/default-bootstraps |
525 | |
526 | === modified file 'live-build/auto/build' |
527 | --- live-build/auto/build 2018-03-27 19:12:26 +0000 |
528 | +++ live-build/auto/build 2018-03-28 13:08:01 +0000 |
529 | @@ -94,6 +94,7 @@ |
530 | |
531 | lb bootstrap "$@" |
532 | |
533 | +<<<<<<< TREE |
534 | case $PROJECT in |
535 | ubuntu-server|ubuntu-cpc) |
536 | # Set locale to C.UTF-8 by default. We should |
537 | @@ -209,6 +210,114 @@ |
538 | |
539 | chmod +x chroot/etc/update-motd.d/60-unminimize |
540 | fi |
541 | +======= |
542 | + if [ "${SUBPROJECT:-}" = minimized ] \ |
543 | + && ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then |
544 | + # workaround for tzdata purge not removing these files |
545 | + rm -f chroot/etc/localtime chroot/etc/timezone |
546 | + fi |
547 | + |
548 | + if [ "${SUBPROJECT:-}" = minimized ]; then |
549 | + # set up dpkg filters to skip installing docs on minimized system |
550 | + mkdir -p chroot/etc/dpkg/dpkg.cfg.d |
551 | + cat > chroot/etc/dpkg/dpkg.cfg.d/excludes <<EOF |
552 | +# Drop all man pages |
553 | +path-exclude=/usr/share/man/* |
554 | + |
555 | +# Drop all documentation ... |
556 | +path-exclude=/usr/share/doc/* |
557 | + |
558 | +# ... except copyright files ... |
559 | +path-include=/usr/share/doc/*/copyright |
560 | + |
561 | +# ... and Debian changelogs |
562 | +path-include=/usr/share/doc/*/changelog.Debian.* |
563 | +EOF |
564 | + |
565 | + # Remove docs installed by bootstrap |
566 | + Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall |
567 | + |
568 | + # Add unminimizer script which restores default image behavior |
569 | + mkdir -p chroot/usr/local/sbin |
570 | + cat > chroot/usr/local/sbin/unminimize <<'EOF' |
571 | +#!/bin/sh |
572 | + |
573 | +set -e |
574 | + |
575 | +echo "This system has been minimized by removing packages and content that are" |
576 | +echo "not required on a system that users do not log into." |
577 | +echo "" |
578 | +echo "This script restores the content and packages that are found on a default" |
579 | +echo "Ubuntu server system." |
580 | +echo "" |
581 | +echo "Reinstallation of packages may fail due to changes to the system" |
582 | +echo "configuration, the presence of third-party packages, or for other" |
583 | +echo "reasons." |
584 | +read -p "Would you like to continue? [y/N]" REPLY |
585 | +echo # (optional) move to a new line |
586 | +if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ] |
587 | +then |
588 | + exit 1 |
589 | +fi |
590 | + |
591 | +if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then |
592 | + echo "Re-enabling installation of all documentation in dpkg..." |
593 | + if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then |
594 | + mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp |
595 | + fi |
596 | + echo "Updating package list and upgrading packages..." |
597 | + apt-get update |
598 | + # apt-get upgrade asks for confirmation before upgrading packages to let the user stop here |
599 | + apt-get upgrade |
600 | + echo "Restoring system documentation..." |
601 | + echo "Reinstalling packages with files in /usr/share/man/ ..." |
602 | + # Reinstallation takes place in two steps because a single dpkg --verified |
603 | + # command generates very long parameter list for "xargs dpkg -S" and may go |
604 | + # over ARG_MAX. Since many packages have man pages the second download |
605 | + # handles a much smaller amount of packages. |
606 | + dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y |
607 | + echo "Reinstalling packages with system documentation in /usr/share/doc/ .." |
608 | + # This step processes the packages which still have missing documentation |
609 | + dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \ |
610 | + | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y |
611 | + if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then |
612 | + echo "Documentation has been restored successfully." |
613 | + rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp |
614 | + else |
615 | + echo "There are still files missing from /usr/share/doc/:" |
616 | + dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}' |
617 | + echo "You may want to try running this script again or you can remove" |
618 | + echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually." |
619 | + fi |
620 | +fi |
621 | + |
622 | +if ! dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-minimal 2> /dev/null | grep -q '^installed$'; then |
623 | + echo "Installing ubuntu-minimal package to provide the familiar Ubuntu minimal system..." |
624 | + DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-minimal |
625 | +fi |
626 | + |
627 | +# unminimization succeeded, there is no need to mention it in motd |
628 | +rm -f /etc/update-motd.d/60-unminimize |
629 | + |
630 | +EOF |
631 | + chmod +x chroot/usr/local/sbin/unminimize |
632 | + |
633 | + # inform users about the unminimize script |
634 | + cat > "chroot/etc/update-motd.d/60-unminimize" << EOF |
635 | +#!/bin/sh |
636 | +# |
637 | +# This file is not managed by a package. If you no longer want to |
638 | +# see this message you can safely remove the file. |
639 | +echo "This system has been minimized by removing packages and content that are" |
640 | +echo "not required on a system that users do not log into." |
641 | +echo "" |
642 | +echo "To restore this content, you can run the 'unminimize' command." |
643 | +EOF |
644 | + |
645 | + chmod +x chroot/etc/update-motd.d/60-unminimize |
646 | + fi |
647 | + |
648 | +>>>>>>> MERGE-SOURCE |
649 | Chroot chroot "dpkg-divert --quiet --add \ |
650 | --divert /usr/sbin/update-initramfs.REAL --rename \ |
651 | /usr/sbin/update-initramfs" |
652 | @@ -230,6 +339,7 @@ |
653 | |
654 | lb chroot "$@" |
655 | |
656 | +<<<<<<< TREE |
657 | if [ "${SUBPROJECT:-}" = minimized ]; then |
658 | # force removal of initramfs-tools, which we assert is not |
659 | # required for any minimized images but is still pulled in by |
660 | @@ -255,6 +365,20 @@ |
661 | rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old |
662 | Chroot chroot apt clean |
663 | |
664 | +======= |
665 | + if [ "${SUBPROJECT:-}" = minimized ]; then |
666 | + # and if initramfs-tools was configured before our kernel, |
667 | + # /etc/kernel/postinst.d/initramfs-tools will have created |
668 | + # an initramfs despite the generic dpkg-divert; so remove it |
669 | + # here. |
670 | + rm -f chroot/boot/initrd.img-* |
671 | + fi |
672 | + |
673 | + # remove crufty files that shouldn't be left in an image |
674 | + rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old |
675 | + Chroot chroot apt clean |
676 | + |
677 | +>>>>>>> MERGE-SOURCE |
678 | if [ -f config/oem-config-preinstalled ]; then |
679 | |
680 | # This is cargo-culted almost verbatim (with some syntax changes for |
681 | @@ -381,6 +505,7 @@ |
682 | > chroot/etc/apt/sources.list |
683 | rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig |
684 | fi |
685 | +<<<<<<< TREE |
686 | case $PROJECT:$SUBPROJECT in |
687 | *) |
688 | if [ -e "config/seeded-snaps" ]; then |
689 | @@ -411,6 +536,9 @@ |
690 | esac |
691 | |
692 | if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then |
693 | +======= |
694 | + if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then |
695 | +>>>>>>> MERGE-SOURCE |
696 | if [ "$ARCH" = "armhf" ]; then |
697 | INFO_DESC="$(lsb_release -d -s)" |
698 | echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info |
699 | @@ -428,6 +556,7 @@ |
700 | build_name: $BUILD_NAME |
701 | serial: $BUILDSTAMP |
702 | EOF |
703 | +<<<<<<< TREE |
704 | fi |
705 | |
706 | # If the image pre-installs network-manager, let it manage all devices by |
707 | @@ -445,6 +574,8 @@ |
708 | EOF |
709 | else |
710 | echo "==== NetworkManager not installed ====" |
711 | +======= |
712 | +>>>>>>> MERGE-SOURCE |
713 | fi |
714 | |
715 | echo "===== Checking size of /usr/share/doc =====" |
716 | @@ -805,6 +936,7 @@ |
717 | if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then |
718 | continue |
719 | fi |
720 | + FLAVOUR=${FLAVOUR%%-hwe-*} |
721 | if [ "$FLAVOUR" = "virtual" ]; then |
722 | # The virtual kernel is named generic in /boot |
723 | FLAVOUR="generic" |
724 | @@ -838,17 +970,18 @@ |
725 | NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" |
726 | if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then |
727 | # only one kernel flavour |
728 | + FLAVOUR=${LB_LINUX_FLAVOURS%%-hwe-*} |
729 | if [ -e "binary/$INITFS/vmlinuz" ]; then |
730 | ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" |
731 | chmod 644 "$PREFIX.kernel" |
732 | else |
733 | - ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" |
734 | + ln -sf "$PREFIX.kernel-$FLAVOUR" "$PREFIX.kernel" |
735 | fi |
736 | if [ -e "binary/$INITFS/initrd.lz" ]; then |
737 | ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" |
738 | chmod 644 "$PREFIX.initrd" |
739 | else |
740 | - ln -sf "$PREFIX.initrd-$LB_LINUX_FLAVOURS" "$PREFIX.initrd" |
741 | + ln -sf "$PREFIX.initrd-$FLAVOUR" "$PREFIX.initrd" |
742 | fi |
743 | fi |
744 | |
745 | |
746 | === modified file 'live-build/auto/config' |
747 | --- live-build/auto/config 2018-03-21 11:05:46 +0000 |
748 | +++ live-build/auto/config 2018-03-28 13:08:01 +0000 |
749 | @@ -59,9 +59,15 @@ |
750 | # failure. |
751 | |
752 | for task; do |
753 | + if [ -z "$HWE_BUILD" ]; then |
754 | # We need a ridiculous number of backslashes to protect |
755 | # parentheses from eval. |
756 | echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" |
757 | + else |
758 | + # If HWE_BUILD is set, we strip out drivers not available |
759 | + # in the HWE stack, then sed the rest with their HWE suffixes |
760 | + echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task | grep -v xserver-xorg-input-vmmouse | grep -v libgles1-mesa | sed -e 's/xserver-xorg.*/&-hwe-16.04/'" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" |
761 | + fi |
762 | done |
763 | } |
764 | |
765 | @@ -105,6 +111,7 @@ |
766 | BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1" |
767 | } |
768 | |
769 | +<<<<<<< TREE |
770 | if [ -z "${IMAGEFORMAT:-}" ]; then |
771 | case $PROJECT:${SUBPROJECT:-} in |
772 | ubuntu-cpc:*) |
773 | @@ -121,6 +128,15 @@ |
774 | mkdir -p .build |
775 | touch ".build/$STAGE" |
776 | } |
777 | +======= |
778 | +if [ -z "${IMAGEFORMAT:-}" ]; then |
779 | + case $PROJECT in |
780 | + ubuntu-cpc) |
781 | + IMAGEFORMAT=ext4 |
782 | + ;; |
783 | + esac |
784 | +fi |
785 | +>>>>>>> MERGE-SOURCE |
786 | |
787 | case $IMAGEFORMAT in |
788 | ext2|ext3|ext4) |
789 | @@ -144,6 +160,7 @@ |
790 | ;; |
791 | |
792 | plain) |
793 | +<<<<<<< TREE |
794 | INITRAMFS_TYPE=none |
795 | case $PROJECT:${SUBPROJECT:-} in |
796 | ubuntu-server:live) |
797 | @@ -201,6 +218,15 @@ |
798 | none) |
799 | OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT" |
800 | ;; |
801 | +======= |
802 | + OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT" |
803 | + PREINSTALLED=true |
804 | + ;; |
805 | + |
806 | + none) |
807 | + OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT" |
808 | + ;; |
809 | +>>>>>>> MERGE-SOURCE |
810 | *) |
811 | case $PROJECT in |
812 | ubuntu-server|ubuntu-touch|ubuntu-touch-custom) |
813 | @@ -254,6 +280,7 @@ |
814 | ;; |
815 | esac |
816 | |
817 | +<<<<<<< TREE |
818 | SIGNED_KERNEL_PACKAGE="linux-signed-generic" |
819 | |
820 | if [ "${SUBPROJECT:-}" = minimized ]; then |
821 | @@ -321,13 +348,30 @@ |
822 | -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $SEED \ |
823 | ${COMPONENTS:+-c "$COMPONENTS"} -a $ARCH) |
824 | fi |
825 | +======= |
826 | +HWE_X_PACKAGES="xserver-xorg-hwe-16.04 xserver-xorg-video-all-hwe-16.04 xserver-xorg-input-all-hwe-16.04" |
827 | +HWE_KERNEL_FLAVOUR="generic-hwe-16.04" |
828 | +HWE_SIGNED_KERNEL_PACKAGE="linux-signed-$HWE_KERNEL_FLAVOUR" |
829 | + |
830 | +if [ "${SUBPROJECT:-}" = minimized ]; then |
831 | + OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal --linux-packages=linux-image" |
832 | +fi |
833 | +>>>>>>> MERGE-SOURCE |
834 | |
835 | case $PROJECT in |
836 | ubuntu|ubuntu-dvd) |
837 | - add_task install minimal standard ubuntu-desktop |
838 | +<<<<<<< TREE |
839 | + add_task install minimal standard ubuntu-desktop |
840 | +======= |
841 | + HWE_BUILD="yes" |
842 | + add_task install minimal standard ubuntu-desktop |
843 | + add_package install $HWE_X_PACKAGES |
844 | +>>>>>>> MERGE-SOURCE |
845 | LIVE_TASK='ubuntu-live' |
846 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
847 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
848 | case $ARCH in |
849 | - amd64) add_package live $SIGNED_KERNEL_PACKAGE ;; |
850 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
851 | esac |
852 | ;; |
853 | |
854 | @@ -351,11 +395,15 @@ |
855 | ;; |
856 | |
857 | kubuntu|kubuntu-dvd) |
858 | + HWE_BUILD="yes" |
859 | add_task install minimal standard |
860 | add_task install kubuntu-desktop |
861 | + add_package install $HWE_X_PACKAGES |
862 | LIVE_TASK='kubuntu-live' |
863 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
864 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
865 | case $ARCH in |
866 | - amd64) add_package live linux-signed-generic ;; |
867 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
868 | esac |
869 | COMPONENTS='main restricted universe' |
870 | add_chroot_hook remove-gnome-icon-cache |
871 | @@ -390,16 +438,17 @@ |
872 | ;; |
873 | |
874 | xubuntu) |
875 | + HWE_BUILD="yes" |
876 | add_task install minimal standard xubuntu-desktop |
877 | + add_package install $HWE_X_PACKAGES |
878 | add_package install xterm |
879 | LIVE_TASK='xubuntu-live' |
880 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
881 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
882 | case $ARCH in |
883 | - amd64) add_package live linux-signed-generic ;; |
884 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
885 | esac |
886 | COMPONENTS='main restricted universe multiverse' |
887 | - case $ARCH in |
888 | - amd64|i386) KERNEL_FLAVOURS=generic ;; |
889 | - esac |
890 | ;; |
891 | |
892 | ubuntu-netbook) |
893 | @@ -408,25 +457,32 @@ |
894 | ;; |
895 | |
896 | mythbuntu) |
897 | + HWE_BUILD="yes" |
898 | add_task install minimal standard mythbuntu-desktop |
899 | + add_package install $HWE_X_PACKAGES |
900 | LIVE_TASK='mythbuntu-live' |
901 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
902 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
903 | case $ARCH in |
904 | - amd64) add_package live linux-signed-generic ;; |
905 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
906 | esac |
907 | COMPONENTS='main restricted universe multiverse' |
908 | ;; |
909 | |
910 | lubuntu) |
911 | + HWE_BUILD="yes" |
912 | add_task install minimal standard lubuntu-desktop |
913 | + case $ARCH in |
914 | + amd64|i386) add_package install thermald ;; |
915 | + esac |
916 | + add_package install $HWE_X_PACKAGES |
917 | LIVE_TASK='lubuntu-live' |
918 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
919 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
920 | case $ARCH in |
921 | - amd64) add_package live linux-signed-generic ;; |
922 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
923 | esac |
924 | COMPONENTS='main restricted universe multiverse' |
925 | - case $ARCH in |
926 | - amd64|i386) KERNEL_FLAVOURS=generic ;; |
927 | - esac |
928 | - |
929 | # The Lubuntu STRUCTURE file has "feature |
930 | # no-follow-recommends". Mirror this. |
931 | APT_OPTIONS="${APT_OPTIONS} --no-install-recommends" |
932 | @@ -449,10 +505,14 @@ |
933 | ;; |
934 | |
935 | ubuntu-gnome) |
936 | + HWE_BUILD="yes" |
937 | add_task install minimal standard ubuntu-gnome-desktop |
938 | + add_package install $HWE_X_PACKAGES |
939 | LIVE_TASK='ubuntu-gnome-live' |
940 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
941 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
942 | case $ARCH in |
943 | - amd64) add_package live linux-signed-generic ;; |
944 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
945 | esac |
946 | COMPONENTS='main restricted universe' |
947 | ;; |
948 | @@ -467,28 +527,41 @@ |
949 | ;; |
950 | |
951 | ubuntu-mate) |
952 | + HWE_BUILD="yes" |
953 | add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop |
954 | + case $ARCH in |
955 | + amd64|i386) add_package install thermald ;; |
956 | + esac |
957 | + add_package install $HWE_X_PACKAGES |
958 | LIVE_TASK='ubuntu-mate-live' |
959 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
960 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
961 | case $ARCH in |
962 | - amd64) add_package live linux-signed-generic ;; |
963 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
964 | esac |
965 | COMPONENTS='main restricted universe multiverse' |
966 | ;; |
967 | |
968 | ubuntustudio-dvd) |
969 | + HWE_BUILD="yes" |
970 | add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography |
971 | + add_package install $HWE_X_PACKAGES linux-generic-hwe-16.04- |
972 | COMPONENTS='main restricted universe multiverse' |
973 | case $ARCH in |
974 | - amd64|i386) KERNEL_FLAVOURS=lowlatency ;; |
975 | + amd64|i386) KERNEL_FLAVOURS=lowlatency-hwe-16.04 ;; |
976 | esac |
977 | ;; |
978 | |
979 | ubuntukylin) |
980 | + HWE_BUILD="yes" |
981 | add_task install minimal standard ubuntukylin-desktop |
982 | + add_package install $HWE_X_PACKAGES |
983 | add_package install ubuntukylin-default-settings |
984 | LIVE_TASK='ubuntukylin-live' |
985 | + LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)' |
986 | + KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR" |
987 | case $ARCH in |
988 | - amd64) add_package live linux-signed-generic ;; |
989 | + amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;; |
990 | esac |
991 | COMPONENTS='main restricted universe' |
992 | ;; |
993 | @@ -514,6 +587,7 @@ |
994 | ;; |
995 | |
996 | ubuntu-core) |
997 | +<<<<<<< TREE |
998 | OPTS="${OPTS:+$OPTS }--apt-recommends false" |
999 | |
1000 | # some workarounds because the seeds are not quite |
1001 | @@ -581,6 +655,83 @@ |
1002 | ;; |
1003 | esac |
1004 | add_package install ubuntu-minimal ubuntu-touch $HINTS |
1005 | +======= |
1006 | + # mvo: This is for cron.daily-preinstalled |
1007 | + # CDIMAGE_PREINSTALLED is not passed from build.py |
1008 | + # and PREINSTALLED means something different. So |
1009 | + # we use SUBPROJECT to pass on the information |
1010 | + if [ "$SUBPROJECT" = "system-image" ]; then |
1011 | + OPTS="${OPTS:+$OPTS }--apt-recommends false" |
1012 | + |
1013 | + # some workarounds because the seeds are not quite |
1014 | + # corrent at the moment |
1015 | + add_package install dbus |
1016 | + add_package install isc-dhcp-client |
1017 | + add_package install libpam-systemd |
1018 | + add_package install ppp |
1019 | + add_package install watchdog |
1020 | + # no Task: header yet |
1021 | + add_package install snapd |
1022 | + add_package install ubuntu-core-snapd-units |
1023 | + |
1024 | + # no minimal as we want to be really minimal |
1025 | + #add_task install minimal |
1026 | + add_task install ubuntu-core |
1027 | + |
1028 | + # more packages are pulled in via the seed. |
1029 | + # (important to remember when comparing to the |
1030 | + # livecd-rootfs from ppa:snappy-dev/image) |
1031 | + |
1032 | + case $ARCH in |
1033 | + i386) |
1034 | + # efi support can go once the task |
1035 | + # header is available for grub-efi-ia32-bin |
1036 | + add_package install grub-efi-ia32-bin |
1037 | + ;; |
1038 | + esac |
1039 | + |
1040 | + # generic kernel etc |
1041 | + KERNEL_FLAVOURS=none |
1042 | + case $ARCH in |
1043 | + i386) |
1044 | + add_package install grub-pc |
1045 | + ;; |
1046 | + amd64) |
1047 | + add_package install grub-pc-bin |
1048 | + add_package install grub-efi-amd64-signed |
1049 | + add_package install shim-signed |
1050 | + ;; |
1051 | + armhf) |
1052 | + add_package install flash-kernel u-boot-tools |
1053 | + ;; |
1054 | + arm64) |
1055 | + add_package install u-boot-tools |
1056 | + ;; |
1057 | + esac |
1058 | + OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none --initramfs-compression=none" |
1059 | + |
1060 | + # contains the framework definition |
1061 | + add_package install ubuntu-core-libs |
1062 | + |
1063 | + # universe needed for 'system-image-cli' and multiverse for firmware |
1064 | + COMPONENTS='main restricted universe multiverse' |
1065 | + fi |
1066 | + OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" |
1067 | + ;; |
1068 | + |
1069 | + ubuntu-base) |
1070 | + OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" |
1071 | + ;; |
1072 | + |
1073 | + ubuntu-touch|ubuntu-touch-custom) |
1074 | + HINTS="packagekit ubuntu-system-settings-online-accounts" |
1075 | + case $ARCH in |
1076 | + amd64|i386) |
1077 | + HINTS="$HINTS qml-module-ubuntu-components-gles unity8" |
1078 | + ;; |
1079 | + esac |
1080 | + add_package install ubuntu-minimal ubuntu-touch $HINTS |
1081 | +>>>>>>> MERGE-SOURCE |
1082 | |
1083 | COMPONENTS='main restricted universe' |
1084 | BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu' |
1085 | @@ -612,6 +763,7 @@ |
1086 | ;; |
1087 | |
1088 | ubuntu-cpc) |
1089 | +<<<<<<< TREE |
1090 | if [ "${SUBPROJECT:-}" = minimized ]; then |
1091 | add_task install cloud-image |
1092 | add_package install sudo |
1093 | @@ -639,6 +791,35 @@ |
1094 | ;; |
1095 | esac |
1096 | fi |
1097 | +======= |
1098 | + if [ "${SUBPROJECT:-}" = minimized ]; then |
1099 | + add_task install cloud-image |
1100 | + add_package install sudo |
1101 | + # linux-kvm currently only exists in xenial, not in |
1102 | + # non-LTS suites. Fall back to virtual flavor, which |
1103 | + # may or may not boot initramfsless but enables us to |
1104 | + # test building and possibly build derivative images |
1105 | + # using other kernel flavors. |
1106 | + # If you enable an extra ppa, it is assumed that |
1107 | + # linux-kvm is available since you control the |
1108 | + # archive and can provide this metapackage as |
1109 | + # necessary. |
1110 | + if [ "$ARCH" != "amd64" ] || ([ -z "$EXTRA_PPAS" ] && [ "$SUITE" != xenial ]); then |
1111 | + KERNEL_FLAVOURS=virtual |
1112 | + else |
1113 | + KERNEL_FLAVOURS=kvm |
1114 | + fi |
1115 | + else |
1116 | + add_task install minimal standard cloud-image |
1117 | + add_package install ubuntu-minimal |
1118 | + KERNEL_FLAVOURS=virtual |
1119 | + case $ARCH in |
1120 | + armhf|arm64|ppc64el|powerpc) |
1121 | + add_task install server |
1122 | + ;; |
1123 | + esac |
1124 | + fi |
1125 | +>>>>>>> MERGE-SOURCE |
1126 | |
1127 | BINARY_REMOVE_LINUX=false |
1128 | OPTS="${OPTS:+$OPTS }--initramfs=none" |
1129 | @@ -649,6 +830,12 @@ |
1130 | ;; |
1131 | arm64) |
1132 | add_package install flash-kernel |
1133 | +<<<<<<< TREE |
1134 | +======= |
1135 | + ;; |
1136 | + powerpc) |
1137 | + KERNEL_FLAVOURS=powerpc64-smp |
1138 | +>>>>>>> MERGE-SOURCE |
1139 | ;; |
1140 | esac |
1141 | OPTS="${OPTS:+$OPTS }--system=normal" |
1142 | @@ -772,6 +959,7 @@ |
1143 | ;; |
1144 | esac |
1145 | |
1146 | +<<<<<<< TREE |
1147 | case $PROJECT:${SUBPROJECT:-} in |
1148 | ubuntu-server:live) |
1149 | ;; |
1150 | @@ -780,6 +968,20 @@ |
1151 | KERNEL_FLAVOURS=none |
1152 | BINARY_REMOVE_LINUX=false |
1153 | ;; |
1154 | +======= |
1155 | +case $PROJECT in |
1156 | + ubuntu-server|ubuntu-core|ubuntu-base|ubuntu-touch|ubuntu-touch-custom) |
1157 | + case $SUBPROJECT in |
1158 | + system-image) |
1159 | + # keep the kernel for the system-image build |
1160 | + ;; |
1161 | + *) |
1162 | + OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" |
1163 | + KERNEL_FLAVOURS=none |
1164 | + BINARY_REMOVE_LINUX=false |
1165 | + ;; |
1166 | + esac |
1167 | +>>>>>>> MERGE-SOURCE |
1168 | esac |
1169 | |
1170 | add_chroot_hook update-apt-file-cache |
1171 | @@ -817,8 +1019,13 @@ |
1172 | ${KERNEL_FLAVOURS:+--linux-flavours "$KERNEL_FLAVOURS"} \ |
1173 | --initsystem none \ |
1174 | --bootloader "$BOOTLOADER" \ |
1175 | +<<<<<<< TREE |
1176 | --initramfs-compression "${INITRAMFS_COMPRESSION:-lzma}" \ |
1177 | --cache false \ |
1178 | +======= |
1179 | + --initramfs-compression lzma \ |
1180 | + --cache false \ |
1181 | +>>>>>>> MERGE-SOURCE |
1182 | ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \ |
1183 | $OPTS \ |
1184 | "$@" |
1185 | @@ -956,7 +1163,11 @@ |
1186 | fi |
1187 | ;; |
1188 | |
1189 | +<<<<<<< TREE |
1190 | ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*|ubuntu-server:live) |
1191 | +======= |
1192 | + ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*) |
1193 | +>>>>>>> MERGE-SOURCE |
1194 | cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \ |
1195 | config/ |
1196 | if [ "$IMAGEFORMAT" = none ]; then |
1197 | |
1198 | === added file 'live-build/ubuntu-cpc/functions.OTHER' |
1199 | --- live-build/ubuntu-cpc/functions.OTHER 1970-01-01 00:00:00 +0000 |
1200 | +++ live-build/ubuntu-cpc/functions.OTHER 2018-03-28 13:08:01 +0000 |
1201 | @@ -0,0 +1,320 @@ |
1202 | +# vi: ts=4 expandtab syntax=sh |
1203 | + |
1204 | +CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" |
1205 | +IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship) |
1206 | + |
1207 | +rootfs_dev_mapper= |
1208 | +loop_device= |
1209 | +loop_raw= |
1210 | +backing_img= |
1211 | + |
1212 | +clean_loops() { |
1213 | + local kpartx_ret |
1214 | + local kpartx_stdout |
1215 | + |
1216 | + if [ -n "${backing_img}" ]; then |
1217 | + # sync before removing loop to avoid "Device or resource busy" errors |
1218 | + sync |
1219 | + kpartx_ret="" |
1220 | + kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$? |
1221 | + echo "$kpartx_stdout" |
1222 | + if [ -n "$kpartx_ret" ]; then |
1223 | + if echo "$kpartx_stdout" | grep -q "loop deleted"; then |
1224 | + echo "Suppressing kpartx returning error (#860894)" |
1225 | + else |
1226 | + exit $kpartx_ret |
1227 | + fi |
1228 | + fi |
1229 | + unset backing_img |
1230 | + fi |
1231 | + |
1232 | + if [ -z "${rootfs_dev_mapper}" ]; then |
1233 | + return 0 |
1234 | + fi |
1235 | + |
1236 | + unset loop_device |
1237 | + unset loop_raw |
1238 | + unset rootfs_dev_mapper |
1239 | +} |
1240 | + |
1241 | +create_empty_disk_image() { |
1242 | + # Prepare an empty disk image |
1243 | + dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}" |
1244 | +} |
1245 | + |
1246 | +make_ext4_partition() { |
1247 | + device="$1" |
1248 | + |
1249 | + mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device" |
1250 | +} |
1251 | + |
1252 | +mount_image() { |
1253 | + trap clean_loops EXIT |
1254 | + backing_img="$1" |
1255 | + local rootpart="$2" |
1256 | + kpartx_mapping="$(kpartx -s -v -a ${backing_img})" |
1257 | + |
1258 | + # Find the loop device |
1259 | + loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" |
1260 | + loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)" |
1261 | + if [ ! -b ${loop_device} ]; then |
1262 | + echo "unable to find loop device for ${backing_img}" |
1263 | + exit 1 |
1264 | + fi |
1265 | + |
1266 | + # Find the rootfs location |
1267 | + rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" |
1268 | + if [ ! -b "${rootfs_dev_mapper}" ]; then |
1269 | + echo "${rootfs_dev_mapper} is not a block device"; |
1270 | + exit 1 |
1271 | + fi |
1272 | + |
1273 | + # Add some information to the debug logs |
1274 | + echo "Mounted disk image ${backing_img} to ${rootfs_dev_mapper}" |
1275 | + blkid ${rootfs_dev_mapper} |
1276 | + |
1277 | + return 0 |
1278 | +} |
1279 | + |
1280 | +setup_mountpoint() { |
1281 | + local mountpoint="$1" |
1282 | + |
1283 | + mount --rbind --make-rslave /dev "$mountpoint/dev" |
1284 | + mount proc-live -t proc "$mountpoint/proc" |
1285 | + mount sysfs-live -t sysfs "$mountpoint/sys" |
1286 | + mount -t tmpfs none "$mountpoint/tmp" |
1287 | + mount -t tmpfs none "$mountpoint/var/lib/apt" |
1288 | + mount -t tmpfs none "$mountpoint/var/cache/apt" |
1289 | + mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp |
1290 | + cp /etc/resolv.conf "$mountpoint/etc/resolv.conf" |
1291 | + chroot "$mountpoint" apt-get update |
1292 | + |
1293 | +} |
1294 | + |
1295 | +teardown_mountpoint() { |
1296 | + # Reverse the operations from setup_mountpoint |
1297 | + local mountpoint="$1" |
1298 | + |
1299 | + # ensure we have exactly one trailing slash, and escape all slashes for awk |
1300 | + mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/' |
1301 | + # sort -r ensures that deeper mountpoints are unmounted first |
1302 | + for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \ |
1303 | + { print \$2 }" | LC_ALL=C sort -r); do |
1304 | + umount $submount |
1305 | + done |
1306 | + mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" |
1307 | +} |
1308 | + |
1309 | +mount_partition() { |
1310 | + partition="$1" |
1311 | + mountpoint="$2" |
1312 | + |
1313 | + mount "$partition" "$mountpoint" |
1314 | + setup_mountpoint "$mountpoint" |
1315 | +} |
1316 | + |
1317 | + |
1318 | +mount_disk_image() { |
1319 | + local disk_image=${1} |
1320 | + local mountpoint=${2} |
1321 | + mount_image ${disk_image} 1 |
1322 | + mount_partition "${rootfs_dev_mapper}" $mountpoint |
1323 | + |
1324 | + local uefi_dev="/dev/mapper${loop_device///dev/}p15" |
1325 | + if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then |
1326 | + mount "${uefi_dev}" $mountpoint/boot/efi |
1327 | + fi |
1328 | + |
1329 | + # This is needed to allow for certain operations |
1330 | + # such as updating grub and installing software |
1331 | + cat > $mountpoint/usr/sbin/policy-rc.d << EOF |
1332 | +#!/bin/sh |
1333 | +# ${CLOUD_IMG_STR} |
1334 | +echo "All runlevel operations denied by policy" >&2 |
1335 | +exit 101 |
1336 | +EOF |
1337 | + chmod 0755 $mountpoint/usr/sbin/policy-rc.d |
1338 | + |
1339 | +} |
1340 | + |
1341 | +umount_partition() { |
1342 | + local mountpoint=${1} |
1343 | + teardown_mountpoint $mountpoint |
1344 | + umount -R $mountpoint |
1345 | + udevadm settle |
1346 | + |
1347 | + if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then |
1348 | + # buildd's don't have /etc/mtab symlinked |
1349 | + # /etc/mtab is needed in order zerofree space for ext4 filesystems |
1350 | + [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab |
1351 | + |
1352 | + # both of these are likely overkill, but it does result in slightly |
1353 | + # smaller ext4 filesystem |
1354 | + e2fsck -y -E discard ${rootfs_dev_mapper} |
1355 | + zerofree ${rootfs_dev_mapper} |
1356 | + fi |
1357 | +} |
1358 | + |
1359 | +umount_disk_image() { |
1360 | + mountpoint="$1" |
1361 | + |
1362 | + local uefi_dev="/dev/mapper${loop_device///dev/}p15" |
1363 | + if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then |
1364 | + umount --detach-loop "$mountpoint/boot/efi" |
1365 | + fi |
1366 | + |
1367 | + if [ -e $mountpoint/usr/sbin/policy-rc.d ]; then |
1368 | + rm $mountpoint/usr/sbin/policy-rc.d |
1369 | + fi |
1370 | + umount_partition $mountpoint |
1371 | + clean_loops |
1372 | +} |
1373 | + |
1374 | +modify_vmdk_header() { |
1375 | + # Modify the VMDK headers so that both VirtualBox _and_ VMware can |
1376 | + # read the vmdk and import them. The vodoo here is _not_ documented |
1377 | + # anywhere....so this will have to do. This is undocumented vodoo |
1378 | + # that has been learned by the Cloud Image team. |
1379 | + |
1380 | + vmdk_name="${1}" |
1381 | + descriptor=$(mktemp) |
1382 | + newdescriptor=$(mktemp) |
1383 | + |
1384 | + # Extract the vmdk header for manipulation |
1385 | + dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024 |
1386 | + |
1387 | + # The sed lines below is where the magic is. Specifically: |
1388 | + # ddb.toolsVersion: sets the open-vm-tools so that VMware shows |
1389 | + # the tooling as current |
1390 | + # ddb.virtualHWVersion: set the version to 7, which covers most |
1391 | + # current versions of VMware |
1392 | + # createType: make sure its set to stream Optimized |
1393 | + # remove the vmdk-stream-converter comment and replace with |
1394 | + # # Disk DescriptorFile. This is needed for Virtualbox |
1395 | + # remove the comments from vmdk-stream-converter which causes |
1396 | + # VirtualBox and others to fail VMDK validation |
1397 | + |
1398 | + sed -e 's|# Description file.*|# Disk DescriptorFile|' \ |
1399 | + -e '/# Believe this is random*/d' \ |
1400 | + -e '/# Indicates no parent/d' \ |
1401 | + -e '/# The Disk Data Base/d' \ |
1402 | + -e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \ |
1403 | + "${descriptor}" > "${newdescriptor}" |
1404 | + |
1405 | + # The header is cannot be bigger than 1024 |
1406 | + expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || { |
1407 | + echo "descriptor is too large, VMDK will be invalid!"; exit 1; } |
1408 | + |
1409 | + # Overwrite the vmdk header with our new, modified one |
1410 | + dd conv=notrunc,nocreat \ |
1411 | + if="${newdescriptor}" of="${vmdk_name}" \ |
1412 | + bs=1 seek=512 count=1024 |
1413 | + |
1414 | + rm ${descriptor} ${newdescriptor} |
1415 | +} |
1416 | + |
1417 | +create_vmdk() { |
1418 | + # There is no real good way to create a _compressed_ VMDK using open source |
1419 | + # tooling that works across multiple VMDK-capable platforms. This functions |
1420 | + # uses vmdk-stream-converter and then calls modify_vmdk_header to produce a |
1421 | + # compatible VMDK. |
1422 | + |
1423 | + src="$1" |
1424 | + destination="$2" |
1425 | + size="${3:-10240}" |
1426 | + |
1427 | + streamconverter="/usr/share/pyshared/VMDKstream.py" |
1428 | + scratch_d=$(mktemp -d) |
1429 | + cp ${src} ${scratch_d}/resize.img |
1430 | + |
1431 | + truncate --size=${size}M ${scratch_d}/resize.img |
1432 | + python ${streamconverter} ${scratch_d}/resize.img ${destination} |
1433 | + modify_vmdk_header ${destination} |
1434 | + |
1435 | + qemu-img info ${destination} |
1436 | + rm -rf ${scratch_d} |
1437 | +} |
1438 | + |
1439 | +create_derivative() { |
1440 | + # arg1 is the disk type |
1441 | + # arg2 is the new name |
1442 | + unset derivative_img |
1443 | + case ${1} in |
1444 | + uefi) disk_image="binary/boot/disk-uefi.ext4"; |
1445 | + dname="${disk_image//-uefi/-$2-uefi}";; |
1446 | + *) disk_image="binary/boot/disk.ext4"; |
1447 | + dname="${disk_image//.ext4/-$2.ext4}";; |
1448 | + esac |
1449 | + |
1450 | + if [ ! -e ${disk_image} ]; then |
1451 | + echo "Did not find ${disk_image}!"; exit 1; |
1452 | + fi |
1453 | + |
1454 | + cp ${disk_image} ${dname} |
1455 | + export derivative_img=${dname} |
1456 | +} |
1457 | + |
1458 | +convert_to_qcow2() { |
1459 | + |
1460 | + src="$1" |
1461 | + destination="$2" |
1462 | + qemu-img convert -c -O qcow2 -o compat=0.10 "$src" "$destination" |
1463 | + qemu-img info "$destination" |
1464 | +} |
1465 | + |
1466 | +replace_grub_root_with_label() { |
1467 | + # When update-grub is run, it will detect the disks in the build system. |
1468 | + # Instead, we want grub to use the cloudimg-rootfs labelled disk |
1469 | + CHROOT_ROOT="$1" |
1470 | + |
1471 | + # If boot by partuuid has been requested, don't override. |
1472 | + if [ -f $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg ] && \ |
1473 | + grep -q ^GRUB_FORCE_PARTUUID= $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg |
1474 | + then |
1475 | + return 0 |
1476 | + fi |
1477 | + sed -i -e "s,root=[^ ]*,root=LABEL=cloudimg-rootfs," \ |
1478 | + "$CHROOT_ROOT/boot/grub/grub.cfg" |
1479 | +} |
1480 | + |
1481 | + |
1482 | +# When running update-grub in a chroot on a build host, we don't want it to |
1483 | +# probe for disks or probe for other installed OSes. Extract common |
1484 | +# diversion wrappers, so this isn't reinvented differently for each image. |
1485 | +divert_grub() { |
1486 | + CHROOT_ROOT="$1" |
1487 | + |
1488 | + chroot "$CHROOT_ROOT" dpkg-divert --local \ |
1489 | + --rename /usr/sbin/grub-probe |
1490 | + chroot "$CHROOT_ROOT" touch /usr/sbin/grub-probe |
1491 | + chroot "$CHROOT_ROOT" chmod +x /usr/sbin/grub-probe |
1492 | + |
1493 | + chroot "$CHROOT_ROOT" dpkg-divert --local \ |
1494 | + --divert /etc/grub.d/30_os-prober.dpkg-divert \ |
1495 | + --rename /etc/grub.d/30_os-prober |
1496 | + |
1497 | + # Divert systemd-detect-virt; /etc/kernel/postinst.d/zz-update-grub |
1498 | + # no-ops if we are in a container, and the launchpad farm runs builds |
1499 | + # in lxd. We therefore pretend that we're never in a container (by |
1500 | + # exiting 1). |
1501 | + chroot "$CHROOT_ROOT" dpkg-divert --local \ |
1502 | + --rename /usr/bin/systemd-detect-virt |
1503 | + echo "exit 1" > "$CHROOT_ROOT"/usr/bin/systemd-detect-virt |
1504 | + chmod +x "$CHROOT_ROOT"/usr/bin/systemd-detect-virt |
1505 | +} |
1506 | + |
1507 | +undivert_grub() { |
1508 | + CHROOT_ROOT="$1" |
1509 | + |
1510 | + chroot "$CHROOT_ROOT" rm /usr/sbin/grub-probe |
1511 | + chroot "$CHROOT_ROOT" dpkg-divert --remove --local \ |
1512 | + --rename /usr/sbin/grub-probe |
1513 | + |
1514 | + chroot "$CHROOT_ROOT" dpkg-divert --remove --local \ |
1515 | + --divert /etc/grub.d/30_os-prober.dpkg-divert \ |
1516 | + --rename /etc/grub.d/30_os-prober |
1517 | + |
1518 | + rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt |
1519 | + chroot "$CHROOT_ROOT" dpkg-divert --remove --local \ |
1520 | + --rename /usr/bin/systemd-detect-virt |
1521 | +} |
1522 | |
1523 | === added file 'live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER' |
1524 | --- live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER 1970-01-01 00:00:00 +0000 |
1525 | +++ live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER 2018-03-28 13:08:01 +0000 |
1526 | @@ -0,0 +1,27 @@ |
1527 | +#!/bin/bash -ex |
1528 | + |
1529 | +if [ -n "$SUBARCH" ]; then |
1530 | + echo "Skipping rootfs build for subarch flavor build" |
1531 | + exit 0 |
1532 | +fi |
1533 | + |
1534 | +. config/functions |
1535 | + |
1536 | +mkdir binary/boot/filesystem.dir |
1537 | +cp -a chroot/* binary/boot/filesystem.dir |
1538 | + |
1539 | +setup_mountpoint binary/boot/filesystem.dir |
1540 | + |
1541 | +chroot binary/boot/filesystem.dir dpkg-divert --local --rename /usr/sbin/grub-probe |
1542 | +chroot binary/boot/filesystem.dir touch /usr/sbin/grub-probe |
1543 | +chroot binary/boot/filesystem.dir chmod +x /usr/sbin/grub-probe |
1544 | + |
1545 | +env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+' |
1546 | +env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^grub-.*' |
1547 | +env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get autoremove --purge --assume-yes |
1548 | +chroot binary/boot/filesystem.dir mkdir /lib/modules |
1549 | + |
1550 | +chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe |
1551 | +chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe |
1552 | + |
1553 | +teardown_mountpoint binary/boot/filesystem.dir |
1554 | |
1555 | === modified file 'live-build/ubuntu-cpc/hooks/032-disk-image.binary' |
1556 | --- live-build/ubuntu-cpc/hooks/032-disk-image.binary 2018-03-06 12:58:38 +0000 |
1557 | +++ live-build/ubuntu-cpc/hooks/032-disk-image.binary 2018-03-28 13:08:01 +0000 |
1558 | @@ -1,11 +1,17 @@ |
1559 | #!/bin/bash -ex |
1560 | |
1561 | +<<<<<<< TREE |
1562 | IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" |
1563 | FS_LABEL="cloudimg-rootfs" |
1564 | |
1565 | . config/binary |
1566 | |
1567 | . config/functions |
1568 | +======= |
1569 | +. config/functions |
1570 | + |
1571 | +. config/binary |
1572 | +>>>>>>> MERGE-SOURCE |
1573 | |
1574 | BOOTPART_START= |
1575 | BOOTPART_END= |
1576 | |
1577 | === modified file 'live-build/ubuntu-cpc/hooks/032-root-squashfs.binary' |
1578 | --- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-11-10 07:49:30 +0000 |
1579 | +++ live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2018-03-28 13:08:01 +0000 |
1580 | @@ -17,6 +17,7 @@ |
1581 | exit 0 |
1582 | fi |
1583 | |
1584 | +<<<<<<< TREE |
1585 | . config/functions |
1586 | |
1587 | mkdir binary/boot/squashfs.dir |
1588 | @@ -39,6 +40,8 @@ |
1589 | |
1590 | teardown_mountpoint binary/boot/squashfs.dir |
1591 | |
1592 | +======= |
1593 | +>>>>>>> MERGE-SOURCE |
1594 | squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs" |
1595 | squashfs_f_manifest="${squashfs_f}.manifest" |
1596 | |
1597 | |
1598 | === modified file 'live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary' |
1599 | --- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2018-03-06 12:58:38 +0000 |
1600 | +++ live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2018-03-28 13:08:01 +0000 |
1601 | @@ -9,12 +9,16 @@ |
1602 | ;; |
1603 | esac |
1604 | |
1605 | +<<<<<<< TREE |
1606 | IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" |
1607 | FS_LABEL="cloudimg-rootfs" |
1608 | |
1609 | . config/binary |
1610 | |
1611 | . config/functions |
1612 | +======= |
1613 | +. config/functions |
1614 | +>>>>>>> MERGE-SOURCE |
1615 | |
1616 | create_partitions() { |
1617 | disk_image="$1" |
1618 | @@ -64,6 +68,7 @@ |
1619 | efi_boot_dir="/boot/efi/EFI/BOOT" |
1620 | chroot mountpoint mkdir -p "${efi_boot_dir}" |
1621 | |
1622 | +<<<<<<< TREE |
1623 | if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then |
1624 | # FIXME: code duplicated between 032-disk-image.binary |
1625 | # and 033-disk-image-uefi.binary. We want to fix this to not |
1626 | @@ -78,9 +83,30 @@ |
1627 | # non-Secure Boot systems. If you need an extra module not already |
1628 | # provided or run into "Secure Boot policy forbids loading X" problems, |
1629 | # please file a bug against grub2 to include the affected module. |
1630 | +======= |
1631 | + if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then |
1632 | + # FIXME: code duplicated between 032-disk-image.binary |
1633 | + # and 033-disk-image-uefi.binary. We want to fix this to not |
1634 | + # have initramfs-tools installed at all on these images. |
1635 | + echo "partuuid found for root device; omitting initrd" |
1636 | + echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg |
1637 | + fi |
1638 | + |
1639 | + chroot mountpoint apt-get -y update |
1640 | + |
1641 | + # The modules below only make sense on non-Secure Boot UEFI systems. |
1642 | + # Otherwise, with Secure Boot enabled GRUB will refuse to load them. |
1643 | + # Any modules already in debian/build-efi-images do not need to be listed. |
1644 | + # Furthermore, other modules such as terminal, video_* and efi_* are all |
1645 | + # already available. |
1646 | +>>>>>>> MERGE-SOURCE |
1647 | case $ARCH in |
1648 | arm64) |
1649 | chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin |
1650 | +<<<<<<< TREE |
1651 | +======= |
1652 | + grub_modules="serial" |
1653 | +>>>>>>> MERGE-SOURCE |
1654 | efi_target=arm64-efi |
1655 | ;; |
1656 | armhf) |
1657 | @@ -89,10 +115,23 @@ |
1658 | ;; |
1659 | amd64) |
1660 | chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed |
1661 | +<<<<<<< TREE |
1662 | +======= |
1663 | + grub_modules="multiboot serial usb usb_keyboard" |
1664 | +>>>>>>> MERGE-SOURCE |
1665 | efi_target=x86_64-efi |
1666 | ;; |
1667 | esac |
1668 | |
1669 | +<<<<<<< TREE |
1670 | +======= |
1671 | + cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg |
1672 | +${CLOUD_IMG_STR} |
1673 | +# For Cloud Image compatability |
1674 | +GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}" |
1675 | +EOF |
1676 | + |
1677 | +>>>>>>> MERGE-SOURCE |
1678 | chroot mountpoint grub-install "${loop_device}" \ |
1679 | --boot-directory=/boot \ |
1680 | --efi-directory=/boot/efi \ |
1681 | |
1682 | === modified file 'live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary' |
1683 | --- live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2017-12-06 22:22:41 +0000 |
1684 | +++ live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2018-03-28 13:08:01 +0000 |
1685 | @@ -7,12 +7,16 @@ |
1686 | ;; |
1687 | esac |
1688 | |
1689 | +<<<<<<< TREE |
1690 | IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" |
1691 | FS_LABEL="cloudimg-rootfs" |
1692 | |
1693 | . config/binary |
1694 | |
1695 | . config/functions |
1696 | +======= |
1697 | +. config/functions |
1698 | +>>>>>>> MERGE-SOURCE |
1699 | |
1700 | create_partitions() { |
1701 | disk_image="$1" |
1702 | @@ -30,8 +34,13 @@ |
1703 | mkdir mountpoint |
1704 | mount_partition "${rootfs_dev_mapper}" mountpoint |
1705 | |
1706 | +<<<<<<< TREE |
1707 | chroot mountpoint apt-get -qqy update |
1708 | chroot mountpoint apt-get -qqy install grub-ieee1275 |
1709 | +======= |
1710 | + chroot mountpoint apt-get -qqy update |
1711 | + chroot mountpoint apt-get -qqy install grub2 |
1712 | +>>>>>>> MERGE-SOURCE |
1713 | chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 |
1714 | |
1715 | # set the kernel commandline to use hvc0 |
1716 | |
1717 | === modified file 'live-build/ubuntu-cpc/hooks/040-qcow2-image.binary' |
1718 | --- live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2017-11-20 20:18:33 +0000 |
1719 | +++ live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2018-03-28 13:08:01 +0000 |
1720 | @@ -18,7 +18,16 @@ |
1721 | ;; |
1722 | esac |
1723 | |
1724 | -. config/functions |
1725 | +<<<<<<< TREE |
1726 | +. config/functions |
1727 | +======= |
1728 | + |
1729 | +. config/functions |
1730 | + |
1731 | +if [ -f binary/boot/disk.ext4 ]; then |
1732 | + convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img |
1733 | +fi |
1734 | +>>>>>>> MERGE-SOURCE |
1735 | |
1736 | if [ -f binary/boot/disk-uefi.ext4 ]; then |
1737 | convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img |
1738 | |
1739 | === modified file 'live-build/ubuntu-cpc/hooks/040-vmdk-image.binary' |
1740 | --- live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2018-03-20 18:30:27 +0000 |
1741 | +++ live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2018-03-28 13:08:01 +0000 |
1742 | @@ -3,14 +3,27 @@ |
1743 | # |
1744 | # Generate VMDK files |
1745 | |
1746 | -case ${SUBPROJECT:-} in |
1747 | - minimized) |
1748 | - echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1749 | - exit 0 |
1750 | - ;; |
1751 | - *) |
1752 | - ;; |
1753 | -esac |
1754 | +<<<<<<< TREE |
1755 | +case ${SUBPROJECT:-} in |
1756 | + minimized) |
1757 | + echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1758 | + exit 0 |
1759 | + ;; |
1760 | + *) |
1761 | + ;; |
1762 | +esac |
1763 | +======= |
1764 | +case ${SUBPROJECT:-} in |
1765 | + minimized) |
1766 | + echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1767 | + exit 0 |
1768 | + ;; |
1769 | + *) |
1770 | + ;; |
1771 | +esac |
1772 | + |
1773 | +extension="disk1.vmdk" |
1774 | +>>>>>>> MERGE-SOURCE |
1775 | |
1776 | case $ARCH in |
1777 | amd64) ;; |
1778 | @@ -18,6 +31,7 @@ |
1779 | exit 0;; |
1780 | esac |
1781 | |
1782 | +<<<<<<< TREE |
1783 | case ${IMAGE_TARGETS:-} in |
1784 | ""|*vmdk*) |
1785 | ;; |
1786 | @@ -26,6 +40,9 @@ |
1787 | exit 0 |
1788 | ;; |
1789 | esac |
1790 | +======= |
1791 | +. config/functions |
1792 | +>>>>>>> MERGE-SOURCE |
1793 | |
1794 | . config/functions |
1795 | |
1796 | |
1797 | === modified file 'live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary' |
1798 | --- live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2018-03-20 18:30:27 +0000 |
1799 | +++ live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2018-03-28 13:08:01 +0000 |
1800 | @@ -9,20 +9,36 @@ |
1801 | # |
1802 | # For this step, we re-use the VMDK's made in 040-vmdk-image.binary |
1803 | |
1804 | -case ${SUBPROJECT:-} in |
1805 | - minimized) |
1806 | - echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1807 | - exit 0 |
1808 | - ;; |
1809 | - *) |
1810 | - ;; |
1811 | -esac |
1812 | - |
1813 | - |
1814 | -# Switch on $ARCH to determine which ID and description to use in the produced |
1815 | -# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as |
1816 | -# well use them. |
1817 | +<<<<<<< TREE |
1818 | +case ${SUBPROJECT:-} in |
1819 | + minimized) |
1820 | + echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1821 | + exit 0 |
1822 | + ;; |
1823 | + *) |
1824 | + ;; |
1825 | +esac |
1826 | + |
1827 | + |
1828 | +# Switch on $ARCH to determine which ID and description to use in the produced |
1829 | +# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as |
1830 | +# well use them. |
1831 | +======= |
1832 | +case ${SUBPROJECT:-} in |
1833 | + minimized) |
1834 | + echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1835 | + exit 0 |
1836 | + ;; |
1837 | + *) |
1838 | + ;; |
1839 | +esac |
1840 | + |
1841 | +# Switch on $ARCH to determine which ID and description to use in the produced |
1842 | +# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as |
1843 | +# well use them. |
1844 | +>>>>>>> MERGE-SOURCE |
1845 | case $ARCH in |
1846 | +<<<<<<< TREE |
1847 | amd64) |
1848 | ovf_id=94 |
1849 | ovf_os_type="ubuntu64Guest" |
1850 | @@ -41,6 +57,21 @@ |
1851 | ;; |
1852 | esac |
1853 | |
1854 | +======= |
1855 | + amd64) |
1856 | + ovf_id=94 |
1857 | + ovf_os_type="ubuntu64Guest" |
1858 | + ovf_desc_bits=64 ;; |
1859 | + i386) |
1860 | + ovf_id=93 |
1861 | + ovf_os_type="ubuntu32Guest" |
1862 | + ovf_desc_bits=32 ;; |
1863 | + *) |
1864 | + echo "OVA images are not supported for $ARCH yet."; |
1865 | + exit 0;; |
1866 | +esac |
1867 | + |
1868 | +>>>>>>> MERGE-SOURCE |
1869 | cur_d=${PWD} |
1870 | my_d=$(dirname $(readlink -f ${0})) |
1871 | |
1872 | |
1873 | === modified file 'live-build/ubuntu-cpc/hooks/042-vagrant.binary' |
1874 | --- live-build/ubuntu-cpc/hooks/042-vagrant.binary 2018-03-20 18:30:27 +0000 |
1875 | +++ live-build/ubuntu-cpc/hooks/042-vagrant.binary 2018-03-28 13:08:01 +0000 |
1876 | @@ -3,6 +3,7 @@ |
1877 | # |
1878 | # Generate a generic Vagrant Box. |
1879 | # |
1880 | +<<<<<<< TREE |
1881 | # Vagrant images are essentially nothing more than OVA's with extra-metadata |
1882 | # and some preinstalled packages. |
1883 | # |
1884 | @@ -32,6 +33,28 @@ |
1885 | exit 0 |
1886 | ;; |
1887 | esac |
1888 | +======= |
1889 | +# Vagrant images are essentially nothing more than OVA's with extra-metadata |
1890 | +# and some preinstalled packages. |
1891 | +# |
1892 | +# We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the |
1893 | +# instance. This build step creates a cloud-config ISO so that Cloud-Init |
1894 | +# will configure the initial user, creates meta-data that tells Vagrant how |
1895 | +# to interact with the cloud-init created users, and finally create the OVA. |
1896 | +# |
1897 | +# For this step, we make a deriviative of binary/boot/disk.ext4 and install |
1898 | +# some packages in it, convert it to a vmdk, and then assemble the vagrant |
1899 | +# box. |
1900 | + |
1901 | +case ${SUBPROJECT:-} in |
1902 | + minimized) |
1903 | + echo "Skipping minimized $0 build as images won't boot with linux-kvm" |
1904 | + exit 0 |
1905 | + ;; |
1906 | + *) |
1907 | + ;; |
1908 | +esac |
1909 | +>>>>>>> MERGE-SOURCE |
1910 | |
1911 | cur_d=${PWD} |
1912 | my_d=$(dirname $(readlink -f ${0})) |
1913 | @@ -40,13 +63,27 @@ |
1914 | # OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as |
1915 | # well use them. |
1916 | case $ARCH in |
1917 | - amd64) |
1918 | - ovf_id=94 |
1919 | - ovf_os_type="ubuntu64Guest" |
1920 | - ovf_desc_bits=64 ;; |
1921 | - *) |
1922 | - echo "Vagrant images are not supported for $ARCH yet." |
1923 | - exit 0;; |
1924 | +<<<<<<< TREE |
1925 | + amd64) |
1926 | + ovf_id=94 |
1927 | + ovf_os_type="ubuntu64Guest" |
1928 | + ovf_desc_bits=64 ;; |
1929 | + *) |
1930 | + echo "Vagrant images are not supported for $ARCH yet." |
1931 | + exit 0;; |
1932 | +======= |
1933 | + amd64) |
1934 | + ovf_id=94 |
1935 | + ovf_os_type="ubuntu64Guest" |
1936 | + ovf_desc_bits=64 ;; |
1937 | + i386) |
1938 | + ovf_id=93 |
1939 | + ovf_os_type="ubuntu32Guest" |
1940 | + ovf_desc_bits=32 ;; |
1941 | + *) |
1942 | + echo "Vagrant images are not supported for $ARCH yet." |
1943 | + exit 0;; |
1944 | +>>>>>>> MERGE-SOURCE |
1945 | esac |
1946 | |
1947 | . config/functions |
1948 | @@ -54,49 +91,97 @@ |
1949 | # Lets be safe about this |
1950 | box_d=$(mktemp -d) |
1951 | seed_d=$(mktemp -d) |
1952 | -mount_d=$(mktemp -d) |
1953 | - |
1954 | -create_derivative "disk" "vagrant" #sets ${derivative_img} |
1955 | -mount_disk_image ${derivative_img} ${mount_d} |
1956 | - |
1957 | -cleanup_vagrant() { |
1958 | - if [ -d "$mount_d" ]; then |
1959 | - umount_disk_image "$mount_d" |
1960 | - fi |
1961 | - rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img} |
1962 | -} |
1963 | -trap cleanup_vagrant EXIT |
1964 | - |
1965 | -chroot ${mount_d} apt-get update |
1966 | -# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to |
1967 | -# avoid pulling into a cloud image. |
1968 | -chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils |
1969 | -chroot ${mount_d} apt-get clean |
1970 | - |
1971 | -# Create and setup users inside the image. |
1972 | -# Vagrant users expect a "vagrant" user with a "vagrant" username. |
1973 | -# See https://www.vagrantup.com/docs/boxes/base.html |
1974 | -# Note: We decided NOT to allow root login with a default password. |
1975 | -chroot ${mount_d} adduser vagrant --disabled-password --gecos "" |
1976 | -echo "vagrant:vagrant" | chroot ${mount_d} chpasswd |
1977 | - |
1978 | -# The vagrant user should have passwordless sudo. |
1979 | -cat << EOF > ${mount_d}/etc/sudoers.d/vagrant |
1980 | -vagrant ALL=(ALL) NOPASSWD:ALL |
1981 | -EOF |
1982 | - |
1983 | -# Add the insecure vagrant pubkey to the vagrant user, as is expected by the |
1984 | -# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html) |
1985 | -chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant |
1986 | -chroot ${mount_d} mkdir -p /home/vagrant/.ssh |
1987 | -cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys |
1988 | -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key |
1989 | -EOF |
1990 | -chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh |
1991 | -chroot ${mount_d} chmod 700 /home/vagrant/.ssh |
1992 | - |
1993 | -umount_disk_image "$mount_d" |
1994 | -rmdir "$mount_d" |
1995 | +<<<<<<< TREE |
1996 | +mount_d=$(mktemp -d) |
1997 | + |
1998 | +create_derivative "disk" "vagrant" #sets ${derivative_img} |
1999 | +mount_disk_image ${derivative_img} ${mount_d} |
2000 | + |
2001 | +cleanup_vagrant() { |
2002 | + if [ -d "$mount_d" ]; then |
2003 | + umount_disk_image "$mount_d" |
2004 | + fi |
2005 | + rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img} |
2006 | +} |
2007 | +trap cleanup_vagrant EXIT |
2008 | + |
2009 | +chroot ${mount_d} apt-get update |
2010 | +# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to |
2011 | +# avoid pulling into a cloud image. |
2012 | +chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils |
2013 | +chroot ${mount_d} apt-get clean |
2014 | + |
2015 | +# Create and setup users inside the image. |
2016 | +# Vagrant users expect a "vagrant" user with a "vagrant" username. |
2017 | +# See https://www.vagrantup.com/docs/boxes/base.html |
2018 | +# Note: We decided NOT to allow root login with a default password. |
2019 | +chroot ${mount_d} adduser vagrant --disabled-password --gecos "" |
2020 | +echo "vagrant:vagrant" | chroot ${mount_d} chpasswd |
2021 | + |
2022 | +# The vagrant user should have passwordless sudo. |
2023 | +cat << EOF > ${mount_d}/etc/sudoers.d/vagrant |
2024 | +vagrant ALL=(ALL) NOPASSWD:ALL |
2025 | +EOF |
2026 | + |
2027 | +# Add the insecure vagrant pubkey to the vagrant user, as is expected by the |
2028 | +# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html) |
2029 | +chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant |
2030 | +chroot ${mount_d} mkdir -p /home/vagrant/.ssh |
2031 | +cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys |
2032 | +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key |
2033 | +EOF |
2034 | +chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh |
2035 | +chroot ${mount_d} chmod 700 /home/vagrant/.ssh |
2036 | + |
2037 | +umount_disk_image "$mount_d" |
2038 | +rmdir "$mount_d" |
2039 | +======= |
2040 | +mount_d=$(mktemp -d) |
2041 | + |
2042 | +create_derivative "disk" "vagrant" #sets ${derivative_img} |
2043 | +mount_disk_image ${derivative_img} ${mount_d} |
2044 | + |
2045 | +cleanup_vagrant() { |
2046 | + if [ -d "$mount_d" ]; then |
2047 | + umount_disk_image "$mount_d" |
2048 | + fi |
2049 | + rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img} |
2050 | +} |
2051 | +trap cleanup_vagrant EXIT |
2052 | + |
2053 | +chroot ${mount_d} apt-get update |
2054 | +# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to |
2055 | +# avoid pulling into a cloud image. |
2056 | +chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils |
2057 | +chroot ${mount_d} apt-get clean |
2058 | + |
2059 | +# Create and setup users inside the image. |
2060 | +# Vagrant users expect a "vagrant" user with a "vagrant" username. |
2061 | +# See https://www.vagrantup.com/docs/boxes/base.html |
2062 | +# Note: We decided NOT to allow root login with a default password. |
2063 | +# --disabled-password and --gecos need to be passed to avoid adduser |
2064 | +# asking questions when running in an interactive shell |
2065 | +chroot ${mount_d} adduser vagrant --disabled-password --gecos "" |
2066 | +echo "vagrant:vagrant" | chroot ${mount_d} chpasswd |
2067 | + |
2068 | +# The vagrant user should have passwordless sudo. |
2069 | +cat << EOF > ${mount_d}/etc/sudoers.d/vagrant |
2070 | +vagrant ALL=(ALL) NOPASSWD:ALL |
2071 | +EOF |
2072 | + |
2073 | +# Add the insecure vagrant pubkey to the vagrant user, as is expected by the |
2074 | +# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html) |
2075 | +chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant |
2076 | +chroot ${mount_d} mkdir -p /home/vagrant/.ssh |
2077 | +cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys |
2078 | +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key |
2079 | +EOF |
2080 | +chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh |
2081 | +chroot ${mount_d} chmod 700 /home/vagrant/.ssh |
2082 | + |
2083 | +umount_disk_image "$mount_d" |
2084 | +rmdir "$mount_d" |
2085 | +>>>>>>> MERGE-SOURCE |
2086 | |
2087 | # Used to identify bits |
2088 | suite=$(chroot chroot lsb_release -c -s) |
2089 | |
2090 | === added file 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot' |
2091 | --- live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot 1970-01-01 00:00:00 +0000 |
2092 | +++ live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot 2018-03-28 13:08:01 +0000 |
2093 | @@ -0,0 +1,9 @@ |
2094 | +#!/bin/bash |
2095 | +# |
2096 | +# Set InitiatorName to be runtime generated when iscsid first starts, so |
2097 | +# that each cloud image gets a unique value |
2098 | +# |
2099 | + |
2100 | +if [ -f /etc/iscsi/initiatorname.iscsi ]; then |
2101 | + echo "GenerateName=yes" > /etc/iscsi/initiatorname.iscsi |
2102 | +fi |
2103 | |
2104 | === renamed file 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot' => 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot.moved' |
2105 | === modified file 'live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot' |
2106 | --- live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot 2017-10-19 01:11:53 +0000 |
2107 | +++ live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot 2018-03-28 13:08:01 +0000 |
2108 | @@ -59,6 +59,7 @@ |
2109 | _xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*' |
2110 | |
2111 | ## -------------- |
2112 | +<<<<<<< TREE |
2113 | if [ "${SUBPROJECT:-}" != minimized ]; then |
2114 | _xchroot "${rootd}" locale-gen en_US.utf8 |
2115 | fi |
2116 | @@ -68,6 +69,11 @@ |
2117 | # should be C.UTF-8 for 17.10 and later. For earlier releases, cloud-init may |
2118 | # override this. |
2119 | echo LANG="C.UTF-8" > "${rootd}/etc/default/locale" |
2120 | +======= |
2121 | +if [ "${SUBPROJECT:-}" != minimized ]; then |
2122 | + _xchroot "${rootd}" locale-gen en_US.utf8 |
2123 | +fi |
2124 | +>>>>>>> MERGE-SOURCE |
2125 | |
2126 | ## -------------- |
2127 | # set cloud-init to be on |
2128 | @@ -130,6 +136,7 @@ |
2129 | } > "${rootd}/etc/overlayroot.local.conf" |
2130 | fi |
2131 | |
2132 | +<<<<<<< TREE |
2133 | # previous steps may have left a dangling symlink here with |
2134 | # SUBPROJECT=minimized and that breaks lb_chroot_hacks step |
2135 | if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; then |
2136 | @@ -156,6 +163,34 @@ |
2137 | |
2138 | _xchroot "${rootd}" apt clean |
2139 | fi |
2140 | +======= |
2141 | +# previous steps may have left a dangling symlink here with |
2142 | +# SUBPROJECT=minimized and that breaks lb_chroot_hacks step |
2143 | +if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; then |
2144 | + rm "${rootd}/boot/initrd.img" |
2145 | +fi |
2146 | + |
2147 | +if [ "${SUBPROJECT:-}" = minimized ]; then |
2148 | + # Remove various packages that we don't want in the minimized images. |
2149 | + # Some of these are tools that don't make sense by default |
2150 | + # non-interactively; some are libraries whose reverse-dependencies |
2151 | + # will have already been removed; open-vm-tools, it's a bug that this |
2152 | + # is in the common cloud seed because this should only be included |
2153 | + # in VMWare guest images, and we know none of the minimized images |
2154 | + # are targeted at VMWare. |
2155 | + _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \ |
2156 | + apt-mark auto '^lib.*' '^python*' vim-runtime 2>/dev/null |
2157 | + # FIXME: iso-codes is a dep of software-properties and shouldn't be |
2158 | + _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \ |
2159 | + apt-get -y autoremove --purge iso-codes xauth pastebinit \ |
2160 | + plymouth open-vm-tools git shared-mime-info vim vim-common \ |
2161 | + console-setup ncurses-term tmux screen policykit-1 \ |
2162 | + xdg-user-dirs less run-one apport-symptoms \ |
2163 | + ubuntu-cloudimage-keyring file |
2164 | + |
2165 | + _xchroot "${rootd}" apt clean |
2166 | +fi |
2167 | +>>>>>>> MERGE-SOURCE |
2168 | |
2169 | #### END COMMON ARCH FUNCTIONS |
2170 | |
2171 | |
2172 | === modified file 'live-build/ubuntu-cpc/hooks/999-extras.binary' |
2173 | --- live-build/ubuntu-cpc/hooks/999-extras.binary 2017-04-13 17:54:14 +0000 |
2174 | +++ live-build/ubuntu-cpc/hooks/999-extras.binary 2018-03-28 13:08:01 +0000 |
2175 | @@ -8,9 +8,14 @@ |
2176 | exit 0 |
2177 | fi |
2178 | |
2179 | +<<<<<<< TREE |
2180 | export IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" |
2181 | export CLOUD_IMG_STR="$IMAGE_STR" |
2182 | export FS_LABEL="cloudimg-rootfs" |
2183 | +======= |
2184 | +# Export the common functions to the extras |
2185 | +. config/functions |
2186 | +>>>>>>> MERGE-SOURCE |
2187 | |
2188 | # Cleaner execution |
2189 | /bin/run-parts --exit-on-error --regex ".*\.binary" "${extra_d}" |
2190 | |
2191 | === added symlink 'live-build/ubuntu-touch-custom' |
2192 | === target is u'ubuntu-touch/' |
2193 | === renamed symlink 'live-build/ubuntu-touch-custom' => 'live-build/ubuntu-touch-custom.moved' |
2194 | === modified file 'live-build/ubuntu-touch/hooks/00-uid-gid-fix.chroot_early' |