Compare commits

...

103 Commits

Author SHA1 Message Date
Dimitri John Ledkov
813eb816ca releasing package livecd-rootfs version 2.408.20 2017-10-10 13:50:05 +01:00
Dimitri John Ledkov
22a8f817ca Now that grub-related diversions have been factored out in 2.466
instead of having bogus root=stuff arg generated in grub.cfg, it is
actually empty. Therefore update the sed command to make the arg in
the root= token optional. This should resolve non-booting livecd cpc
images.
2017-10-10 13:49:46 +01:00
Steve Langasek
13c0c8ffd5 Unminimization information should only go to motd when we are actually minimized 2017-10-08 16:10:45 -04:00
Steve Langasek
cc3cb4e0d8 Merge lp:~rbalint/livecd-rootfs/minimize-fix-grub 2017-10-05 10:01:41 -07:00
Steve Langasek
b2fba90356 Fix the force-partuuid handling to create the file under
/etc/default/grub.d/ with a .cfg extension as grub expects; it's unclear
how this ever worked without.
2017-10-05 16:02:26 +02:00
Steve Langasek
b66cc28507 Factor out grub-related diversions and use them consistently, so we
don't end up with wrong os-probe output in our grub.cfg.
2017-10-05 16:01:04 +02:00
Steve Langasek
2a70314f27 releasing package livecd-rootfs version 2.408.19 2017-10-04 18:43:52 +00:00
Steve Langasek
0987c6a7ea Clean up the changelog for SRU 2017-10-04 10:54:31 -07:00
Steve Langasek
04ffcc07dc add bug ref 2017-10-04 10:46:15 -07:00
Steve Langasek
60df0277fd Skip installation of kernel headers for all minimal images 2017-10-04 17:41:45 +00:00
Steve Langasek
4a4bac20f6 Use kvm kernel flavor for minimized cloud image, not virtual 2017-10-04 17:41:08 +00:00
Steve Langasek
dfb4c593b1 include adjustments to the minimize/unminimize wording that were made in the merge commit on trunk 2017-10-03 22:23:04 -07:00
Steve Langasek
2e3ca4b5a9 ignore minimized autopkgtest failure on ppc64el, as in artful 2017-10-03 22:16:26 -07:00
Steve Langasek
87d69d902a debian/tests/default-bootstraps: minor adjustments to shell syntax,
syncing with artful where this originated.
2017-10-03 22:15:34 -07:00
Steve Langasek
aee9079732 Merge lp:~rbalint/livecd-rootfs/minimize-unminimize-xenial 2017-10-03 22:13:56 -07:00
Balint Reczey
53f5c1c79c Update changelog 2017-10-03 17:38:29 +02:00
Steve Langasek
06cdc3f46d Use /bin/sh, not /bin/bash, for autopkgtest. 2017-10-03 17:34:52 +02:00
Balint Reczey
413a53d482 When SUBPROJECT environment variable is not set assume it to be "" 2017-10-03 17:31:27 +02:00
Balint Reczey
0900d20265 Run autopkgtest for SUBPROJECT=minimized 2017-10-03 17:31:26 +02:00
Balint Reczey
88d854ffb5 Use SUBPROJECT=minimized name instead of SUBPROJECT=minimize for consistency 2017-10-03 17:31:26 +02:00
Balint Reczey
b90b04a7b7 Warn users that unminimize may fail reinstalling packages 2017-10-03 17:31:26 +02:00
Balint Reczey
d33ab3825f Mention unminimize script in motd 2017-10-03 17:31:26 +02:00
Balint Reczey
febe06642c Bump needed live-build version which can build images without initrd 2017-10-03 17:31:26 +02:00
Steve Langasek
4d7509f570 Fix a reference to an undefined variable in a script that's set -u. 2017-10-03 17:31:16 +02:00
Balint Reczey
3f9753b2c0 Update changelog 2017-09-28 09:41:13 -04:00
Balint Reczey
86ed851b5a Force partuuid in /etc/default/grub.d/* instead of in /etc/default/grub
This prevents ucf questions upon installation of changed /etc/default/grub
2017-09-28 09:38:23 -04:00
Steve Langasek
b32298ede1 minimization handling for UEFI disk images 2017-09-28 09:38:23 -04:00
Balint Reczey
1ca59f1c3a Print the documentation files which could not be restored by unminimize 2017-09-28 09:38:23 -04:00
Balint Reczey
a40bd1d55b Explain why unminimization script is a bit complicated 2017-09-28 09:38:23 -04:00
Balint Reczey
8244beb6d1 Verify only documentation that should have been restored after unminimization 2017-09-28 09:38:23 -04:00
Balint Reczey
93fc7c56f2 Use "dpkg --verify-format rpm" explicitly to be safe when the default changes 2017-09-28 09:38:23 -04:00
Balint Reczey
e5cbd2384a Fix typo 2017-09-28 09:38:23 -04:00
Balint Reczey
98f27745b7 Drop initramfs-tools diversion
Kernels which are able to boot without initramfs now dropped dependency
on initramfs-tools thus initramfs-tools can be removed from the image
instead of having to divert it to avoid initramfs generation.
2017-09-28 09:38:23 -04:00
Balint Reczey
e9fc1d8c9f Install ubuntu-minimal while unminimizing the system 2017-09-28 09:38:23 -04:00
Balint Reczey
5e1d0f0ee7 Add unminimize script for reverting minimization on running system 2017-09-28 09:38:23 -04:00
Balint Reczey
9dd178a0e5 Drop man pages and most of the documentation from minimized images
/usr/share/doc/*/copyright and changelog.Debian.gz files are still kept
2017-09-28 09:38:23 -04:00
Balint Reczey
c2d66c7d96 Source config/binary instead of /build/config/binary which may not exist 2017-09-28 09:38:23 -04:00
Steve Langasek
bd2a11774f if we're using SUBPROJECT=minimize, and tzdata is not installed, remove
files that have been left behind.  This is a workaround for a bug that should
be fixed in tzdata.
2017-09-28 09:38:23 -04:00
Steve Langasek
cd15b730f7 In a cloud environment, we can rely on the kernel being able to boot the
root filesystem directly, without an initramfs; enable this when
building minimized.
2017-09-28 09:38:21 -04:00
Steve Langasek
5a6f68a1a9 We probably still want sudo, even in a minimal image. 2017-09-28 09:34:31 -04:00
Steve Langasek
86108d69d9 Make the 999-cpc-fixes.chroot subproject-aware, so we don't try to locale-gen 2017-09-28 09:34:31 -04:00
Steve Langasek
95b06ff341 Export the subproject into config/chroot and config/binary, so that this
information is available to per-project hooks that need to be
subproject-aware (e.g., to skip steps when SUBPROJECT=minimize)
2017-09-28 09:34:31 -04:00
Steve Langasek
527a7b165e Begin adding support for a project-independent 'minimize' subproject,
which (ironically) omits ubuntu-minimal in favor of using only the
minbase package set.
2017-09-28 09:34:31 -04:00
Steve Langasek
9c9e8c4e4f Mount using --make-rslave to ensure safe unmounts for rbind mounts 2017-09-26 01:10:15 -04:00
Steve Langasek
f16611774f * Improve teardown_mountpoint to recursively find all submounts and
unmount them, instead of working from a hard-coded list.  This makes
  the code resilient against other submounts being added later, including
  downstream.
* Also nuke the sleep / udevadm settle calls in the process, which should
  never be required and slow down the builds.
