Merge lp:~tribaal/livecd-rootfs/xenial-proposed-build-info-minimal into lp:livecd-rootfs

Proposed by Chris Glass
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
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.

Description of the change

This change backports changes from bionic where the /etc/cloud/build.info file gets properly filled with a "minimal" build type instead of the generic "server" type when building cloud-images.

To post a comment you must log in.

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

Merge lp:~rbalint/livecd-rootfs/vagrant-interactive-xenial

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

Merge lp:~rbalint/livecd-rootfs/deps-xenial

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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2018-03-27 19:12:35 +0000
+++ debian/changelog 2018-03-28 13:08:01 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1livecd-rootfs (2.516) bionic; urgency=medium2livecd-rootfs (2.516) bionic; urgency=medium
23
3 [ Chris Glass ]4 [ Chris Glass ]
@@ -1042,6 +1043,340 @@
10421043
1043 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 04 May 2016 12:49:23 +02001044 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 04 May 2016 12:49:23 +0200
10441045
1046=======
1047livecd-rootfs (2.408.29) UNRELEASED; urgency=medium
1048
1049 * ubuntu-cpc: When performing a minimized build make sure the
1050 /etc/cloud/build.info file says "minimal" (LP: #1759519)
1051
1052 -- Christopher Glass (Ubuntu) <tribaal@ubuntu.com> Wed, 28 Mar 2018 12:08:48 +0200
1053
1054livecd-rootfs (2.408.28) xenial; urgency=medium
1055
1056 * ubuntu-cpc: When performing a minimized build, don't generate artifacts
1057 that won't boot with the linux-kvm kernel (LP: #1757223).
1058
1059 -- Daniel Watkins <daniel.watkins@canonical.com> Tue, 20 Mar 2018 12:42:25 -0400
1060
1061livecd-rootfs (2.408.27) xenial; urgency=medium
1062
1063 * Don't ask for password and GECOS while creating vagrant user
1064 (LP: #1569237)
1065
1066 -- Balint Reczey <rbalint@ubuntu.com> Thu, 21 Dec 2017 09:20:32 +0100
1067
1068livecd-rootfs (2.408.26) xenial; urgency=medium
1069
1070 * Added a "vagrant" user to the vagrant image in addition to the "ubuntu"
1071 user, in accordance with the vagrant community's expectations (LP: #1569237)
1072
1073 -- Christopher Glass (Ubuntu) <tribaal@ubuntu.com> Thu, 07 Dec 2017 14:00:59 +0100
1074
1075livecd-rootfs (2.408.25) xenial; urgency=medium
1076
1077 * Sort and list dependencies nicely
1078 * Depend on packages instead of installing them at run time
1079 * Use xz -T4 instead of pxz.
1080 Supported xz versions before 5.2 accept the -T4 option but ignore it.
1081 Also depend on xz-utils instead of downloading pxz. (LP: #1701132)
1082
1083 -- Balint Reczey <rbalint@ubuntu.com> Wed, 06 Dec 2017 11:34:04 +0100
1084
1085livecd-rootfs (2.408.24) xenial; urgency=medium
1086
1087 * For the IMAGEFORMAT=none parts to work for ubuntu-image classic builds, we
1088 need to make sure IMAGEFORMAT is preserved and not overwritten if defined.
1089 Backporting from artful.
1090
1091 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 21 Nov 2017 17:01:14 +0100
1092
1093livecd-rootfs (2.408.23) xenial; urgency=medium
1094
1095 [ Gary Wang ]
1096 * Add the IMAGEFORMAT=none to support generating a single rootfs
1097 (LP: #1730642)
1098
1099 [ Christopher Glass (Ubuntu) ]
1100 * Backport "minimized round 2" changes from trunk to Xenial (LP: #1731492)
1101 * Remove apt, debconf, dpkg cruft files from /var/cache and /var/lib in
1102 all our livefses.
1103 * Pass --cache false to lb config; otherwise we copy around caches of
1104 .debs that are never used properly, and which prevent us from emptying
1105 /var/cache/apt in images.
1106 * When building minimized cloud images, remove various packages that we
1107 don't want installed by default. Some are tools that aren't needed for
1108 non-interactive use; some are libraries whose reverse-dependencies
1109 will have already been removed; and one, open-vm-tools, should only be
1110 included in images that are targeted to VMWare (which is not the case
1111 for any of the current minimal images), rather than being included
1112 directly in the cloud-image seed.
1113
1114 -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 14 Nov 2017 11:21:48 -0800
1115
1116livecd-rootfs (2.408.22) xenial; urgency=medium
1117
1118 * Make sure to remove any initramfs that was generated in a minimized
1119 image.
1120 * divert /usr/bin/systemd-detect-virt as part of the grub diversions, so
1121 that the grub kernel postinst hook is operational when we're building
1122 in a container. LP: #1729034.
1123
1124 -- Steve Langasek <steve.langasek@ubuntu.com> Sat, 21 Oct 2017 20:53:02 -0700
1125
1126livecd-rootfs (2.408.21) xenial; urgency=medium
1127
1128 [ Balint Reczey ]
1129 * Use kvm kernel only on amd64.
1130 * Make non-x86 minimized images consistent with x86 by not explicitly
1131 installing the server task.
1132 * Clean up dangling /boot/initrd.img symlink left behind on minimized
1133 builds.
1134
1135 -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 20 Oct 2017 23:10:29 -0700
1136
1137livecd-rootfs (2.408.20) xenial; urgency=medium
1138
1139 * Now that grub-related diversions have been factored out in 2.466
1140 instead of having bogus root=stuff arg generated in grub.cfg, it is
1141 actually empty. Therefore update the sed command to make the arg in
1142 the root= token optional. This should resolve non-booting livecd cpc
1143 images.
1144
1145 -- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 10 Oct 2017 13:49:49 +0100
1146
1147livecd-rootfs (2.408.19) xenial; urgency=medium
1148
1149 [ Nishanth Aravamudan ]
1150 * live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI
1151 Initiator Name at first iscsid run for cloud images to ensure it is
1152 unique (LP: #1444992).
1153
1154 [ Steve Langasek ]
1155 * Improve teardown_mountpoint to recursively find all submounts and
1156 unmount them, instead of working from a hard-coded list. This makes
1157 the code resilient against other submounts being added later, including
1158 downstream. LP: #1721279.
1159 * Also nuke the sleep / udevadm settle calls in the process, which should
1160 never be required and slow down the builds.
1161 * Fix a reference to an undefined variable in a script that's set -u.
1162 * Use /bin/sh, not /bin/bash, for autopkgtest.
1163 * debian/tests/default-bootstraps: minor adjustments to shell syntax,
1164 syncing with artful where this originated.
1165
1166 [ Steve Langasek, Balint Reczey ]
1167 * Introduce a new project-independent 'minimized' subproject
1168 (LP: #1721261):
1169 - omit ubuntu-minimal in favor of using only the minbase package set.
1170 - boot directly by partuuid, avoiding the use of an initramfs.
1171 - Bump needed live-build version which can build images without initrd
1172 - drop man pages and most of the documentation from minimized images
1173 (/usr/share/doc/*/copyright and changelog.Debian.gz files are still
1174 kept)
1175 - Add unminimize script for reverting minimization on a running system
1176 - Mention unminimize script in motd
1177 - Run autopkgtest for SUBPROJECT=minimized
1178 - If we're using SUBPROJECT=minimized, and tzdata is not installed,
1179 remove files that have been left behind. This is a workaround for a
1180 bug that should be fixed in tzdata.
1181 * Factor out grub-related diversions and use them consistently, so we
1182 don't end up with wrong os-probe output in our grub.cfg.
1183
1184 [ Balint Reczey ]
1185 * Mount using --make-rslave to ensure safe unmounts for rbind mounts
1186 * When SUBPROJECT environment variable is not set assume it to be ""
1187
1188 -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 04 Oct 2017 18:43:48 +0000
1189
1190livecd-rootfs (2.408.18) xenial; urgency=medium
1191
1192 [ Robert C Jennings ]
1193 * Install udev before calls to udevadm
1194
1195 -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 22:10:11 -0700
1196
1197livecd-rootfs (2.408.17) xenial; urgency=medium
1198
1199 [ Robert C Jennings ]
1200 * live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
1201 to reverse the work done in setup_mountpoint. Lack of this function
1202 has forced users of setup_mountpoint to implement this separately
1203 and the implementations have diverged. (LP: #1716992)
1204 * live-build/ubuntu-cpc/functions: Remove umount_settle function.
1205 The was only used where teardown_mountpoint was lacking.
1206
1207 -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 12:21:30 -0700
1208
1209livecd-rootfs (2.408.16) xenial; urgency=medium
1210
1211 * live-build/ubuntu-cpc/functions: call apt-get update in the chroot
1212 after mounting a blank /var/lib/apt, so that further operations work
1213 as expected; otherwise, 'apt-get purge ^grub-.*' fails on s390x because
1214 no such packages are known to apt.
1215 * live-build/ubuntu-cpc/hooks/030-root-tarball.binary: correct a missing
1216 unmount of /var/{lib,cache}/apt on cleanup, detected via autopkgtests.
1217
1218 -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 12 Sep 2017 13:25:58 -0700
1219
1220livecd-rootfs (2.408.15) xenial; urgency=medium
1221
1222 [ Mathieu Trudel-Lapierre ]
1223 * Drop preloading of grub modules that are built into the grub signed
1224 image. This is functionally a no-op, changed only to clean up the code.
1225
1226 [ Steve Langasek ]
1227 * live-build/ubuntu-cpc/functions: mount tmpfs on /var/cache/apt and
1228 /var/lib/apt, so we don't have to leave empty space in our derivative
1229 images for packages that have been downloaded/installed/removed. This
1230 normally isn't relevant for the installed system, since the root
1231 filesystem will auto-expand in place on the target disk, but lets us
1232 ship smaller images.
1233 * live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get
1234 update *before* installing packages, not after.
1235
1236 [ Colin Watson ]
1237 * Mount and unmount /dev recursively, to cope with setups where there are
1238 interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
1239 LXD). LP: #1716465.
1240
1241 [ Balint Reczey ]
1242 * Fix suppression of kpartx error. LP: #1684090.
1243
1244 -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 11 Sep 2017 14:38:42 -0700
1245
1246livecd-rootfs (2.408.14) xenial; urgency=medium
1247
1248 * live-build/auto/config: Filter libgles1-mesa out of tasks, as it is not a
1249 dependency of anything in updates anymore, fixing mate/myth (LP: #1704013)
1250
1251 -- Adam Conrad <adconrad@ubuntu.com> Wed, 12 Jul 2017 16:28:13 -0600
1252
1253livecd-rootfs (2.408.13) xenial; urgency=medium
1254
1255 [ Balint Reczey ]
1256 * Source ubuntu-cpc functions from the right place
1257 * Use all config hooks from the proper place, not from /build/
1258 * Add basic but configurable autopkgtest (LP: #1690440)
1259 * sync before calling kpartx to let writing to loop devices finish
1260 * wrap kpartx and trap spurious errors, to work around kpartx
1261 unreliability.
1262
1263 -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 06 Jun 2017 21:52:21 -0700
1264
1265livecd-rootfs (2.408.12) xenial; urgency=medium
1266
1267 * live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure.
1268 (LP: #1687752)
1269
1270 -- Robert C Jennings <robert.jennings@canonical.com> Tue, 09 May 2017 13:57:44 -0700
1271
1272livecd-rootfs (2.408.11) xenial; urgency=medium
1273
1274 * Add `apt-get update` to ubuntu-cpc ppc64el builds so they use the new
1275 sources.
1276
1277 -- Daniel Watkins <daniel.watkins@canonical.com> Fri, 07 Apr 2017 16:12:53 -0400
1278
1279livecd-rootfs (2.408.10) xenial; urgency=medium
1280
1281 [ Adam Conrad ]
1282 * Fix security mirror sources.list entries for non-x86 architectures.
1283 (LP: #1679252)
1284
1285 -- Daniel Watkins <daniel.watkins@canonical.com> Mon, 03 Apr 2017 14:05:25 -0400
1286
1287livecd-rootfs (2.408.9) xenial; urgency=medium
1288
1289 [ Daniel Watkins ]
1290 * Don't overwrite the default sources.list in cloud images.
1291 * Replace sources.list generated using COMPONENTS with the sources.list from
1292 an Ubuntu Server installation (i.e. with all components enabled, and all
1293 deb-src lines commented). LP: #1513529.
1294
1295 [ Chris Glass ]
1296 * Fix the manifest generation in OVA files so that ovf files don't have
1297 double extensions. (LP: #1627931)
1298 * Fix the OVF's metadata to include Ubuntu specific identifiers and
1299 descriptions instead of the generic Linux ones. (LP: #1656293)
1300
1301 [ Daniel Watkins ]
1302 * Add replace_grub_root_with_label function thereby consolidating multiple
1303 uses of the same calls to sed.
1304
1305 [ Robert C Jennings ]
1306 * ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
1307
1308 -- Robert C Jennings <robert.jennings@canonical.com> Thu, 23 Mar 2017 14:40:59 -0400
1309
1310livecd-rootfs (2.408.8) xenial; urgency=medium
1311
1312 * Set device_tree_address for the new kernel in the RPi bootloader config.txt
1313
1314 -- Adam Conrad <adconrad@ubuntu.com> Thu, 16 Feb 2017 10:21:51 -0700
1315
1316livecd-rootfs (2.408.7) xenial; urgency=medium
1317
1318 [ Łukasz 'sil2100' Zemczak ]
1319 * Add additional hints to ubuntu-touch* i386/amd64 image builds to pull in
1320 the gles version of the UITK.
1321 * Now that we have have systemd working on ubuntu-touch, remove the
1322 systemd-sysv- in add_package config to make sure we can build an image with
1323 systemd as the init system.
1324
1325 [ Adam Conrad ]
1326 * Forward-port hardware enablement delta from trusty to xenial, with changes:
1327 - Implement hwe stack swapping as task filters instead of install hints
1328 - Revert ubuntu-desktop and ubuntu-gnome to use tasks again for the above
1329
1330 -- Adam Conrad <adconrad@ubuntu.com> Wed, 08 Feb 2017 11:50:52 -0700
1331
1332livecd-rootfs (2.408.5) xenial; urgency=medium
1333
1334 * Temporarily change the 60-install-click.chroot script to pull in clicks for
1335 arm64 builds from a different location for ubuntu-touch.
1336 * Add the new dhcpd user to touch hooks introduced by latest archive changes.
1337 * Remove the ubuntu-pd project logic.
1338 * Synced ubuntu-touch-custom changes from the vivid branch to xenial. This
1339 also adds a new symlink called ubuntu-touch-custom to the ubuntu-touch hooks
1340 dir.
1341 * Stop using the overlay PPA for touch livecd-rootfs changes (LP: #1628085).
1342
1343 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 27 Sep 2016 13:27:28 +0200
1344
1345livecd-rootfs (2.408.4) xenial; urgency=medium
1346
1347 * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
1348 so that the teardown is done properly /before/ we try to make an
1349 image from our filesystem, since otherwise /etc/resolv.conf is broken.
1350 LP: #1621393.
1351
1352 -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 09 Sep 2016 17:04:54 -0700
1353
1354livecd-rootfs (2.408.3) xenial-proposed; urgency=medium
1355
1356 [ Louis Zuckerman ]
1357 * Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
1358 - Install virtualbox-guest-utils
1359 - Don't disable default synced folder
1360 - Don't set vm name
1361 - Add cloud-init config to manage /etc/hosts LP: #1561250
1362
1363 -- Brian Murray <brian@ubuntu.com> Tue, 30 Aug 2016 13:17:55 -0700
1364
1365livecd-rootfs (2.408.2) xenial; urgency=medium
1366
1367 * Switch ubuntu-gnome from using tasks to metapackages (LP: #1602035)
1368
1369 -- Adam Conrad <adconrad@ubuntu.com> Wed, 20 Jul 2016 01:46:41 -0600
1370
1371livecd-rootfs (2.408.1) xenial; urgency=medium
1372
1373 * Rename old ubuntu-core tarballs to ubuntu-base, for consistency with
1374 the changes already made to yakkety and the ubuntu-cdimage project.
1375 LP: #1579950.
1376
1377 -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 09 May 2016 17:00:19 -0700
1378
1379>>>>>>> MERGE-SOURCE
1045livecd-rootfs (2.408) xenial; urgency=medium1380livecd-rootfs (2.408) xenial; urgency=medium
10461381
1047 * drop linux-firmware-raspi2, it does not actually contain driver1382 * drop linux-firmware-raspi2, it does not actually contain driver
10481383
=== modified file 'debian/control'
--- debian/control 2018-03-06 09:15:41 +0000
+++ debian/control 2018-03-28 13:08:01 +0000
@@ -4,10 +4,11 @@
4Build-Depends: debhelper (>= 7)4Build-Depends: debhelper (>= 7)
5Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>5Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
6Standards-Version: 3.9.66Standards-Version: 3.9.6
7Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk7Vcs-Bzr: lp:~ubuntu-core-dev/livecd-rootfs/xenial-proposed/
88
9Package: livecd-rootfs9Package: livecd-rootfs
10Architecture: any10Architecture: any
11<<<<<<< TREE
11Depends: ${misc:Depends},12Depends: ${misc:Depends},
12 apt-utils,13 apt-utils,
13 debootstrap,14 debootstrap,
@@ -36,6 +37,34 @@
36 vmdk-stream-converter [amd64 i386],37 vmdk-stream-converter [amd64 i386],
37 xz-utils,38 xz-utils,
38 zerofree39 zerofree
40=======
41Depends: ${misc:Depends},
42 android-tools-fsutils [armhf],
43 apt-utils,
44 debootstrap,
45 dosfstools,
46 e2fsprogs,
47 gdisk,
48 genisoimage,
49 germinate (>= 1.25.1),
50 gnupg,
51 grep-dctrl,
52 kpartx,
53 live-build (>= 3.0~a57-1ubuntu25.5~),
54 lsb-release,
55 lzma,
56 parted,
57 procps,
58 python-minimal | python,
59 python3-software-properties,
60 qemu-utils,
61 rsync,
62 squashfs-tools (>= 1:3.3-1),
63 vmdk-stream-converter [amd64 i386],
64 xz-utils,
65 zerofree
66Suggests: partimage
67>>>>>>> MERGE-SOURCE
39Breaks: ubuntu-defaults-builder (<< 0.32)68Breaks: ubuntu-defaults-builder (<< 0.32)
40Description: construction script for the livecd rootfs69Description: construction script for the livecd rootfs
41 livecd-rootfs provides the script used to create the root filesystem70 livecd-rootfs provides the script used to create the root filesystem
4271
=== added directory 'debian/tests'
=== renamed directory 'debian/tests' => 'debian/tests.moved'
=== added file 'debian/tests/control'
--- debian/tests/control 1970-01-01 00:00:00 +0000
+++ debian/tests/control 2018-03-28 13:08:01 +0000
@@ -0,0 +1,7 @@
1Tests: default-bootstraps
2Depends: @, lsb-release
3Restrictions: needs-root isolation-machine
4
5Tests: minimized
6Depends: @, lsb-release
7Restrictions: needs-root isolation-machine
08
=== added file 'debian/tests/default-bootstraps'
--- debian/tests/default-bootstraps 1970-01-01 00:00:00 +0000
+++ debian/tests/default-bootstraps 2018-03-28 13:08:01 +0000
@@ -0,0 +1,96 @@
1#!/bin/sh
2# autopkgtest check: Build default rootfs for all supported project:subproject pairs
3# (C) 2017 Canonical Ltd.
4# Author: Balint Reczey <balint.reczey@canonical.com>
5
6set -e
7
8if [ -z "$SUITE" ]; then
9 SUITE=$(lsb_release -c -s)
10fi
11
12# Known project:subproject:template combinations.
13# Listed subprojects can be combined with other projects as well,
14# but this list gives reasonable coverage.
15ALL_TRIPLETS="
16 base::
17 edubuntu::
18 edubuntu-dvd::
19 kubuntu::
20 kubuntu-active::
21 kubuntu-dvd::
22 kubuntu-plasma5::
23 lubuntu::
24 lubuntu-next::
25 mythbuntu::
26 ubuntu::
27 ubuntu-base::
28 ubuntu-budgie::
29 ubuntu-budgie-desktop::
30 ubuntu-budgie-live::
31 ubuntu-core:system-image:ubuntu-core
32 ubuntu-cpc::ubuntu-cpc
33 ubuntu-cpc:minimized:ubuntu-cpc
34 ubuntu-desktop-next:system-image:ubuntu-desktop-next
35 ubuntu-desktop-next::ubuntu-desktop-next
36 ubuntu-dvd::
37 ubuntu-gnome::
38 ubuntukylin::
39 ubuntu-mate::
40 ubuntu-mate-core::
41 ubuntu-mate-desktop::
42 ubuntu-mate-live::
43 ubuntu-netbook::
44 ubuntu-server::
45 ubuntu-server:ubuntu-rtm:
46 ubuntu-server:ubuntu-rtm/foo:
47 ubuntu-server:wubi:
48 ubuntu-touch-custom::ubuntu-touch-custom
49 ubuntu-touch::ubuntu-touch
50 xubuntu::"
51
52if [ -z "$SELECTED_TRIPLETS" ]; then
53 SELECTED_TRIPLETS="
54 ubuntu-base::
55 ubuntu-cpc::ubuntu-cpc
56"
57fi
58
59live_build_rootfs() {
60 PROJECT=${1%%:*}
61 local SUBPROJECT_TMP=${1%:*}
62 SUBPROJECT=${SUBPROJECT_TMP#*:}
63 TEMPLATE=${1##*:}
64 ARCH=$(dpkg --print-architecture)
65 echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
66 cp -a /usr/share/livecd-rootfs/live-build/auto .
67 if [ -n "$TEMPLATE" ]; then
68 cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
69 fi
70 env PROJECT=$PROJECT \
71 SUBPROJECT=$SUBPROJECT \
72 SUITE=$SUITE \
73 ARCH=$ARCH \
74 lb config
75 mkdir chroot
76 # this part needs root rights, but right now the whole script ran as root by autopkgtest
77 env PROJECT=$PROJECT \
78 SUBPROJECT=$SUBPROJECT \
79 ARCH=$ARCH \
80 lb build
81 echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
82 du -sh *
83 echo ""
84}
85
86WORKDIR=$(mktemp -d)
87trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
88cd $WORKDIR
89
90for i in $SELECTED_TRIPLETS; do
91 mkdir $i
92 (cd $i && live_build_rootfs $i)
93 # clean up after build to avoid filling the disk, needs root rights
94 rm -rf $i
95done
96
097
=== added file 'debian/tests/minimized'
--- debian/tests/minimized 1970-01-01 00:00:00 +0000
+++ debian/tests/minimized 2018-03-28 13:08:01 +0000
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3env SELECTED_TRIPLETS=ubuntu-cpc:minimized:ubuntu-cpc debian/tests/default-bootstraps
04
=== modified file 'live-build/auto/build'
--- live-build/auto/build 2018-03-27 19:12:26 +0000
+++ live-build/auto/build 2018-03-28 13:08:01 +0000
@@ -94,6 +94,7 @@
9494
95 lb bootstrap "$@"95 lb bootstrap "$@"
9696
97<<<<<<< TREE
97 case $PROJECT in98 case $PROJECT in
98 ubuntu-server|ubuntu-cpc)99 ubuntu-server|ubuntu-cpc)
99 # Set locale to C.UTF-8 by default. We should100 # Set locale to C.UTF-8 by default. We should
@@ -209,6 +210,114 @@
209210
210 chmod +x chroot/etc/update-motd.d/60-unminimize211 chmod +x chroot/etc/update-motd.d/60-unminimize
211 fi212 fi
213=======
214 if [ "${SUBPROJECT:-}" = minimized ] \
215 && ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then
216 # workaround for tzdata purge not removing these files
217 rm -f chroot/etc/localtime chroot/etc/timezone
218 fi
219
220 if [ "${SUBPROJECT:-}" = minimized ]; then
221 # set up dpkg filters to skip installing docs on minimized system
222 mkdir -p chroot/etc/dpkg/dpkg.cfg.d
223 cat > chroot/etc/dpkg/dpkg.cfg.d/excludes <<EOF
224# Drop all man pages
225path-exclude=/usr/share/man/*
226
227# Drop all documentation ...
228path-exclude=/usr/share/doc/*
229
230# ... except copyright files ...
231path-include=/usr/share/doc/*/copyright
232
233# ... and Debian changelogs
234path-include=/usr/share/doc/*/changelog.Debian.*
235EOF
236
237 # Remove docs installed by bootstrap
238 Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall
239
240 # Add unminimizer script which restores default image behavior
241 mkdir -p chroot/usr/local/sbin
242 cat > chroot/usr/local/sbin/unminimize <<'EOF'
243#!/bin/sh
244
245set -e
246
247echo "This system has been minimized by removing packages and content that are"
248echo "not required on a system that users do not log into."
249echo ""
250echo "This script restores the content and packages that are found on a default"
251echo "Ubuntu server system."
252echo ""
253echo "Reinstallation of packages may fail due to changes to the system"
254echo "configuration, the presence of third-party packages, or for other"
255echo "reasons."
256read -p "Would you like to continue? [y/N]" REPLY
257echo # (optional) move to a new line
258if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]
259then
260 exit 1
261fi
262
263if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
264 echo "Re-enabling installation of all documentation in dpkg..."
265 if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
266 mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
267 fi
268 echo "Updating package list and upgrading packages..."
269 apt-get update
270 # apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
271 apt-get upgrade
272 echo "Restoring system documentation..."
273 echo "Reinstalling packages with files in /usr/share/man/ ..."
274 # Reinstallation takes place in two steps because a single dpkg --verified
275 # command generates very long parameter list for "xargs dpkg -S" and may go
276 # over ARG_MAX. Since many packages have man pages the second download
277 # handles a much smaller amount of packages.
278 dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
279 echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
280 # This step processes the packages which still have missing documentation
281 dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
282 | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
283 if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then
284 echo "Documentation has been restored successfully."
285 rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
286 else
287 echo "There are still files missing from /usr/share/doc/:"
288 dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}'
289 echo "You may want to try running this script again or you can remove"
290 echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually."
291 fi
292fi
293
294if ! dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-minimal 2> /dev/null | grep -q '^installed$'; then
295 echo "Installing ubuntu-minimal package to provide the familiar Ubuntu minimal system..."
296 DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-minimal
297fi
298
299# unminimization succeeded, there is no need to mention it in motd
300rm -f /etc/update-motd.d/60-unminimize
301
302EOF
303 chmod +x chroot/usr/local/sbin/unminimize
304
305 # inform users about the unminimize script
306 cat > "chroot/etc/update-motd.d/60-unminimize" << EOF
307#!/bin/sh
308#
309# This file is not managed by a package. If you no longer want to
310# see this message you can safely remove the file.
311echo "This system has been minimized by removing packages and content that are"
312echo "not required on a system that users do not log into."
313echo ""
314echo "To restore this content, you can run the 'unminimize' command."
315EOF
316
317 chmod +x chroot/etc/update-motd.d/60-unminimize
318 fi
319
320>>>>>>> MERGE-SOURCE
212 Chroot chroot "dpkg-divert --quiet --add \321 Chroot chroot "dpkg-divert --quiet --add \
213 --divert /usr/sbin/update-initramfs.REAL --rename \322 --divert /usr/sbin/update-initramfs.REAL --rename \
214 /usr/sbin/update-initramfs"323 /usr/sbin/update-initramfs"
@@ -230,6 +339,7 @@
230339
231 lb chroot "$@"340 lb chroot "$@"
232341
342<<<<<<< TREE
233 if [ "${SUBPROJECT:-}" = minimized ]; then343 if [ "${SUBPROJECT:-}" = minimized ]; then
234 # force removal of initramfs-tools, which we assert is not344 # force removal of initramfs-tools, which we assert is not
235 # required for any minimized images but is still pulled in by345 # required for any minimized images but is still pulled in by
@@ -255,6 +365,20 @@
255 rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old365 rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old
256 Chroot chroot apt clean366 Chroot chroot apt clean
257367
368=======
369 if [ "${SUBPROJECT:-}" = minimized ]; then
370 # and if initramfs-tools was configured before our kernel,
371 # /etc/kernel/postinst.d/initramfs-tools will have created
372 # an initramfs despite the generic dpkg-divert; so remove it
373 # here.
374 rm -f chroot/boot/initrd.img-*
375 fi
376
377 # remove crufty files that shouldn't be left in an image
378 rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old
379 Chroot chroot apt clean
380
381>>>>>>> MERGE-SOURCE
258 if [ -f config/oem-config-preinstalled ]; then382 if [ -f config/oem-config-preinstalled ]; then
259383
260# This is cargo-culted almost verbatim (with some syntax changes for384# This is cargo-culted almost verbatim (with some syntax changes for
@@ -381,6 +505,7 @@
381 > chroot/etc/apt/sources.list505 > chroot/etc/apt/sources.list
382 rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig506 rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig
383 fi507 fi
508<<<<<<< TREE
384 case $PROJECT:$SUBPROJECT in509 case $PROJECT:$SUBPROJECT in
385 *)510 *)
386 if [ -e "config/seeded-snaps" ]; then511 if [ -e "config/seeded-snaps" ]; then
@@ -411,6 +536,9 @@
411 esac536 esac
412537
413 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then538 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
539=======
540 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
541>>>>>>> MERGE-SOURCE
414 if [ "$ARCH" = "armhf" ]; then542 if [ "$ARCH" = "armhf" ]; then
415 INFO_DESC="$(lsb_release -d -s)"543 INFO_DESC="$(lsb_release -d -s)"
416 echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info544 echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info
@@ -428,6 +556,7 @@
428build_name: $BUILD_NAME556build_name: $BUILD_NAME
429serial: $BUILDSTAMP557serial: $BUILDSTAMP
430EOF558EOF
559<<<<<<< TREE
431 fi560 fi
432561
433 # If the image pre-installs network-manager, let it manage all devices by562 # If the image pre-installs network-manager, let it manage all devices by
@@ -445,6 +574,8 @@
445EOF574EOF
446 else575 else
447 echo "==== NetworkManager not installed ===="576 echo "==== NetworkManager not installed ===="
577=======
578>>>>>>> MERGE-SOURCE
448 fi579 fi
449580
450 echo "===== Checking size of /usr/share/doc ====="581 echo "===== Checking size of /usr/share/doc ====="
@@ -805,6 +936,7 @@
805 if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then936 if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then
806 continue937 continue
807 fi938 fi
939 FLAVOUR=${FLAVOUR%%-hwe-*}
808 if [ "$FLAVOUR" = "virtual" ]; then940 if [ "$FLAVOUR" = "virtual" ]; then
809 # The virtual kernel is named generic in /boot941 # The virtual kernel is named generic in /boot
810 FLAVOUR="generic"942 FLAVOUR="generic"
@@ -838,17 +970,18 @@
838NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"970NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"
839if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then971if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then
840 # only one kernel flavour972 # only one kernel flavour
973 FLAVOUR=${LB_LINUX_FLAVOURS%%-hwe-*}
841 if [ -e "binary/$INITFS/vmlinuz" ]; then974 if [ -e "binary/$INITFS/vmlinuz" ]; then
842 ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"975 ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"
843 chmod 644 "$PREFIX.kernel"976 chmod 644 "$PREFIX.kernel"
844 else977 else
845 ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel"978 ln -sf "$PREFIX.kernel-$FLAVOUR" "$PREFIX.kernel"
846 fi979 fi
847 if [ -e "binary/$INITFS/initrd.lz" ]; then980 if [ -e "binary/$INITFS/initrd.lz" ]; then
848 ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"981 ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"
849 chmod 644 "$PREFIX.initrd"982 chmod 644 "$PREFIX.initrd"
850 else983 else
851 ln -sf "$PREFIX.initrd-$LB_LINUX_FLAVOURS" "$PREFIX.initrd"984 ln -sf "$PREFIX.initrd-$FLAVOUR" "$PREFIX.initrd"
852 fi985 fi
853fi986fi
854987
855988
=== modified file 'live-build/auto/config'
--- live-build/auto/config 2018-03-21 11:05:46 +0000
+++ live-build/auto/config 2018-03-28 13:08:01 +0000
@@ -59,9 +59,15 @@
59 # failure.59 # failure.
6060
61 for task; do61 for task; do
62 if [ -z "$HWE_BUILD" ]; then
62 # We need a ridiculous number of backslashes to protect63 # We need a ridiculous number of backslashes to protect
63 # parentheses from eval.64 # parentheses from eval.
64 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"65 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"
66 else
67 # If HWE_BUILD is set, we strip out drivers not available
68 # in the HWE stack, then sed the rest with their HWE suffixes
69 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"
70 fi
65 done71 done
66}72}
6773
@@ -105,6 +111,7 @@
105 BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1"111 BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1"
106}112}
107113
114<<<<<<< TREE
108if [ -z "${IMAGEFORMAT:-}" ]; then115if [ -z "${IMAGEFORMAT:-}" ]; then
109 case $PROJECT:${SUBPROJECT:-} in116 case $PROJECT:${SUBPROJECT:-} in
110 ubuntu-cpc:*)117 ubuntu-cpc:*)
@@ -121,6 +128,15 @@
121 mkdir -p .build128 mkdir -p .build
122 touch ".build/$STAGE"129 touch ".build/$STAGE"
123}130}
131=======
132if [ -z "${IMAGEFORMAT:-}" ]; then
133 case $PROJECT in
134 ubuntu-cpc)
135 IMAGEFORMAT=ext4
136 ;;
137 esac
138fi
139>>>>>>> MERGE-SOURCE
124140
125case $IMAGEFORMAT in141case $IMAGEFORMAT in
126 ext2|ext3|ext4)142 ext2|ext3|ext4)
@@ -144,6 +160,7 @@
144 ;;160 ;;
145161
146 plain)162 plain)
163<<<<<<< TREE
147 INITRAMFS_TYPE=none164 INITRAMFS_TYPE=none
148 case $PROJECT:${SUBPROJECT:-} in165 case $PROJECT:${SUBPROJECT:-} in
149 ubuntu-server:live)166 ubuntu-server:live)
@@ -201,6 +218,15 @@
201 none)218 none)
202 OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT"219 OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT"
203 ;;220 ;;
221=======
222 OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT"
223 PREINSTALLED=true
224 ;;
225
226 none)
227 OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT"
228 ;;
229>>>>>>> MERGE-SOURCE
204 *)230 *)
205 case $PROJECT in231 case $PROJECT in
206 ubuntu-server|ubuntu-touch|ubuntu-touch-custom)232 ubuntu-server|ubuntu-touch|ubuntu-touch-custom)
@@ -254,6 +280,7 @@
254 ;;280 ;;
255esac281esac
256282
283<<<<<<< TREE
257SIGNED_KERNEL_PACKAGE="linux-signed-generic"284SIGNED_KERNEL_PACKAGE="linux-signed-generic"
258285
259if [ "${SUBPROJECT:-}" = minimized ]; then286if [ "${SUBPROJECT:-}" = minimized ]; then
@@ -321,13 +348,30 @@
321 -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $SEED \348 -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $SEED \
322 ${COMPONENTS:+-c "$COMPONENTS"} -a $ARCH)349 ${COMPONENTS:+-c "$COMPONENTS"} -a $ARCH)
323fi350fi
351=======
352HWE_X_PACKAGES="xserver-xorg-hwe-16.04 xserver-xorg-video-all-hwe-16.04 xserver-xorg-input-all-hwe-16.04"
353HWE_KERNEL_FLAVOUR="generic-hwe-16.04"
354HWE_SIGNED_KERNEL_PACKAGE="linux-signed-$HWE_KERNEL_FLAVOUR"
355
356if [ "${SUBPROJECT:-}" = minimized ]; then
357 OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal --linux-packages=linux-image"
358fi
359>>>>>>> MERGE-SOURCE
324360
325case $PROJECT in361case $PROJECT in
326 ubuntu|ubuntu-dvd)362 ubuntu|ubuntu-dvd)
327 add_task install minimal standard ubuntu-desktop363<<<<<<< TREE
364 add_task install minimal standard ubuntu-desktop
365=======
366 HWE_BUILD="yes"
367 add_task install minimal standard ubuntu-desktop
368 add_package install $HWE_X_PACKAGES
369>>>>>>> MERGE-SOURCE
328 LIVE_TASK='ubuntu-live'370 LIVE_TASK='ubuntu-live'
371 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
372 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
329 case $ARCH in373 case $ARCH in
330 amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;374 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
331 esac375 esac
332 ;;376 ;;
333377
@@ -351,11 +395,15 @@
351 ;;395 ;;
352396
353 kubuntu|kubuntu-dvd)397 kubuntu|kubuntu-dvd)
398 HWE_BUILD="yes"
354 add_task install minimal standard399 add_task install minimal standard
355 add_task install kubuntu-desktop400 add_task install kubuntu-desktop
401 add_package install $HWE_X_PACKAGES
356 LIVE_TASK='kubuntu-live'402 LIVE_TASK='kubuntu-live'
403 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
404 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
357 case $ARCH in405 case $ARCH in
358 amd64) add_package live linux-signed-generic ;;406 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
359 esac407 esac
360 COMPONENTS='main restricted universe'408 COMPONENTS='main restricted universe'
361 add_chroot_hook remove-gnome-icon-cache409 add_chroot_hook remove-gnome-icon-cache
@@ -390,16 +438,17 @@
390 ;;438 ;;
391439
392 xubuntu)440 xubuntu)
441 HWE_BUILD="yes"
393 add_task install minimal standard xubuntu-desktop442 add_task install minimal standard xubuntu-desktop
443 add_package install $HWE_X_PACKAGES
394 add_package install xterm444 add_package install xterm
395 LIVE_TASK='xubuntu-live'445 LIVE_TASK='xubuntu-live'
446 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
447 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
396 case $ARCH in448 case $ARCH in
397 amd64) add_package live linux-signed-generic ;;449 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
398 esac450 esac
399 COMPONENTS='main restricted universe multiverse'451 COMPONENTS='main restricted universe multiverse'
400 case $ARCH in
401 amd64|i386) KERNEL_FLAVOURS=generic ;;
402 esac
403 ;;452 ;;
404453
405 ubuntu-netbook)454 ubuntu-netbook)
@@ -408,25 +457,32 @@
408 ;;457 ;;
409458
410 mythbuntu)459 mythbuntu)
460 HWE_BUILD="yes"
411 add_task install minimal standard mythbuntu-desktop461 add_task install minimal standard mythbuntu-desktop
462 add_package install $HWE_X_PACKAGES
412 LIVE_TASK='mythbuntu-live'463 LIVE_TASK='mythbuntu-live'
464 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
465 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
413 case $ARCH in466 case $ARCH in
414 amd64) add_package live linux-signed-generic ;;467 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
415 esac468 esac
416 COMPONENTS='main restricted universe multiverse'469 COMPONENTS='main restricted universe multiverse'
417 ;;470 ;;
418471
419 lubuntu)472 lubuntu)
473 HWE_BUILD="yes"
420 add_task install minimal standard lubuntu-desktop474 add_task install minimal standard lubuntu-desktop
475 case $ARCH in
476 amd64|i386) add_package install thermald ;;
477 esac
478 add_package install $HWE_X_PACKAGES
421 LIVE_TASK='lubuntu-live'479 LIVE_TASK='lubuntu-live'
480 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
481 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
422 case $ARCH in482 case $ARCH in
423 amd64) add_package live linux-signed-generic ;;483 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
424 esac484 esac
425 COMPONENTS='main restricted universe multiverse'485 COMPONENTS='main restricted universe multiverse'
426 case $ARCH in
427 amd64|i386) KERNEL_FLAVOURS=generic ;;
428 esac
429
430 # The Lubuntu STRUCTURE file has "feature486 # The Lubuntu STRUCTURE file has "feature
431 # no-follow-recommends". Mirror this.487 # no-follow-recommends". Mirror this.
432 APT_OPTIONS="${APT_OPTIONS} --no-install-recommends"488 APT_OPTIONS="${APT_OPTIONS} --no-install-recommends"
@@ -449,10 +505,14 @@
449 ;;505 ;;
450506
451 ubuntu-gnome)507 ubuntu-gnome)
508 HWE_BUILD="yes"
452 add_task install minimal standard ubuntu-gnome-desktop509 add_task install minimal standard ubuntu-gnome-desktop
510 add_package install $HWE_X_PACKAGES
453 LIVE_TASK='ubuntu-gnome-live'511 LIVE_TASK='ubuntu-gnome-live'
512 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
513 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
454 case $ARCH in514 case $ARCH in
455 amd64) add_package live linux-signed-generic ;;515 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
456 esac516 esac
457 COMPONENTS='main restricted universe'517 COMPONENTS='main restricted universe'
458 ;;518 ;;
@@ -467,28 +527,41 @@
467 ;;527 ;;
468528
469 ubuntu-mate)529 ubuntu-mate)
530 HWE_BUILD="yes"
470 add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop531 add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop
532 case $ARCH in
533 amd64|i386) add_package install thermald ;;
534 esac
535 add_package install $HWE_X_PACKAGES
471 LIVE_TASK='ubuntu-mate-live'536 LIVE_TASK='ubuntu-mate-live'
537 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
538 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
472 case $ARCH in539 case $ARCH in
473 amd64) add_package live linux-signed-generic ;;540 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
474 esac541 esac
475 COMPONENTS='main restricted universe multiverse'542 COMPONENTS='main restricted universe multiverse'
476 ;;543 ;;
477544
478 ubuntustudio-dvd)545 ubuntustudio-dvd)
546 HWE_BUILD="yes"
479 add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography547 add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography
548 add_package install $HWE_X_PACKAGES linux-generic-hwe-16.04-
480 COMPONENTS='main restricted universe multiverse'549 COMPONENTS='main restricted universe multiverse'
481 case $ARCH in550 case $ARCH in
482 amd64|i386) KERNEL_FLAVOURS=lowlatency ;;551 amd64|i386) KERNEL_FLAVOURS=lowlatency-hwe-16.04 ;;
483 esac552 esac
484 ;;553 ;;
485554
486 ubuntukylin)555 ubuntukylin)
556 HWE_BUILD="yes"
487 add_task install minimal standard ubuntukylin-desktop557 add_task install minimal standard ubuntukylin-desktop
558 add_package install $HWE_X_PACKAGES
488 add_package install ubuntukylin-default-settings559 add_package install ubuntukylin-default-settings
489 LIVE_TASK='ubuntukylin-live'560 LIVE_TASK='ubuntukylin-live'
561 LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
562 KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
490 case $ARCH in563 case $ARCH in
491 amd64) add_package live linux-signed-generic ;;564 amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
492 esac565 esac
493 COMPONENTS='main restricted universe'566 COMPONENTS='main restricted universe'
494 ;;567 ;;
@@ -514,6 +587,7 @@
514 ;;587 ;;
515588
516 ubuntu-core)589 ubuntu-core)
590<<<<<<< TREE
517 OPTS="${OPTS:+$OPTS }--apt-recommends false"591 OPTS="${OPTS:+$OPTS }--apt-recommends false"
518592
519 # some workarounds because the seeds are not quite593 # some workarounds because the seeds are not quite
@@ -581,6 +655,83 @@
581 ;;655 ;;
582 esac656 esac
583 add_package install ubuntu-minimal ubuntu-touch $HINTS657 add_package install ubuntu-minimal ubuntu-touch $HINTS
658=======
659 # mvo: This is for cron.daily-preinstalled
660 # CDIMAGE_PREINSTALLED is not passed from build.py
661 # and PREINSTALLED means something different. So
662 # we use SUBPROJECT to pass on the information
663 if [ "$SUBPROJECT" = "system-image" ]; then
664 OPTS="${OPTS:+$OPTS }--apt-recommends false"
665
666 # some workarounds because the seeds are not quite
667 # corrent at the moment
668 add_package install dbus
669 add_package install isc-dhcp-client
670 add_package install libpam-systemd
671 add_package install ppp
672 add_package install watchdog
673 # no Task: header yet
674 add_package install snapd
675 add_package install ubuntu-core-snapd-units
676
677 # no minimal as we want to be really minimal
678 #add_task install minimal
679 add_task install ubuntu-core
680
681 # more packages are pulled in via the seed.
682 # (important to remember when comparing to the
683 # livecd-rootfs from ppa:snappy-dev/image)
684
685 case $ARCH in
686 i386)
687 # efi support can go once the task
688 # header is available for grub-efi-ia32-bin
689 add_package install grub-efi-ia32-bin
690 ;;
691 esac
692
693 # generic kernel etc
694 KERNEL_FLAVOURS=none
695 case $ARCH in
696 i386)
697 add_package install grub-pc
698 ;;
699 amd64)
700 add_package install grub-pc-bin
701 add_package install grub-efi-amd64-signed
702 add_package install shim-signed
703 ;;
704 armhf)
705 add_package install flash-kernel u-boot-tools
706 ;;
707 arm64)
708 add_package install u-boot-tools
709 ;;
710 esac
711 OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none --initramfs-compression=none"
712
713 # contains the framework definition
714 add_package install ubuntu-core-libs
715
716 # universe needed for 'system-image-cli' and multiverse for firmware
717 COMPONENTS='main restricted universe multiverse'
718 fi
719 OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
720 ;;
721
722 ubuntu-base)
723 OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
724 ;;
725
726 ubuntu-touch|ubuntu-touch-custom)
727 HINTS="packagekit ubuntu-system-settings-online-accounts"
728 case $ARCH in
729 amd64|i386)
730 HINTS="$HINTS qml-module-ubuntu-components-gles unity8"
731 ;;
732 esac
733 add_package install ubuntu-minimal ubuntu-touch $HINTS
734>>>>>>> MERGE-SOURCE
584735
585 COMPONENTS='main restricted universe'736 COMPONENTS='main restricted universe'
586 BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu'737 BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu'
@@ -612,6 +763,7 @@
612 ;;763 ;;
613764
614 ubuntu-cpc)765 ubuntu-cpc)
766<<<<<<< TREE
615 if [ "${SUBPROJECT:-}" = minimized ]; then767 if [ "${SUBPROJECT:-}" = minimized ]; then
616 add_task install cloud-image768 add_task install cloud-image
617 add_package install sudo769 add_package install sudo
@@ -639,6 +791,35 @@
639 ;;791 ;;
640 esac792 esac
641 fi793 fi
794=======
795 if [ "${SUBPROJECT:-}" = minimized ]; then
796 add_task install cloud-image
797 add_package install sudo
798 # linux-kvm currently only exists in xenial, not in
799 # non-LTS suites. Fall back to virtual flavor, which
800 # may or may not boot initramfsless but enables us to
801 # test building and possibly build derivative images
802 # using other kernel flavors.
803 # If you enable an extra ppa, it is assumed that
804 # linux-kvm is available since you control the
805 # archive and can provide this metapackage as
806 # necessary.
807 if [ "$ARCH" != "amd64" ] || ([ -z "$EXTRA_PPAS" ] && [ "$SUITE" != xenial ]); then
808 KERNEL_FLAVOURS=virtual
809 else
810 KERNEL_FLAVOURS=kvm
811 fi
812 else
813 add_task install minimal standard cloud-image
814 add_package install ubuntu-minimal
815 KERNEL_FLAVOURS=virtual
816 case $ARCH in
817 armhf|arm64|ppc64el|powerpc)
818 add_task install server
819 ;;
820 esac
821 fi
822>>>>>>> MERGE-SOURCE
642823
643 BINARY_REMOVE_LINUX=false824 BINARY_REMOVE_LINUX=false
644 OPTS="${OPTS:+$OPTS }--initramfs=none"825 OPTS="${OPTS:+$OPTS }--initramfs=none"
@@ -649,6 +830,12 @@
649 ;;830 ;;
650 arm64)831 arm64)
651 add_package install flash-kernel832 add_package install flash-kernel
833<<<<<<< TREE
834=======
835 ;;
836 powerpc)
837 KERNEL_FLAVOURS=powerpc64-smp
838>>>>>>> MERGE-SOURCE
652 ;;839 ;;
653 esac840 esac
654 OPTS="${OPTS:+$OPTS }--system=normal"841 OPTS="${OPTS:+$OPTS }--system=normal"
@@ -772,6 +959,7 @@
772 ;;959 ;;
773esac960esac
774961
962<<<<<<< TREE
775case $PROJECT:${SUBPROJECT:-} in963case $PROJECT:${SUBPROJECT:-} in
776 ubuntu-server:live)964 ubuntu-server:live)
777 ;;965 ;;
@@ -780,6 +968,20 @@
780 KERNEL_FLAVOURS=none968 KERNEL_FLAVOURS=none
781 BINARY_REMOVE_LINUX=false969 BINARY_REMOVE_LINUX=false
782 ;;970 ;;
971=======
972case $PROJECT in
973 ubuntu-server|ubuntu-core|ubuntu-base|ubuntu-touch|ubuntu-touch-custom)
974 case $SUBPROJECT in
975 system-image)
976 # keep the kernel for the system-image build
977 ;;
978 *)
979 OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
980 KERNEL_FLAVOURS=none
981 BINARY_REMOVE_LINUX=false
982 ;;
983 esac
984>>>>>>> MERGE-SOURCE
783esac985esac
784986
785add_chroot_hook update-apt-file-cache987add_chroot_hook update-apt-file-cache
@@ -817,8 +1019,13 @@
817 ${KERNEL_FLAVOURS:+--linux-flavours "$KERNEL_FLAVOURS"} \1019 ${KERNEL_FLAVOURS:+--linux-flavours "$KERNEL_FLAVOURS"} \
818 --initsystem none \1020 --initsystem none \
819 --bootloader "$BOOTLOADER" \1021 --bootloader "$BOOTLOADER" \
1022<<<<<<< TREE
820 --initramfs-compression "${INITRAMFS_COMPRESSION:-lzma}" \1023 --initramfs-compression "${INITRAMFS_COMPRESSION:-lzma}" \
821 --cache false \1024 --cache false \
1025=======
1026 --initramfs-compression lzma \
1027 --cache false \
1028>>>>>>> MERGE-SOURCE
822 ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \1029 ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \
823 $OPTS \1030 $OPTS \
824 "$@"1031 "$@"
@@ -956,7 +1163,11 @@
956 fi1163 fi
957 ;;1164 ;;
9581165
1166<<<<<<< TREE
959 ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*|ubuntu-server:live)1167 ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*|ubuntu-server:live)
1168=======
1169 ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*)
1170>>>>>>> MERGE-SOURCE
960 cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \1171 cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
961 config/1172 config/
962 if [ "$IMAGEFORMAT" = none ]; then1173 if [ "$IMAGEFORMAT" = none ]; then
9631174
=== added file 'live-build/ubuntu-cpc/functions.OTHER'
--- live-build/ubuntu-cpc/functions.OTHER 1970-01-01 00:00:00 +0000
+++ live-build/ubuntu-cpc/functions.OTHER 2018-03-28 13:08:01 +0000
@@ -0,0 +1,320 @@
1# vi: ts=4 expandtab syntax=sh
2
3CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
4IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship)
5
6rootfs_dev_mapper=
7loop_device=
8loop_raw=
9backing_img=
10
11clean_loops() {
12 local kpartx_ret
13 local kpartx_stdout
14
15 if [ -n "${backing_img}" ]; then
16 # sync before removing loop to avoid "Device or resource busy" errors
17 sync
18 kpartx_ret=""
19 kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$?
20 echo "$kpartx_stdout"
21 if [ -n "$kpartx_ret" ]; then
22 if echo "$kpartx_stdout" | grep -q "loop deleted"; then
23 echo "Suppressing kpartx returning error (#860894)"
24 else
25 exit $kpartx_ret
26 fi
27 fi
28 unset backing_img
29 fi
30
31 if [ -z "${rootfs_dev_mapper}" ]; then
32 return 0
33 fi
34
35 unset loop_device
36 unset loop_raw
37 unset rootfs_dev_mapper
38}
39
40create_empty_disk_image() {
41 # Prepare an empty disk image
42 dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}"
43}
44
45make_ext4_partition() {
46 device="$1"
47
48 mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device"
49}
50
51mount_image() {
52 trap clean_loops EXIT
53 backing_img="$1"
54 local rootpart="$2"
55 kpartx_mapping="$(kpartx -s -v -a ${backing_img})"
56
57 # Find the loop device
58 loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')"
59 loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)"
60 if [ ! -b ${loop_device} ]; then
61 echo "unable to find loop device for ${backing_img}"
62 exit 1
63 fi
64
65 # Find the rootfs location
66 rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}"
67 if [ ! -b "${rootfs_dev_mapper}" ]; then
68 echo "${rootfs_dev_mapper} is not a block device";
69 exit 1
70 fi
71
72 # Add some information to the debug logs
73 echo "Mounted disk image ${backing_img} to ${rootfs_dev_mapper}"
74 blkid ${rootfs_dev_mapper}
75
76 return 0
77}
78
79setup_mountpoint() {
80 local mountpoint="$1"
81
82 mount --rbind --make-rslave /dev "$mountpoint/dev"
83 mount proc-live -t proc "$mountpoint/proc"
84 mount sysfs-live -t sysfs "$mountpoint/sys"
85 mount -t tmpfs none "$mountpoint/tmp"
86 mount -t tmpfs none "$mountpoint/var/lib/apt"
87 mount -t tmpfs none "$mountpoint/var/cache/apt"
88 mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
89 cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
90 chroot "$mountpoint" apt-get update
91
92}
93
94teardown_mountpoint() {
95 # Reverse the operations from setup_mountpoint
96 local mountpoint="$1"
97
98 # ensure we have exactly one trailing slash, and escape all slashes for awk
99 mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
100 # sort -r ensures that deeper mountpoints are unmounted first
101 for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
102 { print \$2 }" | LC_ALL=C sort -r); do
103 umount $submount
104 done
105 mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
106}
107
108mount_partition() {
109 partition="$1"
110 mountpoint="$2"
111
112 mount "$partition" "$mountpoint"
113 setup_mountpoint "$mountpoint"
114}
115
116
117mount_disk_image() {
118 local disk_image=${1}
119 local mountpoint=${2}
120 mount_image ${disk_image} 1
121 mount_partition "${rootfs_dev_mapper}" $mountpoint
122
123 local uefi_dev="/dev/mapper${loop_device///dev/}p15"
124 if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then
125 mount "${uefi_dev}" $mountpoint/boot/efi
126 fi
127
128 # This is needed to allow for certain operations
129 # such as updating grub and installing software
130 cat > $mountpoint/usr/sbin/policy-rc.d << EOF
131#!/bin/sh
132# ${CLOUD_IMG_STR}
133echo "All runlevel operations denied by policy" >&2
134exit 101
135EOF
136 chmod 0755 $mountpoint/usr/sbin/policy-rc.d
137
138}
139
140umount_partition() {
141 local mountpoint=${1}
142 teardown_mountpoint $mountpoint
143 umount -R $mountpoint
144 udevadm settle
145
146 if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
147 # buildd's don't have /etc/mtab symlinked
148 # /etc/mtab is needed in order zerofree space for ext4 filesystems
149 [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab
150
151 # both of these are likely overkill, but it does result in slightly
152 # smaller ext4 filesystem
153 e2fsck -y -E discard ${rootfs_dev_mapper}
154 zerofree ${rootfs_dev_mapper}
155 fi
156}
157
158umount_disk_image() {
159 mountpoint="$1"
160
161 local uefi_dev="/dev/mapper${loop_device///dev/}p15"
162 if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then
163 umount --detach-loop "$mountpoint/boot/efi"
164 fi
165
166 if [ -e $mountpoint/usr/sbin/policy-rc.d ]; then
167 rm $mountpoint/usr/sbin/policy-rc.d
168 fi
169 umount_partition $mountpoint
170 clean_loops
171}
172
173modify_vmdk_header() {
174 # Modify the VMDK headers so that both VirtualBox _and_ VMware can
175 # read the vmdk and import them. The vodoo here is _not_ documented
176 # anywhere....so this will have to do. This is undocumented vodoo
177 # that has been learned by the Cloud Image team.
178
179 vmdk_name="${1}"
180 descriptor=$(mktemp)
181 newdescriptor=$(mktemp)
182
183 # Extract the vmdk header for manipulation
184 dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024
185
186 # The sed lines below is where the magic is. Specifically:
187 # ddb.toolsVersion: sets the open-vm-tools so that VMware shows
188 # the tooling as current
189 # ddb.virtualHWVersion: set the version to 7, which covers most
190 # current versions of VMware
191 # createType: make sure its set to stream Optimized
192 # remove the vmdk-stream-converter comment and replace with
193 # # Disk DescriptorFile. This is needed for Virtualbox
194 # remove the comments from vmdk-stream-converter which causes
195 # VirtualBox and others to fail VMDK validation
196
197 sed -e 's|# Description file.*|# Disk DescriptorFile|' \
198 -e '/# Believe this is random*/d' \
199 -e '/# Indicates no parent/d' \
200 -e '/# The Disk Data Base/d' \
201 -e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \
202 "${descriptor}" > "${newdescriptor}"
203
204 # The header is cannot be bigger than 1024
205 expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || {
206 echo "descriptor is too large, VMDK will be invalid!"; exit 1; }
207
208 # Overwrite the vmdk header with our new, modified one
209 dd conv=notrunc,nocreat \
210 if="${newdescriptor}" of="${vmdk_name}" \
211 bs=1 seek=512 count=1024
212
213 rm ${descriptor} ${newdescriptor}
214}
215
216create_vmdk() {
217 # There is no real good way to create a _compressed_ VMDK using open source
218 # tooling that works across multiple VMDK-capable platforms. This functions
219 # uses vmdk-stream-converter and then calls modify_vmdk_header to produce a
220 # compatible VMDK.
221
222 src="$1"
223 destination="$2"
224 size="${3:-10240}"
225
226 streamconverter="/usr/share/pyshared/VMDKstream.py"
227 scratch_d=$(mktemp -d)
228 cp ${src} ${scratch_d}/resize.img
229
230 truncate --size=${size}M ${scratch_d}/resize.img
231 python ${streamconverter} ${scratch_d}/resize.img ${destination}
232 modify_vmdk_header ${destination}
233
234 qemu-img info ${destination}
235 rm -rf ${scratch_d}
236}
237
238create_derivative() {
239 # arg1 is the disk type
240 # arg2 is the new name
241 unset derivative_img
242 case ${1} in
243 uefi) disk_image="binary/boot/disk-uefi.ext4";
244 dname="${disk_image//-uefi/-$2-uefi}";;
245 *) disk_image="binary/boot/disk.ext4";
246 dname="${disk_image//.ext4/-$2.ext4}";;
247 esac
248
249 if [ ! -e ${disk_image} ]; then
250 echo "Did not find ${disk_image}!"; exit 1;
251 fi
252
253 cp ${disk_image} ${dname}
254 export derivative_img=${dname}
255}
256
257convert_to_qcow2() {
258
259 src="$1"
260 destination="$2"
261 qemu-img convert -c -O qcow2 -o compat=0.10 "$src" "$destination"
262 qemu-img info "$destination"
263}
264
265replace_grub_root_with_label() {
266 # When update-grub is run, it will detect the disks in the build system.
267 # Instead, we want grub to use the cloudimg-rootfs labelled disk
268 CHROOT_ROOT="$1"
269
270 # If boot by partuuid has been requested, don't override.
271 if [ -f $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg ] && \
272 grep -q ^GRUB_FORCE_PARTUUID= $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg
273 then
274 return 0
275 fi
276 sed -i -e "s,root=[^ ]*,root=LABEL=cloudimg-rootfs," \
277 "$CHROOT_ROOT/boot/grub/grub.cfg"
278}
279
280
281# When running update-grub in a chroot on a build host, we don't want it to
282# probe for disks or probe for other installed OSes. Extract common
283# diversion wrappers, so this isn't reinvented differently for each image.
284divert_grub() {
285 CHROOT_ROOT="$1"
286
287 chroot "$CHROOT_ROOT" dpkg-divert --local \
288 --rename /usr/sbin/grub-probe
289 chroot "$CHROOT_ROOT" touch /usr/sbin/grub-probe
290 chroot "$CHROOT_ROOT" chmod +x /usr/sbin/grub-probe
291
292 chroot "$CHROOT_ROOT" dpkg-divert --local \
293 --divert /etc/grub.d/30_os-prober.dpkg-divert \
294 --rename /etc/grub.d/30_os-prober
295
296 # Divert systemd-detect-virt; /etc/kernel/postinst.d/zz-update-grub
297 # no-ops if we are in a container, and the launchpad farm runs builds
298 # in lxd. We therefore pretend that we're never in a container (by
299 # exiting 1).
300 chroot "$CHROOT_ROOT" dpkg-divert --local \
301 --rename /usr/bin/systemd-detect-virt
302 echo "exit 1" > "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
303 chmod +x "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
304}
305
306undivert_grub() {
307 CHROOT_ROOT="$1"
308
309 chroot "$CHROOT_ROOT" rm /usr/sbin/grub-probe
310 chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
311 --rename /usr/sbin/grub-probe
312
313 chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
314 --divert /etc/grub.d/30_os-prober.dpkg-divert \
315 --rename /etc/grub.d/30_os-prober
316
317 rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
318 chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
319 --rename /usr/bin/systemd-detect-virt
320}
0321
=== added file 'live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER'
--- live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER 1970-01-01 00:00:00 +0000
+++ live-build/ubuntu-cpc/hooks/030-root-tarball.binary.OTHER 2018-03-28 13:08:01 +0000
@@ -0,0 +1,27 @@
1#!/bin/bash -ex
2
3if [ -n "$SUBARCH" ]; then
4 echo "Skipping rootfs build for subarch flavor build"
5 exit 0
6fi
7
8. config/functions
9
10mkdir binary/boot/filesystem.dir
11cp -a chroot/* binary/boot/filesystem.dir
12
13setup_mountpoint binary/boot/filesystem.dir
14
15chroot binary/boot/filesystem.dir dpkg-divert --local --rename /usr/sbin/grub-probe
16chroot binary/boot/filesystem.dir touch /usr/sbin/grub-probe
17chroot binary/boot/filesystem.dir chmod +x /usr/sbin/grub-probe
18
19env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+'
20env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^grub-.*'
21env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get autoremove --purge --assume-yes
22chroot binary/boot/filesystem.dir mkdir /lib/modules
23
24chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe
25chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
26
27teardown_mountpoint binary/boot/filesystem.dir
028
=== modified file 'live-build/ubuntu-cpc/hooks/032-disk-image.binary'
--- live-build/ubuntu-cpc/hooks/032-disk-image.binary 2018-03-06 12:58:38 +0000
+++ live-build/ubuntu-cpc/hooks/032-disk-image.binary 2018-03-28 13:08:01 +0000
@@ -1,11 +1,17 @@
1#!/bin/bash -ex1#!/bin/bash -ex
22
3<<<<<<< TREE
3IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"4IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
4FS_LABEL="cloudimg-rootfs"5FS_LABEL="cloudimg-rootfs"
56
6. config/binary7. config/binary
78
8. config/functions9. config/functions
10=======
11. config/functions
12
13. config/binary
14>>>>>>> MERGE-SOURCE
915
10BOOTPART_START=16BOOTPART_START=
11BOOTPART_END=17BOOTPART_END=
1218
=== modified file 'live-build/ubuntu-cpc/hooks/032-root-squashfs.binary'
--- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-11-10 07:49:30 +0000
+++ live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2018-03-28 13:08:01 +0000
@@ -17,6 +17,7 @@
17 exit 017 exit 0
18fi18fi
1919
20<<<<<<< TREE
20. config/functions21. config/functions
2122
22mkdir binary/boot/squashfs.dir23mkdir binary/boot/squashfs.dir
@@ -39,6 +40,8 @@
3940
40teardown_mountpoint binary/boot/squashfs.dir41teardown_mountpoint binary/boot/squashfs.dir
4142
43=======
44>>>>>>> MERGE-SOURCE
42squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"45squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
43squashfs_f_manifest="${squashfs_f}.manifest"46squashfs_f_manifest="${squashfs_f}.manifest"
4447
4548
=== modified file 'live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary'
--- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2018-03-06 12:58:38 +0000
+++ live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2018-03-28 13:08:01 +0000
@@ -9,12 +9,16 @@
9 ;;9 ;;
10esac10esac
1111
12<<<<<<< TREE
12IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"13IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
13FS_LABEL="cloudimg-rootfs"14FS_LABEL="cloudimg-rootfs"
1415
15. config/binary16. config/binary
1617
17. config/functions18. config/functions
19=======
20. config/functions
21>>>>>>> MERGE-SOURCE
1822
19create_partitions() {23create_partitions() {
20 disk_image="$1"24 disk_image="$1"
@@ -64,6 +68,7 @@
64 efi_boot_dir="/boot/efi/EFI/BOOT"68 efi_boot_dir="/boot/efi/EFI/BOOT"
65 chroot mountpoint mkdir -p "${efi_boot_dir}"69 chroot mountpoint mkdir -p "${efi_boot_dir}"
6670
71<<<<<<< TREE
67 if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then72 if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then
68 # FIXME: code duplicated between 032-disk-image.binary73 # FIXME: code duplicated between 032-disk-image.binary
69 # and 033-disk-image-uefi.binary. We want to fix this to not74 # and 033-disk-image-uefi.binary. We want to fix this to not
@@ -78,9 +83,30 @@
78 # non-Secure Boot systems. If you need an extra module not already83 # non-Secure Boot systems. If you need an extra module not already
79 # provided or run into "Secure Boot policy forbids loading X" problems,84 # provided or run into "Secure Boot policy forbids loading X" problems,
80 # please file a bug against grub2 to include the affected module.85 # please file a bug against grub2 to include the affected module.
86=======
87 if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then
88 # FIXME: code duplicated between 032-disk-image.binary
89 # and 033-disk-image-uefi.binary. We want to fix this to not
90 # have initramfs-tools installed at all on these images.
91 echo "partuuid found for root device; omitting initrd"
92 echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
93 fi
94
95 chroot mountpoint apt-get -y update
96
97 # The modules below only make sense on non-Secure Boot UEFI systems.
98 # Otherwise, with Secure Boot enabled GRUB will refuse to load them.
99 # Any modules already in debian/build-efi-images do not need to be listed.
100 # Furthermore, other modules such as terminal, video_* and efi_* are all
101 # already available.
102>>>>>>> MERGE-SOURCE
81 case $ARCH in103 case $ARCH in
82 arm64)104 arm64)
83 chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin105 chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin
106<<<<<<< TREE
107=======
108 grub_modules="serial"
109>>>>>>> MERGE-SOURCE
84 efi_target=arm64-efi110 efi_target=arm64-efi
85 ;;111 ;;
86 armhf)112 armhf)
@@ -89,10 +115,23 @@
89 ;;115 ;;
90 amd64)116 amd64)
91 chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed117 chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed
118<<<<<<< TREE
119=======
120 grub_modules="multiboot serial usb usb_keyboard"
121>>>>>>> MERGE-SOURCE
92 efi_target=x86_64-efi122 efi_target=x86_64-efi
93 ;;123 ;;
94 esac124 esac
95125
126<<<<<<< TREE
127=======
128 cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
129${CLOUD_IMG_STR}
130# For Cloud Image compatability
131GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
132EOF
133
134>>>>>>> MERGE-SOURCE
96 chroot mountpoint grub-install "${loop_device}" \135 chroot mountpoint grub-install "${loop_device}" \
97 --boot-directory=/boot \136 --boot-directory=/boot \
98 --efi-directory=/boot/efi \137 --efi-directory=/boot/efi \
99138
=== modified file 'live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary'
--- live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2017-12-06 22:22:41 +0000
+++ live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2018-03-28 13:08:01 +0000
@@ -7,12 +7,16 @@
7 ;;7 ;;
8esac8esac
99
10<<<<<<< TREE
10IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"11IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
11FS_LABEL="cloudimg-rootfs"12FS_LABEL="cloudimg-rootfs"
1213
13. config/binary14. config/binary
1415
15. config/functions16. config/functions
17=======
18. config/functions
19>>>>>>> MERGE-SOURCE
1620
17create_partitions() {21create_partitions() {
18 disk_image="$1"22 disk_image="$1"
@@ -30,8 +34,13 @@
30 mkdir mountpoint34 mkdir mountpoint
31 mount_partition "${rootfs_dev_mapper}" mountpoint35 mount_partition "${rootfs_dev_mapper}" mountpoint
3236
37<<<<<<< TREE
33 chroot mountpoint apt-get -qqy update38 chroot mountpoint apt-get -qqy update
34 chroot mountpoint apt-get -qqy install grub-ieee127539 chroot mountpoint apt-get -qqy install grub-ieee1275
40=======
41 chroot mountpoint apt-get -qqy update
42 chroot mountpoint apt-get -qqy install grub2
43>>>>>>> MERGE-SOURCE
35 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec244 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
3645
37 # set the kernel commandline to use hvc046 # set the kernel commandline to use hvc0
3847
=== modified file 'live-build/ubuntu-cpc/hooks/040-qcow2-image.binary'
--- live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2017-11-20 20:18:33 +0000
+++ live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2018-03-28 13:08:01 +0000
@@ -18,7 +18,16 @@
18 ;;18 ;;
19esac19esac
2020
21. config/functions21<<<<<<< TREE
22. config/functions
23=======
24
25. config/functions
26
27if [ -f binary/boot/disk.ext4 ]; then
28 convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img
29fi
30>>>>>>> MERGE-SOURCE
2231
23if [ -f binary/boot/disk-uefi.ext4 ]; then32if [ -f binary/boot/disk-uefi.ext4 ]; then
24 convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img33 convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img
2534
=== modified file 'live-build/ubuntu-cpc/hooks/040-vmdk-image.binary'
--- live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2018-03-20 18:30:27 +0000
+++ live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2018-03-28 13:08:01 +0000
@@ -3,14 +3,27 @@
3#3#
4# Generate VMDK files4# Generate VMDK files
55
6case ${SUBPROJECT:-} in6<<<<<<< TREE
7 minimized)7case ${SUBPROJECT:-} in
8 echo "Skipping minimized $0 build as images won't boot with linux-kvm"8 minimized)
9 exit 09 echo "Skipping minimized $0 build as images won't boot with linux-kvm"
10 ;;10 exit 0
11 *)11 ;;
12 ;;12 *)
13esac13 ;;
14esac
15=======
16case ${SUBPROJECT:-} in
17 minimized)
18 echo "Skipping minimized $0 build as images won't boot with linux-kvm"
19 exit 0
20 ;;
21 *)
22 ;;
23esac
24
25extension="disk1.vmdk"
26>>>>>>> MERGE-SOURCE
1427
15case $ARCH in28case $ARCH in
16 amd64) ;;29 amd64) ;;
@@ -18,6 +31,7 @@
18 exit 0;;31 exit 0;;
19esac32esac
2033
34<<<<<<< TREE
21case ${IMAGE_TARGETS:-} in35case ${IMAGE_TARGETS:-} in
22 ""|*vmdk*)36 ""|*vmdk*)
23 ;;37 ;;
@@ -26,6 +40,9 @@
26 exit 040 exit 0
27 ;;41 ;;
28esac42esac
43=======
44. config/functions
45>>>>>>> MERGE-SOURCE
2946
30. config/functions47. config/functions
3148
3249
=== modified file 'live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary'
--- live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2018-03-20 18:30:27 +0000
+++ live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2018-03-28 13:08:01 +0000
@@ -9,20 +9,36 @@
9#9#
10# For this step, we re-use the VMDK's made in 040-vmdk-image.binary10# For this step, we re-use the VMDK's made in 040-vmdk-image.binary
1111
12case ${SUBPROJECT:-} in12<<<<<<< TREE
13 minimized)13case ${SUBPROJECT:-} in
14 echo "Skipping minimized $0 build as images won't boot with linux-kvm"14 minimized)
15 exit 015 echo "Skipping minimized $0 build as images won't boot with linux-kvm"
16 ;;16 exit 0
17 *)17 ;;
18 ;;18 *)
19esac19 ;;
2020esac
2121
22# Switch on $ARCH to determine which ID and description to use in the produced22
23# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as23# Switch on $ARCH to determine which ID and description to use in the produced
24# well use them.24# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
25# well use them.
26=======
27case ${SUBPROJECT:-} in
28 minimized)
29 echo "Skipping minimized $0 build as images won't boot with linux-kvm"
30 exit 0
31 ;;
32 *)
33 ;;
34esac
35
36# Switch on $ARCH to determine which ID and description to use in the produced
37# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
38# well use them.
39>>>>>>> MERGE-SOURCE
25case $ARCH in40case $ARCH in
41<<<<<<< TREE
26 amd64)42 amd64)
27 ovf_id=9443 ovf_id=94
28 ovf_os_type="ubuntu64Guest"44 ovf_os_type="ubuntu64Guest"
@@ -41,6 +57,21 @@
41 ;;57 ;;
42esac58esac
4359
60=======
61 amd64)
62 ovf_id=94
63 ovf_os_type="ubuntu64Guest"
64 ovf_desc_bits=64 ;;
65 i386)
66 ovf_id=93
67 ovf_os_type="ubuntu32Guest"
68 ovf_desc_bits=32 ;;
69 *)
70 echo "OVA images are not supported for $ARCH yet.";
71 exit 0;;
72esac
73
74>>>>>>> MERGE-SOURCE
44cur_d=${PWD}75cur_d=${PWD}
45my_d=$(dirname $(readlink -f ${0}))76my_d=$(dirname $(readlink -f ${0}))
4677
4778
=== modified file 'live-build/ubuntu-cpc/hooks/042-vagrant.binary'
--- live-build/ubuntu-cpc/hooks/042-vagrant.binary 2018-03-20 18:30:27 +0000
+++ live-build/ubuntu-cpc/hooks/042-vagrant.binary 2018-03-28 13:08:01 +0000
@@ -3,6 +3,7 @@
3#3#
4# Generate a generic Vagrant Box.4# Generate a generic Vagrant Box.
5#5#
6<<<<<<< TREE
6# Vagrant images are essentially nothing more than OVA's with extra-metadata7# Vagrant images are essentially nothing more than OVA's with extra-metadata
7# and some preinstalled packages.8# and some preinstalled packages.
8#9#
@@ -32,6 +33,28 @@
32 exit 033 exit 0
33 ;;34 ;;
34esac35esac
36=======
37# Vagrant images are essentially nothing more than OVA's with extra-metadata
38# and some preinstalled packages.
39#
40# We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the
41# instance. This build step creates a cloud-config ISO so that Cloud-Init
42# will configure the initial user, creates meta-data that tells Vagrant how
43# to interact with the cloud-init created users, and finally create the OVA.
44#
45# For this step, we make a deriviative of binary/boot/disk.ext4 and install
46# some packages in it, convert it to a vmdk, and then assemble the vagrant
47# box.
48
49case ${SUBPROJECT:-} in
50 minimized)
51 echo "Skipping minimized $0 build as images won't boot with linux-kvm"
52 exit 0
53 ;;
54 *)
55 ;;
56esac
57>>>>>>> MERGE-SOURCE
3558
36cur_d=${PWD}59cur_d=${PWD}
37my_d=$(dirname $(readlink -f ${0}))60my_d=$(dirname $(readlink -f ${0}))
@@ -40,13 +63,27 @@
40# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as63# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
41# well use them.64# well use them.
42case $ARCH in65case $ARCH in
43 amd64)66<<<<<<< TREE
44 ovf_id=9467 amd64)
45 ovf_os_type="ubuntu64Guest"68 ovf_id=94
46 ovf_desc_bits=64 ;;69 ovf_os_type="ubuntu64Guest"
47 *)70 ovf_desc_bits=64 ;;
48 echo "Vagrant images are not supported for $ARCH yet."71 *)
49 exit 0;;72 echo "Vagrant images are not supported for $ARCH yet."
73 exit 0;;
74=======
75 amd64)
76 ovf_id=94
77 ovf_os_type="ubuntu64Guest"
78 ovf_desc_bits=64 ;;
79 i386)
80 ovf_id=93
81 ovf_os_type="ubuntu32Guest"
82 ovf_desc_bits=32 ;;
83 *)
84 echo "Vagrant images are not supported for $ARCH yet."
85 exit 0;;
86>>>>>>> MERGE-SOURCE
50esac87esac
5188
52. config/functions89. config/functions
@@ -54,49 +91,97 @@
54# Lets be safe about this91# Lets be safe about this
55box_d=$(mktemp -d)92box_d=$(mktemp -d)
56seed_d=$(mktemp -d)93seed_d=$(mktemp -d)
57mount_d=$(mktemp -d)94<<<<<<< TREE
5895mount_d=$(mktemp -d)
59create_derivative "disk" "vagrant" #sets ${derivative_img}96
60mount_disk_image ${derivative_img} ${mount_d}97create_derivative "disk" "vagrant" #sets ${derivative_img}
6198mount_disk_image ${derivative_img} ${mount_d}
62cleanup_vagrant() {99
63 if [ -d "$mount_d" ]; then100cleanup_vagrant() {
64 umount_disk_image "$mount_d"101 if [ -d "$mount_d" ]; then
65 fi102 umount_disk_image "$mount_d"
66 rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}103 fi
67}104 rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
68trap cleanup_vagrant EXIT105}
69106trap cleanup_vagrant EXIT
70chroot ${mount_d} apt-get update107
71# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to108chroot ${mount_d} apt-get update
72# avoid pulling into a cloud image.109# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to
73chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils110# avoid pulling into a cloud image.
74chroot ${mount_d} apt-get clean111chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
75112chroot ${mount_d} apt-get clean
76# Create and setup users inside the image.113
77# Vagrant users expect a "vagrant" user with a "vagrant" username.114# Create and setup users inside the image.
78# See https://www.vagrantup.com/docs/boxes/base.html115# Vagrant users expect a "vagrant" user with a "vagrant" username.
79# Note: We decided NOT to allow root login with a default password.116# See https://www.vagrantup.com/docs/boxes/base.html
80chroot ${mount_d} adduser vagrant --disabled-password --gecos ""117# Note: We decided NOT to allow root login with a default password.
81echo "vagrant:vagrant" | chroot ${mount_d} chpasswd118chroot ${mount_d} adduser vagrant --disabled-password --gecos ""
82119echo "vagrant:vagrant" | chroot ${mount_d} chpasswd
83# The vagrant user should have passwordless sudo.120
84cat << EOF > ${mount_d}/etc/sudoers.d/vagrant121# The vagrant user should have passwordless sudo.
85vagrant ALL=(ALL) NOPASSWD:ALL122cat << EOF > ${mount_d}/etc/sudoers.d/vagrant
86EOF123vagrant ALL=(ALL) NOPASSWD:ALL
87124EOF
88# Add the insecure vagrant pubkey to the vagrant user, as is expected by the125
89# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html)126# Add the insecure vagrant pubkey to the vagrant user, as is expected by the
90chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant127# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html)
91chroot ${mount_d} mkdir -p /home/vagrant/.ssh128chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant
92cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys129chroot ${mount_d} mkdir -p /home/vagrant/.ssh
93ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key130cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys
94EOF131ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
95chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh132EOF
96chroot ${mount_d} chmod 700 /home/vagrant/.ssh133chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh
97134chroot ${mount_d} chmod 700 /home/vagrant/.ssh
98umount_disk_image "$mount_d"135
99rmdir "$mount_d"136umount_disk_image "$mount_d"
137rmdir "$mount_d"
138=======
139mount_d=$(mktemp -d)
140
141create_derivative "disk" "vagrant" #sets ${derivative_img}
142mount_disk_image ${derivative_img} ${mount_d}
143
144cleanup_vagrant() {
145 if [ -d "$mount_d" ]; then
146 umount_disk_image "$mount_d"
147 fi
148 rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
149}
150trap cleanup_vagrant EXIT
151
152chroot ${mount_d} apt-get update
153# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to
154# avoid pulling into a cloud image.
155chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
156chroot ${mount_d} apt-get clean
157
158# Create and setup users inside the image.
159# Vagrant users expect a "vagrant" user with a "vagrant" username.
160# See https://www.vagrantup.com/docs/boxes/base.html
161# Note: We decided NOT to allow root login with a default password.
162# --disabled-password and --gecos need to be passed to avoid adduser
163# asking questions when running in an interactive shell
164chroot ${mount_d} adduser vagrant --disabled-password --gecos ""
165echo "vagrant:vagrant" | chroot ${mount_d} chpasswd
166
167# The vagrant user should have passwordless sudo.
168cat << EOF > ${mount_d}/etc/sudoers.d/vagrant
169vagrant ALL=(ALL) NOPASSWD:ALL
170EOF
171
172# Add the insecure vagrant pubkey to the vagrant user, as is expected by the
173# vagrant ecosystem (https://www.vagrantup.com/docs/boxes/base.html)
174chroot ${mount_d} chmod 0440 /etc/sudoers.d/vagrant
175chroot ${mount_d} mkdir -p /home/vagrant/.ssh
176cat << EOF > ${mount_d}/home/vagrant/.ssh/authorized_keys
177ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
178EOF
179chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh
180chroot ${mount_d} chmod 700 /home/vagrant/.ssh
181
182umount_disk_image "$mount_d"
183rmdir "$mount_d"
184>>>>>>> MERGE-SOURCE
100185
101# Used to identify bits186# Used to identify bits
102suite=$(chroot chroot lsb_release -c -s)187suite=$(chroot chroot lsb_release -c -s)
103188
=== added file 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot'
--- live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot 1970-01-01 00:00:00 +0000
+++ live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot 2018-03-28 13:08:01 +0000
@@ -0,0 +1,9 @@
1#!/bin/bash
2#
3# Set InitiatorName to be runtime generated when iscsid first starts, so
4# that each cloud image gets a unique value
5#
6
7if [ -f /etc/iscsi/initiatorname.iscsi ]; then
8 echo "GenerateName=yes" > /etc/iscsi/initiatorname.iscsi
9fi
010
=== renamed file 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot' => 'live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot.moved'
=== modified file 'live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot'
--- live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot 2017-10-19 01:11:53 +0000
+++ live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot 2018-03-28 13:08:01 +0000
@@ -59,6 +59,7 @@
59_xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*'59_xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*'
6060
61## --------------61## --------------
62<<<<<<< TREE
62if [ "${SUBPROJECT:-}" != minimized ]; then63if [ "${SUBPROJECT:-}" != minimized ]; then
63 _xchroot "${rootd}" locale-gen en_US.utf864 _xchroot "${rootd}" locale-gen en_US.utf8
64fi65fi
@@ -68,6 +69,11 @@
68# should be C.UTF-8 for 17.10 and later. For earlier releases, cloud-init may69# should be C.UTF-8 for 17.10 and later. For earlier releases, cloud-init may
69# override this.70# override this.
70echo LANG="C.UTF-8" > "${rootd}/etc/default/locale"71echo LANG="C.UTF-8" > "${rootd}/etc/default/locale"
72=======
73if [ "${SUBPROJECT:-}" != minimized ]; then
74 _xchroot "${rootd}" locale-gen en_US.utf8
75fi
76>>>>>>> MERGE-SOURCE
7177
72## --------------78## --------------
73# set cloud-init to be on79# set cloud-init to be on
@@ -130,6 +136,7 @@
130 } > "${rootd}/etc/overlayroot.local.conf"136 } > "${rootd}/etc/overlayroot.local.conf"
131fi137fi
132138
139<<<<<<< TREE
133# previous steps may have left a dangling symlink here with140# previous steps may have left a dangling symlink here with
134# SUBPROJECT=minimized and that breaks lb_chroot_hacks step141# SUBPROJECT=minimized and that breaks lb_chroot_hacks step
135if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; then142if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; then
@@ -156,6 +163,34 @@
156163
157 _xchroot "${rootd}" apt clean164 _xchroot "${rootd}" apt clean
158fi165fi
166=======
167# previous steps may have left a dangling symlink here with
168# SUBPROJECT=minimized and that breaks lb_chroot_hacks step
169if [ -L "${rootd}/boot/initrd.img" ] && [ ! -e "${rootd}/boot/initrd.img" ]; then
170 rm "${rootd}/boot/initrd.img"
171fi
172
173if [ "${SUBPROJECT:-}" = minimized ]; then
174 # Remove various packages that we don't want in the minimized images.
175 # Some of these are tools that don't make sense by default
176 # non-interactively; some are libraries whose reverse-dependencies
177 # will have already been removed; open-vm-tools, it's a bug that this
178 # is in the common cloud seed because this should only be included
179 # in VMWare guest images, and we know none of the minimized images
180 # are targeted at VMWare.
181 _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \
182 apt-mark auto '^lib.*' '^python*' vim-runtime 2>/dev/null
183 # FIXME: iso-codes is a dep of software-properties and shouldn't be
184 _xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \
185 apt-get -y autoremove --purge iso-codes xauth pastebinit \
186 plymouth open-vm-tools git shared-mime-info vim vim-common \
187 console-setup ncurses-term tmux screen policykit-1 \
188 xdg-user-dirs less run-one apport-symptoms \
189 ubuntu-cloudimage-keyring file
190
191 _xchroot "${rootd}" apt clean
192fi
193>>>>>>> MERGE-SOURCE
159194
160#### END COMMON ARCH FUNCTIONS195#### END COMMON ARCH FUNCTIONS
161196
162197
=== modified file 'live-build/ubuntu-cpc/hooks/999-extras.binary'
--- live-build/ubuntu-cpc/hooks/999-extras.binary 2017-04-13 17:54:14 +0000
+++ live-build/ubuntu-cpc/hooks/999-extras.binary 2018-03-28 13:08:01 +0000
@@ -8,9 +8,14 @@
8 exit 08 exit 0
9fi9fi
1010
11<<<<<<< TREE
11export IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"12export IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
12export CLOUD_IMG_STR="$IMAGE_STR"13export CLOUD_IMG_STR="$IMAGE_STR"
13export FS_LABEL="cloudimg-rootfs"14export FS_LABEL="cloudimg-rootfs"
15=======
16# Export the common functions to the extras
17. config/functions
18>>>>>>> MERGE-SOURCE
1419
15# Cleaner execution20# Cleaner execution
16/bin/run-parts --exit-on-error --regex ".*\.binary" "${extra_d}"21/bin/run-parts --exit-on-error --regex ".*\.binary" "${extra_d}"
1722
=== added symlink 'live-build/ubuntu-touch-custom'
=== target is u'ubuntu-touch/'
=== renamed symlink 'live-build/ubuntu-touch-custom' => 'live-build/ubuntu-touch-custom.moved'
=== modified file 'live-build/ubuntu-touch/hooks/00-uid-gid-fix.chroot_early'

Subscribers

People subscribed via source and target branches