2017-09-19 13:45:37 -07:00
Steve Langasek
2b208d7287 Merge lp:~vtapia/livecd-rootfs/xenial-proposed-lp1444992 2017-09-19 13:02:05 -07:00
Victor Tapia
13e9dc0089 live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI
Initiator Name at first iscsid run for cloud images to ensure it is
unique (LP: #1444992).
2017-09-19 11:03:29 +02:00
Steve Langasek
d330c595ae releasing package livecd-rootfs version 2.408.18 2017-09-13 22:10:29 -07:00
Steve Langasek
410703eae5 Merge lp:~rcj/livecd-rootfs/xenial-proposed 2017-09-13 22:10:07 -07:00
Robert C Jennings
a623618e2c Install udev before calls to udevadm 2017-09-13 21:05:22 -05:00
Steve Langasek
cf1b95b854 releasing package livecd-rootfs version 2.408.17 2017-09-13 12:21:35 -07:00
Steve Langasek
6219443b4c Merge lp:~rcj/livecd-rootfs/xenial-proposed 2017-09-13 12:21:23 -07:00
Robert C Jennings
0acda846dd live-build/ubuntu-cpc/functions: Add teardown_mountpoint to reverse setup_mountpoint
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
  to reverse the work done in setup_mountpoint.  Lack of this function
  has forced users of setup_mountpoint to implement this separately
  and the implementations have diverged. (LP: #1716992)
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
  The was only used where teardown_mountpoint was lacking.
2017-09-13 13:18:03 -05:00
Steve Langasek
f6897fae71 live-build/ubuntu-cpc/hooks/030-root-tarball.binary: correct a missing
unmount of /var/{lib,cache}/apt on cleanup, detected via autopkgtests.
2017-09-12 14:23:00 -07:00
Steve Langasek
a99dd8bf9f changelog verbosity++ 2017-09-12 14:00:20 -07:00
Steve Langasek
2c98112f93 releasing package livecd-rootfs version 2.408.16 2017-09-12 13:26:12 -07:00
Steve Langasek
11a92795fe live-build/ubuntu-cpc/functions: call apt-get update in the chroot
after mounting a blank /var/lib/apt, so that further operations work
as expected.
2017-09-12 13:25:55 -07:00
Steve Langasek
b81173b1b5 releasing package livecd-rootfs version 2.408.15 2017-09-11 14:41:53 -07:00
Steve Langasek
3fdf3933ed Fix suppression of kpartx error. LP: #1684090. 2017-09-11 14:34:09 -07:00
Steve Langasek
314a6b95a3 Mount and unmount /dev recursively, to cope with setups where there are
interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
LXD).  LP: #1716465.
2017-09-11 14:33:23 -07:00
Steve Langasek
880d4f8b89 live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get
update *before* installing packages, not after.
2017-08-25 15:30:48 -07:00
Steve Langasek
95aabdf668 live-build/ubuntu-cpc/functions: mount tmpfs on /var/cache/apt and
/var/lib/apt, so we don't have to leave empty space in our derivative
images for packages that have been downloaded/installed/removed.  This
normally isn't relevant for the installed system, since the root
filesystem will auto-expand in place on the target disk, but lets us
ship smaller images.
2017-08-25 15:30:05 -07:00
Steve Langasek
a4988ccf13 Merge lp:~cyphermox/livecd-rootfs/xenial-proposed 2017-08-23 17:38:27 -07:00
Mathieu Trudel-Lapierre
a75544e0c3 Only set a default GRUB_PRELOAD_MODULES if not already defined; otherwise used the existing values. 2017-08-23 19:20:35 -04:00
Mathieu Trudel-Lapierre
f48670cec5 Clean up GRUB_MODULES_PRELOAD / grub_modules. Remove the modules already loaded in stock signed grub EFI binaries. 2017-08-18 19:37:34 -04:00
Adam Conrad
e3b44822d7 live-build/auto/config: Filter libgles1-mesa out of tasks, as it is not a
dependency of anything in updates anymore, fixing mate/myth (LP: #1704013)
2017-07-12 16:34:36 -06:00
Steve Langasek
0cabfc3781 releasing package livecd-rootfs version 2.408.13 2017-06-06 21:52:51 -07:00
Steve Langasek
02223103c1 Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-xenial 2017-06-06 21:38:29 -07:00
Balint Reczey
8d72b588a1 Update changelog 2017-05-12 21:21:05 +02:00
Balint Reczey
2569995de8 Work around kpartx's nonzero exit due to "Device or resource busy" errors
which still permit kpartx to finally remove loop device (LP: #1684090).
Also sync before calling kpartx to let writing to loop devices finish.
2017-05-12 21:20:22 +02:00
Steve Langasek
0fcff1923c Mark autopkgtests isolation-machine since debootstrap won't work in a
container.
2017-05-12 21:20:22 +02:00
Balint Reczey
2685b836bd Add basic autopkgtest 2017-05-12 21:20:22 +02:00
Balint Reczey
95c239f301 Use all config hooks from the proper place, not from /build/ 2017-05-12 21:20:22 +02:00
Balint Reczey
e25936cc61 Source ubuntu-cpc functions from the right place 2017-05-12 21:20:22 +02:00
Robert C Jennings
2048477b0d live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure.
(LP: #1687752)
2017-05-12 11:47:09 -07:00
Mathieu Trudel-Lapierre
b5bb3c3a6e releasing package livecd-rootfs version 2.408.11 2017-04-07 16:18:45 -04:00
Mathieu Trudel-Lapierre
5081c333bb Add apt-get update to ubuntu-cpc ppc64el builds so they use the new
sources.
2017-04-07 16:12:48 -04:00
Adam Conrad
2c9f9dd323 Fix security mirror sources.list entries for non-x86 architectures.
(LP: #1679252)
2017-04-04 09:28:52 -06:00
Mathieu Trudel-Lapierre
a0983db864 releasing package livecd-rootfs version 2.408.9 2017-03-23 14:41:36 -04:00
Mathieu Trudel-Lapierre
d50b3ba529 ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290) 2017-03-23 14:40:47 -04:00
Steve Langasek
e6793cfa3a Merge lp:~rcj/livecd-rootfs/xenial-proposed/ 2017-03-21 08:40:59 -07:00
Daniel Watkins
28e14a0b77 * Don't overwrite the default sources.list in cloud images.
* Replace sources.list generated using COMPONENTS with the sources.list from
  an Ubuntu Server installation (i.e. with all components enabled, and all
  deb-src lines commented).  LP: #1513529.
2017-03-21 08:36:01 -07:00
Robert C Jennings
dacc1ea41e Fix OVA generation and add grub label helper for ubuntu-cpc
[ Chris Glass ]
* Fix the manifest generation in OVA files so that ovf files don't have
  double extensions.  (LP: #1627931)
* Fix the OVF's metadata to include Ubuntu specific identifiers and
  descriptions instead of the generic Linux ones.  (LP: #1656293) 
[ Daniel Watkins ]
* Add replace_grub_root_with_label function thereby consolidating multiple
  uses of the same calls to sed.
2017-03-17 13:39:21 -05:00
Daniel Watkins
ececc9789d Add replace_grub_root_with_label function
When update-grub is run, it will detect the disks in the build system.
Currently, we sed the grub configuration in places where this happens;
replace_grub_root_with_label moves that seddery in to a single callable
location to avoid ending up with multiple versions of it.

(It's worth noting that we also do this in 999-cpc-fixes.chroot, but as our
functions file isn't available within the chroot we don't use it there.)
2017-03-17 13:35:37 -05:00
Christopher Glass
92a10c0df0 Fix the OVF's metadata to include Ubuntu specific identifiers and
descriptions instead of the generic Linux ones.  (LP: #1656293)
2017-03-17 13:34:22 -05:00
Christopher Glass
4bc9def5d6 This branch fixes the manifest generation in OVA files (LP:1627931)
The .ova file extension was passed twice, resulting in file not found errors in
both the general case and the vagrant-specific file creation.
2017-03-17 13:32:55 -05:00
Adam Conrad
188d485441 Set device_tree_address for the new kernel in the RPi bootloader config.txt 2017-02-16 10:32:15 -07:00
Adam Conrad
f2f8665598 * Forward-port hardware enablement delta from trusty to xenial, with changes:
- Implement hwe stack swapping as task filters instead of install hints
  - Revert ubuntu-desktop and ubuntu-gnome to use tasks again for the above
2017-02-16 10:18:54 -07:00
Steve Langasek
40a4d16f3e Document the Vcs-Bzr branch for SRUs. 2017-02-08 22:57:39 -08:00
Łukasz 'sil2100' Zemczak
66aaa4ab40 Remove the systemd-sysv- line from ubuntu-touch config routines. 2016-10-06 14:41:45 +02:00
Łukasz 'sil2100' Zemczak
58dd50b464 Add changelog entry for previous commit. 2016-10-03 14:15:34 +02:00
Łukasz 'sil2100' Zemczak
f10c47f913 Add additional hints to ubuntu-touch* i386/amd64 image builds to pull in the gles version of the UITK. 2016-10-03 14:14:22 +02:00
Łukasz 'sil2100' Zemczak
a4f597c84b Fix small but terrible typo in the ubuntu-touch-custom handling that was breaking touch builds. Please note: I corrected the 2.408.5 version in the upload queue so this is also part of that release. 2016-09-29 10:18:40 +02:00
Łukasz 'sil2100' Zemczak
24c2b2773f releasing package livecd-rootfs version 2.408.5 2016-09-27 17:43:02 +02:00
Łukasz 'sil2100' Zemczak
8f735f316b Sync with what's currently released to xenial-proposed: remove ubuntu-pd, add ubuntu-touch-custom, remove the kernel.yaml addition for snappy as it's not meant to be in xenial and no longer needed. 2016-09-27 17:41:54 +02:00
Steve Langasek
5efb2007af add meta/kernel.yaml to the kernel snaps 2016-09-14 19:02:41 +00:00
Steve Langasek
8bcc5ca1c2 Add the new dhcpd user introduced by latest archive changes. 2016-09-14 19:02:28 +00:00
Steve Langasek
455d0a6af4 Temporarily change the 60-install-click.chroot script to pull in clicks for
arm64 builds from a different location for ubuntu-touch.
2016-09-14 19:00:14 +00:00
Steve Langasek
6b04c07371 releasing package livecd-rootfs version 2.408.4 2016-09-09 17:04:58 -07:00
Steve Langasek
4079a1acce live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
so that the teardown is done properly /before/ we try to make an
image from our filesystem, since otherwise /etc/resolv.conf is broken.
LP: #1621393.
2016-09-09 17:04:54 -07:00
Brian Murray
d51fef0426 * Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
- Install virtualbox-guest-utils
  - Don't disable default synced folder
  - Don't set vm name
  - Add cloud-init config to manage /etc/hosts LP: #1561250
2016-09-09 17:00:35 -07:00
Adam Conrad
b0e649a83c Switch ubuntu-gnome from using tasks to metapackages (LP: #1602035) 2016-07-21 02:31:01 -06:00
Steve Langasek
caedaee057 Rename old ubuntu-core tarballs to ubuntu-base, for consistency with
the changes already made to yakkety and the ubuntu-cdimage project.
LP: #1579950.
2016-05-09 17:07:33 -07:00
24 changed files with 860 additions and 245 deletions

242
debian/changelog vendored
View File

@ -1,3 +1,245 @@
livecd-rootfs (2.408.20) xenial; urgency=medium
* Now that grub-related diversions have been factored out in 2.466
instead of having bogus root=stuff arg generated in grub.cfg, it is
actually empty. Therefore update the sed command to make the arg in
the root= token optional. This should resolve non-booting livecd cpc
images.
-- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 10 Oct 2017 13:49:49 +0100
livecd-rootfs (2.408.19) xenial; urgency=medium
[ Nishanth Aravamudan ]
* live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI
Initiator Name at first iscsid run for cloud images to ensure it is
unique (LP: #1444992).
[ Steve Langasek ]
* Improve teardown_mountpoint to recursively find all submounts and
unmount them, instead of working from a hard-coded list. This makes
the code resilient against other submounts being added later, including
downstream. LP: #1721279.
* Also nuke the sleep / udevadm settle calls in the process, which should
never be required and slow down the builds.
* Fix a reference to an undefined variable in a script that's set -u.
* Use /bin/sh, not /bin/bash, for autopkgtest.
* debian/tests/default-bootstraps: minor adjustments to shell syntax,
syncing with artful where this originated.
[ Steve Langasek, Balint Reczey ]
* Introduce a new project-independent 'minimized' subproject
(LP: #1721261):
- omit ubuntu-minimal in favor of using only the minbase package set.
- boot directly by partuuid, avoiding the use of an initramfs.
- Bump needed live-build version which can build images without initrd
- drop man pages and most of the documentation from minimized images
(/usr/share/doc/*/copyright and changelog.Debian.gz files are still
kept)
- Add unminimize script for reverting minimization on a running system
- Mention unminimize script in motd
- Run autopkgtest for SUBPROJECT=minimized
- If we're using SUBPROJECT=minimized, and tzdata is not installed,
remove files that have been left behind. This is a workaround for a
bug that should be fixed in tzdata.
* Factor out grub-related diversions and use them consistently, so we
don't end up with wrong os-probe output in our grub.cfg.
[ Balint Reczey ]
* Mount using --make-rslave to ensure safe unmounts for rbind mounts
* When SUBPROJECT environment variable is not set assume it to be ""
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 04 Oct 2017 18:43:48 +0000
livecd-rootfs (2.408.18) xenial; urgency=medium
[ Robert C Jennings ]
* Install udev before calls to udevadm
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 22:10:11 -0700
livecd-rootfs (2.408.17) xenial; urgency=medium
[ Robert C Jennings ]
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
to reverse the work done in setup_mountpoint. Lack of this function
has forced users of setup_mountpoint to implement this separately
and the implementations have diverged. (LP: #1716992)
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
The was only used where teardown_mountpoint was lacking.
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 13 Sep 2017 12:21:30 -0700
livecd-rootfs (2.408.16) xenial; urgency=medium
* live-build/ubuntu-cpc/functions: call apt-get update in the chroot
after mounting a blank /var/lib/apt, so that further operations work
as expected; otherwise, 'apt-get purge ^grub-.*' fails on s390x because
no such packages are known to apt.
* live-build/ubuntu-cpc/hooks/030-root-tarball.binary: correct a missing
unmount of /var/{lib,cache}/apt on cleanup, detected via autopkgtests.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 12 Sep 2017 13:25:58 -0700
livecd-rootfs (2.408.15) xenial; urgency=medium
[ Mathieu Trudel-Lapierre ]
* Drop preloading of grub modules that are built into the grub signed
image. This is functionally a no-op, changed only to clean up the code.
[ Steve Langasek ]
* live-build/ubuntu-cpc/functions: mount tmpfs on /var/cache/apt and
/var/lib/apt, so we don't have to leave empty space in our derivative
images for packages that have been downloaded/installed/removed. This
normally isn't relevant for the installed system, since the root
filesystem will auto-expand in place on the target disk, but lets us
ship smaller images.
* live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get
update *before* installing packages, not after.
[ Colin Watson ]
* Mount and unmount /dev recursively, to cope with setups where there are
interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
LXD). LP: #1716465.
[ Balint Reczey ]
* Fix suppression of kpartx error. LP: #1684090.
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 11 Sep 2017 14:38:42 -0700
livecd-rootfs (2.408.14) xenial; urgency=medium
* live-build/auto/config: Filter libgles1-mesa out of tasks, as it is not a
dependency of anything in updates anymore, fixing mate/myth (LP: #1704013)
-- Adam Conrad <adconrad@ubuntu.com> Wed, 12 Jul 2017 16:28:13 -0600
livecd-rootfs (2.408.13) xenial; urgency=medium
[ Balint Reczey ]
* Source ubuntu-cpc functions from the right place
* Use all config hooks from the proper place, not from /build/
* Add basic but configurable autopkgtest (LP: #1690440)
* sync before calling kpartx to let writing to loop devices finish
* wrap kpartx and trap spurious errors, to work around kpartx
unreliability.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 06 Jun 2017 21:52:21 -0700
livecd-rootfs (2.408.12) xenial; urgency=medium
* live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure.
(LP: #1687752)
-- Robert C Jennings <robert.jennings@canonical.com> Tue, 09 May 2017 13:57:44 -0700
livecd-rootfs (2.408.11) xenial; urgency=medium
* Add `apt-get update` to ubuntu-cpc ppc64el builds so they use the new
sources.
-- Daniel Watkins <daniel.watkins@canonical.com> Fri, 07 Apr 2017 16:12:53 -0400
livecd-rootfs (2.408.10) xenial; urgency=medium
[ Adam Conrad ]
* Fix security mirror sources.list entries for non-x86 architectures.
(LP: #1679252)
-- Daniel Watkins <daniel.watkins@canonical.com> Mon, 03 Apr 2017 14:05:25 -0400
livecd-rootfs (2.408.9) xenial; urgency=medium
[ Daniel Watkins ]
* Don't overwrite the default sources.list in cloud images.
* Replace sources.list generated using COMPONENTS with the sources.list from
an Ubuntu Server installation (i.e. with all components enabled, and all
deb-src lines commented). LP: #1513529.
[ Chris Glass ]
* Fix the manifest generation in OVA files so that ovf files don't have
double extensions. (LP: #1627931)
* Fix the OVF's metadata to include Ubuntu specific identifiers and
descriptions instead of the generic Linux ones. (LP: #1656293)
[ Daniel Watkins ]
* Add replace_grub_root_with_label function thereby consolidating multiple
uses of the same calls to sed.
[ Robert C Jennings ]
* ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
-- Robert C Jennings <robert.jennings@canonical.com> Thu, 23 Mar 2017 14:40:59 -0400
livecd-rootfs (2.408.8) xenial; urgency=medium
* Set device_tree_address for the new kernel in the RPi bootloader config.txt
-- Adam Conrad <adconrad@ubuntu.com> Thu, 16 Feb 2017 10:21:51 -0700
livecd-rootfs (2.408.7) xenial; urgency=medium
[ Łukasz 'sil2100' Zemczak ]
* Add additional hints to ubuntu-touch* i386/amd64 image builds to pull in
the gles version of the UITK.
* Now that we have have systemd working on ubuntu-touch, remove the
systemd-sysv- in add_package config to make sure we can build an image with
systemd as the init system.
[ Adam Conrad ]
* Forward-port hardware enablement delta from trusty to xenial, with changes:
- Implement hwe stack swapping as task filters instead of install hints
- Revert ubuntu-desktop and ubuntu-gnome to use tasks again for the above
-- Adam Conrad <adconrad@ubuntu.com> Wed, 08 Feb 2017 11:50:52 -0700
livecd-rootfs (2.408.5) xenial; urgency=medium
* Temporarily change the 60-install-click.chroot script to pull in clicks for
arm64 builds from a different location for ubuntu-touch.
* Add the new dhcpd user to touch hooks introduced by latest archive changes.
* Remove the ubuntu-pd project logic.
* Synced ubuntu-touch-custom changes from the vivid branch to xenial. This
also adds a new symlink called ubuntu-touch-custom to the ubuntu-touch hooks
dir.
* Stop using the overlay PPA for touch livecd-rootfs changes (LP: #1628085).
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 27 Sep 2016 13:27:28 +0200
livecd-rootfs (2.408.4) xenial; urgency=medium
* live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
so that the teardown is done properly /before/ we try to make an
image from our filesystem, since otherwise /etc/resolv.conf is broken.
LP: #1621393.
-- Steve Langasek <steve.langasek@ubuntu.com> Fri, 09 Sep 2016 17:04:54 -0700
livecd-rootfs (2.408.3) xenial-proposed; urgency=medium
[ Louis Zuckerman ]
* Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
- Install virtualbox-guest-utils
- Don't disable default synced folder
- Don't set vm name
- Add cloud-init config to manage /etc/hosts LP: #1561250
-- Brian Murray <brian@ubuntu.com> Tue, 30 Aug 2016 13:17:55 -0700
livecd-rootfs (2.408.2) xenial; urgency=medium
* Switch ubuntu-gnome from using tasks to metapackages (LP: #1602035)
-- Adam Conrad <adconrad@ubuntu.com> Wed, 20 Jul 2016 01:46:41 -0600
livecd-rootfs (2.408.1) xenial; urgency=medium
* Rename old ubuntu-core tarballs to ubuntu-base, for consistency with
the changes already made to yakkety and the ubuntu-cdimage project.
LP: #1579950.
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 09 May 2016 17:00:19 -0700
livecd-rootfs (2.408) xenial; urgency=medium livecd-rootfs (2.408) xenial; urgency=medium
* drop linux-firmware-raspi2, it does not actually contain driver * drop linux-firmware-raspi2, it does not actually contain driver

4
debian/control vendored
View File

@ -4,11 +4,11 @@ Priority: optional
Build-Depends: debhelper (>= 7) Build-Depends: debhelper (>= 7)
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Standards-Version: 3.9.6 Standards-Version: 3.9.6
Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk Vcs-Bzr: lp:~ubuntu-core-dev/livecd-rootfs/xenial-proposed/
Package: livecd-rootfs Package: livecd-rootfs
Architecture: any Architecture: any
Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a57-1ubuntu12~), android-tools-fsutils [armhf], python3-software-properties Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a57-1ubuntu25.5~), android-tools-fsutils [armhf], python3-software-properties
Suggests: partimage Suggests: partimage
Breaks: ubuntu-defaults-builder (<< 0.32) Breaks: ubuntu-defaults-builder (<< 0.32)
Description: construction script for the livecd rootfs Description: construction script for the livecd rootfs

7
debian/tests/control vendored Normal file
View File

@ -0,0 +1,7 @@
Tests: default-bootstraps
Depends: @, lsb-release
Restrictions: needs-root isolation-machine
Tests: minimized
Depends: @, lsb-release
Restrictions: needs-root isolation-machine

96
debian/tests/default-bootstraps vendored Executable file
View File

@ -0,0 +1,96 @@
#!/bin/sh
# autopkgtest check: Build default rootfs for all supported project:subproject pairs
# (C) 2017 Canonical Ltd.
# Author: Balint Reczey <balint.reczey@canonical.com>
set -e
if [ -z "$SUITE" ]; then
SUITE=$(lsb_release -c -s)
fi
# Known project:subproject:template combinations.
# Listed subprojects can be combined with other projects as well,
# but this list gives reasonable coverage.
ALL_TRIPLETS="
base::
edubuntu::
edubuntu-dvd::
kubuntu::
kubuntu-active::
kubuntu-dvd::
kubuntu-plasma5::
lubuntu::
lubuntu-next::
mythbuntu::
ubuntu::
ubuntu-base::
ubuntu-budgie::
ubuntu-budgie-desktop::
ubuntu-budgie-live::
ubuntu-core:system-image:ubuntu-core
ubuntu-cpc::ubuntu-cpc
ubuntu-cpc:minimized:ubuntu-cpc
ubuntu-desktop-next:system-image:ubuntu-desktop-next
ubuntu-desktop-next::ubuntu-desktop-next
ubuntu-dvd::
ubuntu-gnome::
ubuntukylin::
ubuntu-mate::
ubuntu-mate-core::
ubuntu-mate-desktop::
ubuntu-mate-live::
ubuntu-netbook::
ubuntu-server::
ubuntu-server:ubuntu-rtm:
ubuntu-server:ubuntu-rtm/foo:
ubuntu-server:wubi:
ubuntu-touch-custom::ubuntu-touch-custom
ubuntu-touch::ubuntu-touch
xubuntu::"
if [ -z "$SELECTED_TRIPLETS" ]; then
SELECTED_TRIPLETS="
ubuntu-base::
ubuntu-cpc::ubuntu-cpc
"
fi
live_build_rootfs() {
PROJECT=${1%%:*}
local SUBPROJECT_TMP=${1%:*}
SUBPROJECT=${SUBPROJECT_TMP#*:}
TEMPLATE=${1##*:}
ARCH=$(dpkg --print-architecture)
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
cp -a /usr/share/livecd-rootfs/live-build/auto .
if [ -n "$TEMPLATE" ]; then
cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
fi
env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
SUITE=$SUITE \
ARCH=$ARCH \
lb config
mkdir chroot
# this part needs root rights, but right now the whole script ran as root by autopkgtest
env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
ARCH=$ARCH \
lb build
echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
du -sh *
echo ""
}
WORKDIR=$(mktemp -d)
trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
for i in $SELECTED_TRIPLETS; do
mkdir $i
(cd $i && live_build_rootfs $i)
# clean up after build to avoid filling the disk, needs root rights
rm -rf $i
done

11
debian/tests/minimized vendored Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
ARCH=$(dpkg --print-architecture)
failure_code=1
if [ "$ARCH" = ppc64el ]; then
# not a regression; don't block while debugging
failure_code=0
fi
env SELECTED_TRIPLETS=ubuntu-cpc:minimized:ubuntu-cpc debian/tests/default-bootstraps || exit $failure_code

View File

@ -31,6 +31,112 @@ Expire-Date: 0
lb bootstrap "$@" lb bootstrap "$@"
if [ "${SUBPROJECT:-}" = minimized ] \
&& ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then
# workaround for tzdata purge not removing these files
rm -f chroot/etc/localtime chroot/etc/timezone
fi
if [ "${SUBPROJECT:-}" = minimized ]; then
# set up dpkg filters to skip installing docs on minimized system
mkdir -p chroot/etc/dpkg/dpkg.cfg.d
cat > chroot/etc/dpkg/dpkg.cfg.d/excludes <<EOF
# Drop all man pages
path-exclude=/usr/share/man/*
# Drop all documentation ...
path-exclude=/usr/share/doc/*
# ... except copyright files ...
path-include=/usr/share/doc/*/copyright
# ... and Debian changelogs
path-include=/usr/share/doc/*/changelog.Debian.*
EOF
# Remove docs installed by bootstrap
Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs apt-get install --reinstall
# Add unminimizer script which restores default image behavior
mkdir -p chroot/usr/local/sbin
cat > chroot/usr/local/sbin/unminimize <<'EOF'
#!/bin/sh
set -e
echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "This script restores the content and packages that are found on a default"
echo "Ubuntu server system."
echo ""
echo "Reinstallation of packages may fail due to changes to the system"
echo "configuration, the presence of third-party packages, or for other"
echo "reasons."
read -p "Would you like to continue? [y/N]" REPLY
echo # (optional) move to a new line
if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]
then
exit 1
fi
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
echo "Re-enabling installation of all documentation in dpkg..."
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
fi
echo "Updating package list and upgrading packages..."
apt-get update
# apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
apt-get upgrade
echo "Restoring system documentation..."
echo "Reinstalling packages with files in /usr/share/man/ ..."
# Reinstallation takes place in two steps because a single dpkg --verified
# command generates very long parameter list for "xargs dpkg -S" and may go
# over ARG_MAX. Since many packages have man pages the second download
# handles a much smaller amount of packages.
dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
# This step processes the packages which still have missing documentation
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
if dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {exit 1}'; then
echo "Documentation has been restored successfully."
rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
else
echo "There are still files missing from /usr/share/doc/:"
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/doc/ {print " " $2}'
echo "You may want to try running this script again or you can remove"
echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually."
fi
fi
if ! dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-minimal 2> /dev/null | grep -q '^installed$'; then
echo "Installing ubuntu-minimal package to provide the familiar Ubuntu minimal system..."
DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-minimal
fi
# unminimization succeeded, there is no need to mention it in motd
rm -f /etc/update-motd.d/60-unminimize
EOF
chmod +x chroot/usr/local/sbin/unminimize
# inform users about the unminimize script
cat > "chroot/etc/update-motd.d/60-unminimize" << EOF
#!/bin/sh
#
# This file is not managed by a package. If you no longer want to
# see this message you can safely remove the file.
echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "To restore this content, you can run the 'unminimize' command."
EOF
chmod +x chroot/etc/update-motd.d/60-unminimize
fi
Chroot chroot "dpkg-divert --quiet --add \ Chroot chroot "dpkg-divert --quiet --add \
--divert /usr/sbin/update-initramfs.REAL --rename \ --divert /usr/sbin/update-initramfs.REAL --rename \
/usr/sbin/update-initramfs" /usr/sbin/update-initramfs"
@ -58,116 +164,56 @@ EOF
# preinstalled being slightly different in what it doesn't ask) from # preinstalled being slightly different in what it doesn't ask) from
# debian-installer's apt-setup: # debian-installer's apt-setup:
codename=$LB_DISTRIBUTION cat > chroot/etc/apt/sources.list << EOF
file="chroot/etc/apt/sources.list"
dists="main"
alldists="main"
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q restricted; then
dists="$dists restricted"
alldists="$alldists restricted"
fi
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q universe; then
UNIVERSE=true
else
UNIVERSE=false
fi
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q multiverse; then
MULTIVERSE=true
else
MULTIVERSE=false
fi
cat > $file <<EOF
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution. # newer versions of the distribution.
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
deb $LB_PARENT_MIRROR_BINARY $codename $dists # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
deb-src $LB_PARENT_MIRROR_BINARY $codename $dists
## Major bug fix updates produced after the final release of the ## Major bug fix updates produced after the final release of the
## distribution. ## distribution.
deb $LB_PARENT_MIRROR_BINARY $codename-updates $dists deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates $dists # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
EOF
# Even if universe isn't enabled, we write example lines for it.
echo >> $file
if [ "$UNIVERSE" = true ]; then
alldists="$alldists universe"
COMMENT=
else
cat >> $file <<EOF
## Uncomment the following two lines to add software from the 'universe'
## repository.
EOF
COMMENT='# '
fi
cat >> $file <<EOF
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any ## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team. ## review or updates from the Ubuntu security team.
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename universe deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename universe # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-updates universe deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-updates universe # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
EOF
# Multiverse is different, don't write anything unless enabled.
if [ "$MULTIVERSE" = true ]; then
alldists="$alldists multiverse"
cat >> $file <<EOF
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to ## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in ## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu ## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team. ## security team.
deb $LB_PARENT_MIRROR_BINARY $codename multiverse deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename multiverse # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
deb $LB_PARENT_MIRROR_BINARY $codename-updates multiverse deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates multiverse # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
EOF
fi
cat >> $file <<EOF
## N.B. software from this repository may not have been tested as ## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes ## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features. ## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review ## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team. ## or updates from the Ubuntu security team.
# deb $LB_PARENT_MIRROR_BINARY $codename-backports $alldists deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $codename-backports $alldists # deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
EOF
cat >> $file <<EOF ## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
# deb-src http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
deb $LB_PARENT_MIRROR_BINARY $codename-security $dists deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
deb-src $LB_PARENT_MIRROR_BINARY $codename-security $dists # deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
EOF deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
# Security sources for Ubuntu universe; not used much, but e.g. unsupported deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
# binary packages from a supported source package will end up here. # deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
if [ "$UNIVERSE" = true ]; then
COMMENT=
else
COMMENT='# '
fi
cat >> $file <<EOF
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security universe
EOF
# Security sources for Ubuntu multiverse, with the same caveats as for
# universe.
if [ "$MULTIVERSE" = true ]; then
COMMENT=
else
COMMENT='# '
fi
cat >> $file <<EOF
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security multiverse
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security multiverse
EOF EOF
fi fi
@ -238,7 +284,7 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
> chroot/etc/apt/sources.list > chroot/etc/apt/sources.list
rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig
fi fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
if [ "$ARCH" = "armhf" ]; then if [ "$ARCH" = "armhf" ]; then
INFO_DESC="$(lsb_release -d -s)" INFO_DESC="$(lsb_release -d -s)"
echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info
@ -251,16 +297,6 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
build_name: server build_name: server
serial: $BUILDSTAMP serial: $BUILDSTAMP
EOF EOF
cat > chroot/etc/apt/sources.list << EOF
deb ${LB_PARENT_MIRROR_BINARY} ${LB_DISTRIBUTION} main restricted universe multiverse
deb ${LB_PARENT_MIRROR_BINARY} ${LB_DISTRIBUTION}-updates main restricted universe multiverse
deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-security main restricted universe multiverse
EOF
lb chroot_hosts install
lb chroot_resolv install
Chroot chroot "apt-get update"
lb chroot_resolv remove
lb chroot_hosts remove
fi fi
echo "===== Checking size of /usr/share/doc =====" echo "===== Checking size of /usr/share/doc ====="
@ -319,7 +355,7 @@ elif [ -e binary-tar.tar.gz ]; then
cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz" cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz"
fi fi
if [ "$PROJECT:$SUBPROJECT" = "ubuntu-core:system-image" ]; then if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then
if [ -e "binary/$INITFS/filesystem.dir" ]; then if [ -e "binary/$INITFS/filesystem.dir" ]; then
rootfs="binary/$INITFS/filesystem.dir" rootfs="binary/$INITFS/filesystem.dir"
@ -345,7 +381,7 @@ EOF
fi fi
fi fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
(cd "binary/$INITFS/custom.dir/" && tar -c *) | \ (cd "binary/$INITFS/custom.dir/" && tar -c *) | \
gzip -9 --rsyncable > "$PREFIX.custom.tar.gz" gzip -9 --rsyncable > "$PREFIX.custom.tar.gz"
chmod 644 "$PREFIX.custom.tar.gz" chmod 644 "$PREFIX.custom.tar.gz"
@ -367,7 +403,7 @@ fi
# ubuntu-core and ubuntu-desktop-next splits kernel stuff into a "device" tarball so # ubuntu-core and ubuntu-desktop-next splits kernel stuff into a "device" tarball so
# at this point we reset it to "none" as all the work to extract it was done already # at this point we reset it to "none" as all the work to extract it was done already
# in a binary hook # in a binary hook
case $PROJECT:$SUBPROJECT in case $PROJECT:${SUBPROJECT:-} in
ubuntu-core:system-image|ubuntu-desktop-next:system-image) ubuntu-core:system-image|ubuntu-desktop-next:system-image)
# create device tarball (for snappy only atm) # create device tarball (for snappy only atm)
@ -602,6 +638,7 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do
if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then
continue continue
fi fi
FLAVOUR=${FLAVOUR%%-hwe-*}
if [ "$FLAVOUR" = "virtual" ]; then if [ "$FLAVOUR" = "virtual" ]; then
# The virtual kernel is named generic in /boot # The virtual kernel is named generic in /boot
FLAVOUR="generic" FLAVOUR="generic"
@ -635,17 +672,18 @@ done
NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"
if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then
# only one kernel flavour # only one kernel flavour
FLAVOUR=${LB_LINUX_FLAVOURS%%-hwe-*}
if [ -e "binary/$INITFS/vmlinuz" ]; then if [ -e "binary/$INITFS/vmlinuz" ]; then
ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"
chmod 644 "$PREFIX.kernel" chmod 644 "$PREFIX.kernel"
else else
ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" ln -sf "$PREFIX.kernel-$FLAVOUR" "$PREFIX.kernel"
fi fi
if [ -e "binary/$INITFS/initrd.lz" ]; then if [ -e "binary/$INITFS/initrd.lz" ]; then
ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"
chmod 644 "$PREFIX.initrd" chmod 644 "$PREFIX.initrd"
else else
ln -sf "$PREFIX.initrd-$LB_LINUX_FLAVOURS" "$PREFIX.initrd" ln -sf "$PREFIX.initrd-$FLAVOUR" "$PREFIX.initrd"
fi fi
fi fi
@ -689,7 +727,7 @@ if [ "$SUBARCH" = "ac100" ] || [ "$SUBARCH" = "nexus7" ]; then
fi fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
sourceslist="chroot/etc/apt/sources.list" sourceslist="chroot/etc/apt/sources.list"
lb chroot_proc install "$@" lb chroot_proc install "$@"

View File

@ -58,9 +58,15 @@ add_task ()
# failure. # failure.
for task; do for task; do
if [ -z "$HWE_BUILD" ]; then
# We need a ridiculous number of backslashes to protect # We need a ridiculous number of backslashes to protect
# parentheses from eval. # parentheses from eval.
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" 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"
else
# If HWE_BUILD is set, we strip out drivers not available
# in the HWE stack, then sed the rest with their HWE suffixes
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"
fi
done done
} }
@ -111,7 +117,7 @@ case $IMAGEFORMAT in
ext2|ext3|ext4) ext2|ext3|ext4)
OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT" OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT"
PREINSTALLED=true PREINSTALLED=true
case $SUBPROJECT in case ${SUBPROJECT:-} in
wubi) wubi)
add_package install lupin-support add_package install lupin-support
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
@ -135,7 +141,7 @@ case $IMAGEFORMAT in
*) *)
case $PROJECT in case $PROJECT in
ubuntu-server|ubuntu-touch|ubuntu-pd) ubuntu-server|ubuntu-touch|ubuntu-touch-custom)
;; ;;
*) *)
add_package live lupin-casper add_package live lupin-casper
@ -168,7 +174,7 @@ if [ "$PREINSTALLED" = "true" ] && [ "$SUBPROJECT" != "wubi" ]; then
ubuntu-server) ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf add_package live oem-config-debconf ubiquity-frontend-debconf
;; ;;
ubuntu-core|base|ubuntu-touch|ubuntu-pd|ubuntu-cpc|ubuntu-desktop-next) ubuntu-core|ubuntu-base|base|ubuntu-touch|ubuntu-touch-custom|ubuntu-cpc|ubuntu-desktop-next)
;; ;;
*) *)
add_package live oem-config-gtk ubiquity-frontend-gtk add_package live oem-config-gtk ubiquity-frontend-gtk
@ -186,16 +192,24 @@ case $BINARYFORMAT in
;; ;;
esac esac
SIGNED_KERNEL_PACKAGE="linux-signed-generic" HWE_X_PACKAGES="xserver-xorg-hwe-16.04 xserver-xorg-video-all-hwe-16.04 xserver-xorg-input-all-hwe-16.04"
UNITY_HWE_HINTS="unity-settings-daemon notify-osd libqt4-sql-sqlite unity gnome-terminal" HWE_KERNEL_FLAVOUR="generic-hwe-16.04"
HWE_SIGNED_KERNEL_PACKAGE="linux-signed-$HWE_KERNEL_FLAVOUR"
if [ "${SUBPROJECT:-}" = minimized ]; then
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal --linux-packages=linux-image"
fi
case $PROJECT in case $PROJECT in
ubuntu|ubuntu-dvd) ubuntu|ubuntu-dvd)
add_package install ubuntu-minimal ubuntu-standard HWE_BUILD="yes"
add_package install ubuntu-desktop $UNITY_HWE_HINTS add_task install minimal standard ubuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-live' LIVE_TASK='ubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
;; ;;
@ -213,17 +227,21 @@ case $PROJECT in
# CDIMAGE_PREINSTALLED is not passed from build.py # CDIMAGE_PREINSTALLED is not passed from build.py
# and PREINSTALLED means something different. So # and PREINSTALLED means something different. So
# we use SUBPROJECT to pass on the information # we use SUBPROJECT to pass on the information
if [ "$SUBPROJECT" = "system-image" ]; then if [ "${SUBPROJECT:-}" = "system-image" ]; then
OPTS="${OPTS:+$OPTS }--linux-packages=linux-image" OPTS="${OPTS:+$OPTS }--linux-packages=linux-image"
fi fi
;; ;;
kubuntu|kubuntu-dvd) kubuntu|kubuntu-dvd)
HWE_BUILD="yes"
add_task install minimal standard add_task install minimal standard
add_task install kubuntu-desktop add_task install kubuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='kubuntu-live' LIVE_TASK='kubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe' COMPONENTS='main restricted universe'
add_chroot_hook remove-gnome-icon-cache add_chroot_hook remove-gnome-icon-cache
@ -258,16 +276,17 @@ case $PROJECT in
;; ;;
xubuntu) xubuntu)
HWE_BUILD="yes"
add_task install minimal standard xubuntu-desktop add_task install minimal standard xubuntu-desktop
add_package install $HWE_X_PACKAGES
add_package install xterm add_package install xterm
LIVE_TASK='xubuntu-live' LIVE_TASK='xubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
;; ;;
ubuntu-netbook) ubuntu-netbook)
@ -276,44 +295,62 @@ case $PROJECT in
;; ;;
mythbuntu) mythbuntu)
HWE_BUILD="yes"
add_task install minimal standard mythbuntu-desktop add_task install minimal standard mythbuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='mythbuntu-live' LIVE_TASK='mythbuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
;; ;;
lubuntu) lubuntu)
HWE_BUILD="yes"
add_task install minimal standard lubuntu-desktop add_task install minimal standard lubuntu-desktop
LIVE_TASK='lubuntu-live'
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64|i386) add_package install thermald ;;
esac
add_package install $HWE_X_PACKAGES
LIVE_TASK='lubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
# The Lubuntu STRUCTURE file has "feature # The Lubuntu STRUCTURE file has "feature
# no-follow-recommends". Mirror this. # no-follow-recommends". Mirror this.
export APT_OPTIONS="--yes --no-install-recommends" export APT_OPTIONS="--yes --no-install-recommends"
;; ;;
ubuntu-gnome) ubuntu-gnome)
HWE_BUILD="yes"
add_task install minimal standard ubuntu-gnome-desktop add_task install minimal standard ubuntu-gnome-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-gnome-live' LIVE_TASK='ubuntu-gnome-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe' COMPONENTS='main restricted universe'
;; ;;
ubuntu-mate) ubuntu-mate)
HWE_BUILD="yes"
add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop
LIVE_TASK='ubuntu-mate-live'
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64|i386) add_package install thermald ;;
esac
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-mate-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
# The Ubuntu MATE STRUCTURE file has "feature # The Ubuntu MATE STRUCTURE file has "feature
@ -322,19 +359,25 @@ case $PROJECT in
;; ;;
ubuntustudio-dvd) ubuntustudio-dvd)
HWE_BUILD="yes"
add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography
add_package install $HWE_X_PACKAGES linux-generic-hwe-16.04-
COMPONENTS='main restricted universe multiverse' COMPONENTS='main restricted universe multiverse'
case $ARCH in case $ARCH in
amd64|i386) KERNEL_FLAVOURS=lowlatency ;; amd64|i386) KERNEL_FLAVOURS=lowlatency-hwe-16.04 ;;
esac esac
;; ;;
ubuntukylin) ubuntukylin)
HWE_BUILD="yes"
add_task install minimal standard ubuntukylin-desktop add_task install minimal standard ubuntukylin-desktop
add_package install $HWE_X_PACKAGES
add_package install ubuntukylin-default-settings add_package install ubuntukylin-default-settings
LIVE_TASK='ubuntukylin-live' LIVE_TASK='ubuntukylin-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in case $ARCH in
amd64) add_package live linux-signed-generic ;; amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac esac
COMPONENTS='main restricted universe' COMPONENTS='main restricted universe'
;; ;;
@ -413,13 +456,18 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;; ;;
ubuntu-touch|ubuntu-pd) ubuntu-base)
if [ "$PROJECT" = "ubuntu-touch" ]; then OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
meta_package=ubuntu-touch ;;
else
meta_package=ubuntu-pocket-desktop ubuntu-touch|ubuntu-touch-custom)
fi HINTS="packagekit ubuntu-system-settings-online-accounts"
add_package install ubuntu-minimal $meta_package systemd-sysv- packagekit ubuntu-system-settings-online-accounts case $ARCH in
amd64|i386)
HINTS="$HINTS qml-module-ubuntu-components-gles unity8"
;;
esac
add_package install ubuntu-minimal ubuntu-touch $HINTS
COMPONENTS='main restricted universe' COMPONENTS='main restricted universe'
BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu' BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu'
@ -433,7 +481,7 @@ case $PROJECT in
# SUBPROJECT, but it's a handy thing that launchpad-buildd # SUBPROJECT, but it's a handy thing that launchpad-buildd
# already passes through to us that we weren't otherwise # already passes through to us that we weren't otherwise
# using here. # using here.
case $SUBPROJECT in case ${SUBPROJECT:-} in
ubuntu-rtm/dogfood) ubuntu-rtm/dogfood)
MIRROR=http://derived-archive.dogfood.content.paddev.net/ubuntu-rtm/ MIRROR=http://derived-archive.dogfood.content.paddev.net/ubuntu-rtm/
OPTS="${OPTS:+$OPTS }--apt-secure false" OPTS="${OPTS:+$OPTS }--apt-secure false"
@ -451,12 +499,31 @@ case $PROJECT in
;; ;;
ubuntu-cpc) ubuntu-cpc)
add_task install minimal standard cloud-image if [ "${SUBPROJECT:-}" = minimized ]; then
add_package install ubuntu-minimal add_task install cloud-image
add_package install sudo
# linux-kvm currently only exists in xenial, not in
# non-LTS suites. Fall back to virtual flavor, which
# may or may not boot initramfsless but enables us to
# test building and possibly build derivative images
# using other kernel flavors.
# If you enable an extra ppa, it is assumed that
# linux-kvm is available since you control the
# archive and can provide this metapackage as
# necessary.
if [ -z "$EXTRA_PPAS" ] && [ "$SUITE" != xenial ]; then
KERNEL_FLAVOURS=virtual
else
KERNEL_FLAVOURS=kvm
fi
else
add_task install minimal standard cloud-image
add_package install ubuntu-minimal
KERNEL_FLAVOURS=virtual
fi
BINARY_REMOVE_LINUX=false BINARY_REMOVE_LINUX=false
OPTS="${OPTS:+$OPTS }--initramfs=none" OPTS="${OPTS:+$OPTS }--initramfs=none"
KERNEL_FLAVOURS=virtual
case $ARCH in case $ARCH in
armhf) armhf)
KERNEL_FLAVOURS=generic-lpae KERNEL_FLAVOURS=generic-lpae
@ -557,7 +624,7 @@ case $ARCH in
esac esac
case $PROJECT in case $PROJECT in
ubuntu-server|ubuntu-core|ubuntu-touch|ubuntu-pd) ubuntu-server|ubuntu-core|ubuntu-base|ubuntu-touch|ubuntu-touch-custom)
case $SUBPROJECT in case $SUBPROJECT in
system-image) system-image)
# keep the kernel for the system-image build # keep the kernel for the system-image build
@ -586,7 +653,7 @@ case $PROJECT in
;; ;;
esac esac
case $SUBPROJECT in case ${SUBPROJECT:-} in
wubi) wubi)
add_binary_hook build-wubildr add_binary_hook build-wubildr
;; ;;
@ -612,8 +679,10 @@ lb config noauto \
"$@" "$@"
echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot
echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot
echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary
echo "BUILDSTAMP=\"$NOW\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary
echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary
case $ARCH+$SUBARCH in case $ARCH+$SUBARCH in
armhf+raspi2) armhf+raspi2)
@ -637,6 +706,7 @@ cat > /boot/firmware/config.txt << EOM
# Some settings may impact device functionality. See link above for details # Some settings may impact device functionality. See link above for details
kernel=uboot.bin kernel=uboot.bin
device_tree_address=0x02000000
# enable i2c # enable i2c
dtparam=i2c_arm=on dtparam=i2c_arm=on
@ -727,7 +797,7 @@ EOF
config/archives/proposed.list.binary config/archives/proposed.list.binary
fi fi
case $PROJECT:$SUBPROJECT in case $PROJECT:${SUBPROJECT:-} in
*-dvd:*) *-dvd:*)
. config/bootstrap . config/bootstrap
@ -743,7 +813,7 @@ EOF
fi fi
;; ;;
ubuntu-touch:*|ubuntu-pd:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*) ubuntu-touch:*|ubuntu-touch-custom:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*)
cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \ cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
config/ config/
;; ;;
@ -813,7 +883,7 @@ EOF
fi fi
fi fi
case $SUBPROJECT in case ${SUBPROJECT:-} in
ubuntu-rtm|ubuntu-rtm/*) ubuntu-rtm|ubuntu-rtm/*)
# debootstrap doesn't know about ubuntu-rtm series directly. Rather # debootstrap doesn't know about ubuntu-rtm series directly. Rather
# than having to teach it, we employ a few hacks to make it use the # than having to teach it, we employ a few hacks to make it use the

View File

@ -11,9 +11,22 @@ backing_img=
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
clean_loops() { clean_loops() {
local kpartx_ret
local kpartx_stdout
if [ -n "${backing_img}" ]; then if [ -n "${backing_img}" ]; then
kpartx -v -d "${backing_img}" # sync before removing loop to avoid "Device or resource busy" errors
sync
kpartx_ret=""
kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$?
echo "$kpartx_stdout"
if [ -n "$kpartx_ret" ]; then
if echo "$kpartx_stdout" | grep -q "loop deleted"; then
echo "Suppressing kpartx returning error (#860894)"
else
exit $kpartx_ret
fi
fi
unset backing_img unset backing_img
fi fi
@ -69,16 +82,32 @@ mount_image() {
setup_mountpoint() { setup_mountpoint() {
local mountpoint="$1" local mountpoint="$1"
mount --bind /dev "$mountpoint/dev" mount --rbind --make-rslave /dev "$mountpoint/dev"
mount devpts-live -t proc "$mountpoint/dev/pts"
mount proc-live -t proc "$mountpoint/proc" mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys" mount sysfs-live -t sysfs "$mountpoint/sys"
mount -t tmpfs none "$mountpoint/tmp" mount -t tmpfs none "$mountpoint/tmp"
mount -t tmpfs none "$mountpoint/var/lib/apt"
mount -t tmpfs none "$mountpoint/var/cache/apt"
mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf" cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
chroot "$mountpoint" apt-get update
} }
teardown_mountpoint() {
# Reverse the operations from setup_mountpoint
local mountpoint="$1"
# ensure we have exactly one trailing slash, and escape all slashes for awk
mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')'\/'
# sort -r ensures that deeper mountpoints are unmounted first
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
{ print \$2 }" | LC_ALL=C sort -r); do
umount $submount
done
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
}
mount_partition() { mount_partition() {
partition="$1" partition="$1"
mountpoint="$2" mountpoint="$2"
@ -111,21 +140,11 @@ EOF
} }
umount_settle() {
# Unmount device, and let it settle
umount $1
udevadm settle
sleep 3
}
umount_partition() { umount_partition() {
local mountpoint=${1} local mountpoint=${1}
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" teardown_mountpoint $mountpoint
for submnt in proc sys dev/pts dev tmp; umount -R $mountpoint
do udevadm settle
umount_settle $mountpoint/$submnt
done
umount_settle $mountpoint
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
# buildd's don't have /etc/mtab symlinked # buildd's don't have /etc/mtab symlinked
@ -249,4 +268,46 @@ convert_to_qcow2() {
qemu-img info "$destination" qemu-img info "$destination"
} }
replace_grub_root_with_label() {
# When update-grub is run, it will detect the disks in the build system.
# Instead, we want grub to use the cloudimg-rootfs labelled disk
CHROOT_ROOT="$1"
# If boot by partuuid has been requested, don't override.
if [ -f $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg ] && \
grep -q ^GRUB_FORCE_PARTUUID= $CHROOT_ROOT/etc/default/grub.d/40-force-partuuid.cfg
then
return 0
fi
sed -i -e "s,root=[^ ]*,root=LABEL=cloudimg-rootfs," \
"$CHROOT_ROOT/boot/grub/grub.cfg"
}
# When running update-grub in a chroot on a build host, we don't want it to
# probe for disks or probe for other installed OSes. Extract common
# diversion wrappers, so this isn't reinvented differently for each image.
divert_grub() {
CHROOT_ROOT="$1"
chroot "$CHROOT_ROOT" dpkg-divert --local \
--rename /usr/sbin/grub-probe
chroot "$CHROOT_ROOT" touch /usr/sbin/grub-probe
chroot "$CHROOT_ROOT" chmod +x /usr/sbin/grub-probe
chroot "$CHROOT_ROOT" dpkg-divert --local \
--divert /etc/grub.d/30_os-prober.dpkg-divert \
--rename /etc/grub.d/30_os-prober
}
undivert_grub() {
CHROOT_ROOT="$1"
chroot "$CHROOT_ROOT" rm /usr/sbin/grub-probe
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
--rename /usr/sbin/grub-probe
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
--divert /etc/grub.d/30_os-prober.dpkg-divert \
--rename /etc/grub.d/30_os-prober
}

View File

@ -5,7 +5,7 @@ if [ -n "$SUBARCH" ]; then
exit 0 exit 0
fi fi
. /build/config/functions . config/functions
mkdir binary/boot/filesystem.dir mkdir binary/boot/filesystem.dir
cp -a chroot/* binary/boot/filesystem.dir cp -a chroot/* binary/boot/filesystem.dir
@ -24,9 +24,4 @@ chroot binary/boot/filesystem.dir mkdir /lib/modules
chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf" teardown_mountpoint binary/boot/filesystem.dir
umount "binary/boot/filesystem.dir/proc"
umount "binary/boot/filesystem.dir/sys"
umount "binary/boot/filesystem.dir/dev/pts"
umount "binary/boot/filesystem.dir/dev"
umount "binary/boot/filesystem.dir/tmp"

View File

@ -1,6 +1,8 @@
#!/bin/bash -ex #!/bin/bash -ex
. /build/config/functions . config/functions
. config/binary
BOOTPART_START= BOOTPART_START=
BOOTPART_END= BOOTPART_END=
@ -64,6 +66,8 @@ create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 ext2 "$R
mount_image "${disk_image}" "$ROOTPART" mount_image "${disk_image}" "$ROOTPART"
partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper")
# Copy the chroot in to the disk # Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}" make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint mkdir mountpoint
@ -88,7 +92,7 @@ case $ARCH:$SUBARCH in
# not the best place for this, but neither flash-kernel nor # not the best place for this, but neither flash-kernel nor
# u-boot have provisions for installing u-boot via maintainer # u-boot have provisions for installing u-boot via maintainer
# script # script
/build/config/hooks/raspi2/mkknlimg --dtok \ config/hooks/raspi2/mkknlimg --dtok \
mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \ mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
mountpoint/boot/firmware/uboot.bin mountpoint/boot/firmware/uboot.bin
;; ;;
@ -111,6 +115,15 @@ if [ "${should_install_grub}" -eq 1 ]; then
${loop_device} ${loop_device}
rm mountpoint/tmp/device.map rm mountpoint/tmp/device.map
if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then
echo "partuuid found for root device; forcing it in Grub"
mkdir -p mountpoint/etc/default/grub.d
echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
divert_grub mountpoint
chroot mountpoint update-grub
undivert_grub mountpoint
fi
fi fi
if [ "$ARCH" = "s390x" ]; then if [ "$ARCH" = "s390x" ]; then

View File

@ -9,7 +9,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
@ -61,18 +61,30 @@ install_grub() {
efi_boot_dir="/boot/efi/EFI/BOOT" efi_boot_dir="/boot/efi/EFI/BOOT"
chroot mountpoint mkdir -p "${efi_boot_dir}" chroot mountpoint mkdir -p "${efi_boot_dir}"
if [ "${SUBPROJECT:-}" = minimized ] && [ -n "$partuuid" ]; then
# FIXME: code duplicated between 032-disk-image.binary
# and 033-disk-image-uefi.binary. We want to fix this to not
# have initramfs-tools installed at all on these images.
echo "partuuid found for root device; omitting initrd"
echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
fi
chroot mountpoint apt-get -y update
# The modules below only make sense on non-Secure Boot UEFI systems.
# Otherwise, with Secure Boot enabled GRUB will refuse to load them.
# Any modules already in debian/build-efi-images do not need to be listed.
# Furthermore, other modules such as terminal, video_* and efi_* are all
# already available.
case $ARCH in case $ARCH in
arm64) arm64)
chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin
grub_modules="part_gpt fat gzio ext2 normal chain boot configfile linux search_fs_uuid search_label terminal serial video video_fb efi_gop" grub_modules="serial"
efi_target=arm64-efi efi_target=arm64-efi
;; ;;
amd64) amd64)
chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed
grub_modules="part_gpt fat ext2 normal chain boot configfile linux multiboot search_fs_uuid search_label terminal serial video video_fb video_bochs usb usb_keyboard efi_gop efi_uga" grub_modules="multiboot serial usb usb_keyboard"
chroot mountpoint cp /usr/lib/shim/shim.efi.signed "${efi_boot_dir}/shimx64.efi"
chroot mountpoint cp /usr/lib/shim/MokManager.efi.signed "${efi_boot_dir}/MokManager.efi"
chroot mountpoint cp /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed "${efi_boot_dir}/grubx64.efi"
efi_target=x86_64-efi efi_target=x86_64-efi
;; ;;
esac esac
@ -80,8 +92,9 @@ install_grub() {
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
${CLOUD_IMG_STR} ${CLOUD_IMG_STR}
# For Cloud Image compatability # For Cloud Image compatability
GRUB_PRELOAD_MODULES="${grub_modules}" GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
EOF EOF
chroot mountpoint grub-install "${loop_device}" \ chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \ --boot-directory=/boot \
--efi-directory=/boot/efi \ --efi-directory=/boot/efi \
@ -106,19 +119,16 @@ EOF
chroot mountpoint grub-install --target=i386-pc "${loop_device}" chroot mountpoint grub-install --target=i386-pc "${loop_device}"
fi fi
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober divert_grub mountpoint
chroot mountpoint update-grub chroot mountpoint update-grub
sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober undivert_grub mountpoint
chroot mountpoint apt-get -y clean chroot mountpoint apt-get -y clean
chroot mountpoint apt-get -y update
rm mountpoint/tmp/device.map rm mountpoint/tmp/device.map
sync
umount mountpoint/boot/efi umount mountpoint/boot/efi
sleep 5 apt-get install -qqy udev
udevadm settle
mount mount
umount_partition mountpoint umount_partition mountpoint
rmdir mountpoint rmdir mountpoint
@ -130,6 +140,8 @@ create_empty_disk_image "${disk_image}"
create_partitions "${disk_image}" create_partitions "${disk_image}"
mount_image "${disk_image}" 1 mount_image "${disk_image}" 1
partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper")
# Copy the chroot in to the disk # Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}" make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint mkdir mountpoint

View File

@ -7,7 +7,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
create_partitions() { create_partitions() {
disk_image="$1" disk_image="$1"
@ -26,6 +26,7 @@ install_grub() {
mkdir mountpoint mkdir mountpoint
mount_partition "${rootfs_dev_mapper}" mountpoint mount_partition "${rootfs_dev_mapper}" mountpoint
chroot mountpoint apt-get -qqy update
chroot mountpoint apt-get -qqy install grub2 chroot mountpoint apt-get -qqy install grub2
chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
@ -49,10 +50,10 @@ EOF
--boot-directory=/boot \ --boot-directory=/boot \
--target=powerpc-ieee1275 --target=powerpc-ieee1275
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober divert_grub mountpoint
chroot mountpoint update-grub chroot mountpoint update-grub
sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober undivert_grub mountpoint
umount_partition mountpoint umount_partition mountpoint
rmdir mountpoint rmdir mountpoint

View File

@ -12,7 +12,7 @@ esac
apt-get install -qqy qemu-utils apt-get install -qqy qemu-utils
. /build/config/functions . config/functions
if [ -f binary/boot/disk.ext4 ]; then if [ -f binary/boot/disk.ext4 ]; then
convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img

View File

@ -11,7 +11,7 @@ case $ARCH in
exit 0;; exit 0;;
esac esac
. /build/config/functions . config/functions
if [ -e binary/boot/disk.ext4 ]; then if [ -e binary/boot/disk.ext4 ]; then
create_vmdk binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.vmdk create_vmdk binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.vmdk

View File

@ -9,11 +9,24 @@
# #
# For this step, we re-use the VMDK's made in 040-vmdk-image.binary # For this step, we re-use the VMDK's made in 040-vmdk-image.binary
# Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in case $ARCH in
amd64|i386) ;; amd64)
*) echo "OVA images are not supported for $ARCH yet."; ovf_id=94
exit 0;; ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "OVA images are not supported for $ARCH yet.";
exit 0;;
esac esac
cur_d=${PWD} cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0})) my_d=$(dirname $(readlink -f ${0}))
@ -57,7 +70,10 @@ sed -i "${ovf}" \
-e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \ -e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" -e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
# Get the checksums # Get the checksums
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1) vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
@ -67,7 +83,7 @@ ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
manifest="${scratch_d}/${prefix}.mf" manifest="${scratch_d}/${prefix}.mf"
cat > "${manifest}" <<EOF cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256} SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256} SHA256(${ovf##*/})= ${ovf_sha256}
EOF EOF
# Now create the OVA # Now create the OVA

View File

@ -1,35 +1,41 @@
#!/bin/bash -eux #!/bin/bash -ex
# vi: ts=4 noexpandtab # vi: ts=4 noexpandtab
# #
# Generate a generic Vagrant Box. # Generate a generic Vagrant Box.
# #
# Vagrant images are essentially nothing more than OVA's with extra-metadata. # Vagrant images are essentially nothing more than OVA's with extra-metadata
# and some preinstalled packages.
# #
# We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the instance. # We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the
# This build step creates a cloud-config ISO so that Cloud-Init will configure # instance. This build step creates a cloud-config ISO so that Cloud-Init
# the initial user, creates meta-data that tells Vagrant how to interact with # will configure the initial user, creates meta-data that tells Vagrant how
# the cloud-init created users, and finally create the OVA. # to interact with the cloud-init created users, and finally create the OVA.
# #
# For this step, we re-use the VMDK's made in 040-vmdk-image.binary # For this step, we make a deriviative of binary/boot/disk.ext4 and install
# some packages in it, convert it to a vmdk, and then assemble the vagrant
# box.
cur_d=${PWD} cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0})) my_d=$(dirname $(readlink -f ${0}))
base_vmdk="livecd.ubuntu-cpc.disk1.vmdk" # Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in case $ARCH in
amd64|i386) ;; amd64)
*) ovf_id=94
echo "Vagrant images are not supported for $ARCH" ovf_os_type="ubuntu64Guest"
exit 0 ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "Vagrant images are not supported for $ARCH yet."
exit 0;;
esac esac
if [ ! -e ${base_vmdk} ]; then . config/functions
echo "Did not find VMDK to produce Vagrant images."
exit 0
fi
. /build/config/functions
# Virtualbox is needed for making a small VMDK # Virtualbox is needed for making a small VMDK
apt-get -qqy install genisoimage qemu-utils apt-get -qqy install genisoimage qemu-utils
@ -37,7 +43,26 @@ apt-get -qqy install genisoimage qemu-utils
# Lets be safe about this # Lets be safe about this
box_d=$(mktemp -d) box_d=$(mktemp -d)
seed_d=$(mktemp -d) seed_d=$(mktemp -d)
trap "rm -rf ${box_d} ${seed_d}" EXIT mount_d=$(mktemp -d)
create_derivative "disk" "vagrant" #sets ${derivative_img}
mount_disk_image ${derivative_img} ${mount_d}
cleanup_vagrant() {
if [ -d "$mount_d" ]; then
umount_disk_image "$mount_d"
fi
rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
}
trap cleanup_vagrant EXIT
chroot ${mount_d} apt-get update
# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to
# avoid pulling into a cloud image.
chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
chroot ${mount_d} apt-get clean
umount_disk_image "$mount_d"
rmdir "$mount_d"
# Used to identify bits # Used to identify bits
suite=$(chroot chroot lsb_release -c -s) suite=$(chroot chroot lsb_release -c -s)
@ -47,7 +72,7 @@ distro=$(chroot chroot lsb_release --id --short | tr [:upper:] [:lower:])
# Get the VMDK in place # Get the VMDK in place
prefix="${distro}-${suite}-${version}-cloudimg" prefix="${distro}-${suite}-${version}-cloudimg"
vmdk_f="${box_d}/${prefix}.vmdk" vmdk_f="${box_d}/${prefix}.vmdk"
cp ${base_vmdk} ${vmdk_f} create_vmdk ${derivative_img} ${vmdk_f}
# Vagrant needs a base user. We either inject the well-known SSH key # Vagrant needs a base user. We either inject the well-known SSH key
# or use password authentication. Both are ugly. So we'll use a password # or use password authentication. Both are ugly. So we'll use a password
@ -70,6 +95,7 @@ cat > ${seed_d}/user-data <<END
password: ${ubuntu_user_pass} password: ${ubuntu_user_pass}
chpasswd: { expire: False } chpasswd: { expire: False }
ssh_pwauth: True ssh_pwauth: True
manage_etc_hosts: localhost
END END
# Create the fake meta-data # Create the fake meta-data
@ -111,15 +137,11 @@ Vagrant.configure("2") do |config|
config.vm.base_mac = "${macaddr}" config.vm.base_mac = "${macaddr}"
config.ssh.username = "ubuntu" config.ssh.username = "ubuntu"
config.ssh.password = "${ubuntu_user_pass}" config.ssh.password = "${ubuntu_user_pass}"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provider "virtualbox" do |vb| config.vm.provider "virtualbox" do |vb|
vb.name = "${prefix}"
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ] vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "%s-console.log" % vb.name) ] vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
end end
end end
EOF EOF
@ -151,16 +173,19 @@ cp ${my_d}/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl ${ovf}
serial_stamp=$(date +%Y%m%d) serial_stamp=$(date +%Y%m%d)
sed -i "${ovf}" \ sed -i "${ovf}" \
-e "s/@@NAME@@/${prefix}-${serial_stamp}/g" \ -e "s/@@NAME@@/${prefix}-${serial_stamp}/g" \
-e "s/@@FILENAME1@@/${vmdk_f##*/}/g" \ -e "s/@@FILENAME1@@/${vmdk_f##*/}/g" \
-e "s/@@VMDK_FILE_SIZE@@/${vmdk_size}/g" \ -e "s/@@VMDK_FILE_SIZE@@/${vmdk_size}/g" \
-e "s/@@VMDK_CAPACITY@@/${vmdk_capacity}/g" \ -e "s/@@VMDK_CAPACITY@@/${vmdk_capacity}/g" \
-e "s/@@FILENAME2@@/${cdrom_vmdk_f##*/}/g" \ -e "s/@@FILENAME2@@/${cdrom_vmdk_f##*/}/g" \
-e "s/@@VMDK_FILE_SIZE2@@/${cdrom_size}/g" \ -e "s/@@VMDK_FILE_SIZE2@@/${cdrom_size}/g" \
-e "s/@@VMDK_CAPACITY2@@/${cdrom_capacity}/g" \ -e "s/@@VMDK_CAPACITY2@@/${cdrom_capacity}/g" \
-e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \ -e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" -e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1) ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
@ -169,7 +194,7 @@ manifest="${box_d}/${prefix}.mf"
cat > "${manifest}" <<EOF cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256} SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256} SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256} SHA256(${ovf##*/})= ${ovf_sha256}
EOF EOF
# Now create the box # Now create the box
@ -181,16 +206,16 @@ OVA information:
VMDK Name: ${vmdk_f##*/} VMDK Name: ${vmdk_f##*/}
VMDK Capacity: ${vmdk_capacity} VMDK Capacity: ${vmdk_capacity}
VMDK SHA256: ${vmdk_sha256} VMDK SHA256: ${vmdk_sha256}
CDROM Name: ${cdrom_vmdk_f##*/} CDROM Name: ${cdrom_vmdk_f##*/}
CDROM Capacity: ${cdrom_capacity} CDROM Capacity: ${cdrom_capacity}
CDROM SHA256: ${cdrom_sha256} CDROM SHA256: ${cdrom_sha256}
EOM EOM
tar -C ${box_d} \ tar -C ${box_d} \
-cf ${cur_d}/livecd.ubuntu-cpc.vagrant.box \ -cf ${cur_d}/livecd.ubuntu-cpc.vagrant.box \
box.ovf \ box.ovf \
Vagrantfile \ Vagrantfile \
metadata.json \ metadata.json \
${prefix}.mf \ ${prefix}.mf \
${vmdk_f##*/} \ ${vmdk_f##*/} \
${cdrom_vmdk_f##*/} ${cdrom_vmdk_f##*/}

View File

@ -0,0 +1,9 @@
#!/bin/bash
#
# Set InitiatorName to be runtime generated when iscsid first starts, so
# that each cloud image gets a unique value
#
if [ -f /etc/iscsi/initiatorname.iscsi ]; then
echo "GenerateName=yes" > /etc/iscsi/initiatorname.iscsi
fi

View File

@ -3,6 +3,8 @@ rootd="${1:-/}"
root_fs_label=cloudimg-rootfs root_fs_label=cloudimg-rootfs
set -ex set -ex
. /root/config/chroot
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
LANG=C LANG=C
@ -87,7 +89,9 @@ _xchroot "${rootd}" sh -c 'sed -i "/^127.0.1.1/d" /etc/hosts'
_xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*' _xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*'
## -------------- ## --------------
_xchroot "${rootd}" locale-gen en_US.utf8 if [ "${SUBPROJECT:-}" != minimized ]; then
_xchroot "${rootd}" locale-gen en_US.utf8
fi
## -------------- ## --------------
# set cloud-init to be on # set cloud-init to be on

View File

@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then
fi fi
# Export the common functions to the extras # Export the common functions to the extras
. /build/config/functions . config/functions
# Cleaner execution # Cleaner execution
/bin/run-parts --regex ".*\.binary" "${extra_d}" /bin/run-parts --exit-on-error --regex ".*\.binary" "${extra_d}"

View File

@ -18,8 +18,9 @@
<VirtualSystem ovf:id="@@NAME@@"> <VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info> <Info>A virtual machine</Info>
<Name>@@NAME@@</Name> <Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest"> <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info> <Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection> </OperatingSystemSection>
<ProductSection ovf:required="false"> <ProductSection ovf:required="false">

View File

@ -16,8 +16,9 @@
<VirtualSystem ovf:id="@@NAME@@"> <VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info> <Info>A virtual machine</Info>
<Name>@@NAME@@</Name> <Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest"> <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info> <Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection> </OperatingSystemSection>
<ProductSection ovf:required="false"> <ProductSection ovf:required="false">

View File

@ -53,6 +53,7 @@ systemd-network:x:112:117:systemd Network Management,,,:/run/systemd/netif:/bin/
systemd-resolve:x:113:118:systemd Resolver,,,:/run/systemd/resolve:/bin/false systemd-resolve:x:113:118:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:114:119:systemd Bus Proxy,,,:/run/systemd:/bin/false systemd-bus-proxy:x:114:119:systemd Bus Proxy,,,:/run/systemd:/bin/false
nm-openvpn:x:115:120:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/bin/false nm-openvpn:x:115:120:NetworkManager OpenVPN,,,:/var/lib/openvpn/chroot:/bin/false
dhcpd:x:116:122::/var/run:/bin/false
EOF EOF
else else
echo "/etc/passwd post-debootstrap hash doesn't match record" >&2 echo "/etc/passwd post-debootstrap hash doesn't match record" >&2
@ -101,6 +102,7 @@ systemd-network:*:16372:0:99999:7:::
systemd-resolve:*:16372:0:99999:7::: systemd-resolve:*:16372:0:99999:7:::
systemd-bus-proxy:*:16372:0:99999:7::: systemd-bus-proxy:*:16372:0:99999:7:::
nm-openvpn:*:16909:0:99999:7::: nm-openvpn:*:16909:0:99999:7:::
dhcpd:*:16925:0:99999:7:::
EOF EOF
else else
echo "/etc/shadow post-debootstrap hash doesn't match record" >&2 echo "/etc/shadow post-debootstrap hash doesn't match record" >&2
@ -186,6 +188,7 @@ systemd-resolve:x:118:
systemd-bus-proxy:x:119: systemd-bus-proxy:x:119:
input:x:121: input:x:121:
nm-openvpn:x:120: nm-openvpn:x:120:
dhcpd:x:122:
EOF EOF
else else
echo "/etc/group post-debootstrap hash doesn't match record" >&2 echo "/etc/group post-debootstrap hash doesn't match record" >&2
@ -271,6 +274,7 @@ systemd-resolve:!::
systemd-bus-proxy:!:: systemd-bus-proxy:!::
input:!:: input:!::
nm-openvpn:!:: nm-openvpn:!::
dhcpd:!::
EOF EOF
else else
echo "/etc/gshadow post-debootstrap hash doesn't match record" >&2 echo "/etc/gshadow post-debootstrap hash doesn't match record" >&2

View File

@ -4,8 +4,19 @@ set -e
echo "Setting up click packages" echo "Setting up click packages"
CLICKARCH=$(dpkg --print-architecture)
click_uri=http://archive-team.internal/click_packages click_uri=http://archive-team.internal/click_packages
click_list=$click_uri/click_list if [ "$CLICKARCH" = "arm64" ]; then
# FIXME: this is temporary. Since right now we can't have arm64 clicks in the store
# (before implementing fat-packages), we need to fetch the arm64 click list from a
# different place
click_list=$click_uri/click_list.arm64
click_install_flags="--allow-unauthenticated"
else
click_list=$click_uri/click_list
click_install_flags=""
fi
click_db=/usr/share/click/preinstalled click_db=/usr/share/click/preinstalled
click_db_custom=/custom/click click_db_custom=/custom/click
@ -20,8 +31,6 @@ tmpdir="$(mktemp -d)"
cleanup () { rm -rf "$tmpdir"; } cleanup () { rm -rf "$tmpdir"; }
trap cleanup EXIT trap cleanup EXIT
CLICKARCH=$(dpkg --print-architecture)
wget --no-verbose -O "$tmpdir/click_list" "$click_list" wget --no-verbose -O "$tmpdir/click_list" "$click_list"
for package in $(cat "$tmpdir/click_list") for package in $(cat "$tmpdir/click_list")
do do
@ -61,7 +70,7 @@ do
mv /etc/click/databases/10_core.conf \ mv /etc/click/databases/10_core.conf \
/etc/click/databases/10_core.conf.tmp /etc/click/databases/10_core.conf.tmp
fi fi
click install --force-missing-framework --root="$root" --all-users \ click install --force-missing-framework --root="$root" --all-users $click_install_flags \
"$tmpdir/$package" "$tmpdir/$package"
if [ "$root" = "$click_db_custom" ]; then if [ "$root" = "$click_db_custom" ]; then
mv /etc/click/databases/10_core.conf.tmp \ mv /etc/click/databases/10_core.conf.tmp \