Compare commits

...

56 Commits

Author SHA1 Message Date
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
21 changed files with 577 additions and 225 deletions

189
debian/changelog vendored
View File

@ -1,3 +1,192 @@
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
* drop linux-firmware-raspi2, it does not actually contain driver

2
debian/control vendored
View File

@ -4,7 +4,7 @@ Priority: optional
Build-Depends: debhelper (>= 7)
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
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
Architecture: any

3
debian/tests/control vendored Normal file
View File

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

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

@ -0,0 +1,97 @@
#!/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-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

View File

@ -58,116 +58,56 @@ EOF
# preinstalled being slightly different in what it doesn't ask) from
# debian-installer's apt-setup:
codename=$LB_DISTRIBUTION
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
cat > chroot/etc/apt/sources.list << EOF
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb $LB_PARENT_MIRROR_BINARY $codename $dists
deb-src $LB_PARENT_MIRROR_BINARY $codename $dists
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb $LB_PARENT_MIRROR_BINARY $codename-updates $dists
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates $dists
EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
# 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
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename universe
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-updates universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-updates universe
EOF
# Multiverse is different, don't write anything unless enabled.
if [ "$MULTIVERSE" = true ]; then
alldists="$alldists multiverse"
cat >> $file <<EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
## 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
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb $LB_PARENT_MIRROR_BINARY $codename multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename multiverse
deb $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
EOF
fi
cat >> $file <<EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
# deb-src $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
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-src $LB_PARENT_MIRROR_BINARY $codename-security $dists
EOF
# Security sources for Ubuntu universe; not used much, but e.g. unsupported
# binary packages from a supported source package will end up here.
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
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
EOF
fi
@ -238,7 +178,7 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
> chroot/etc/apt/sources.list
rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig
fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
if [ "$ARCH" = "armhf" ]; then
INFO_DESC="$(lsb_release -d -s)"
echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info
@ -251,16 +191,6 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
build_name: server
serial: $BUILDSTAMP
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
echo "===== Checking size of /usr/share/doc ====="
@ -345,7 +275,7 @@ EOF
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 *) | \
gzip -9 --rsyncable > "$PREFIX.custom.tar.gz"
chmod 644 "$PREFIX.custom.tar.gz"
@ -602,6 +532,7 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do
if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then
continue
fi
FLAVOUR=${FLAVOUR%%-hwe-*}
if [ "$FLAVOUR" = "virtual" ]; then
# The virtual kernel is named generic in /boot
FLAVOUR="generic"
@ -635,17 +566,18 @@ done
NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"
if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then
# only one kernel flavour
FLAVOUR=${LB_LINUX_FLAVOURS%%-hwe-*}
if [ -e "binary/$INITFS/vmlinuz" ]; then
ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"
chmod 644 "$PREFIX.kernel"
else
ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel"
ln -sf "$PREFIX.kernel-$FLAVOUR" "$PREFIX.kernel"
fi
if [ -e "binary/$INITFS/initrd.lz" ]; then
ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"
chmod 644 "$PREFIX.initrd"
else
ln -sf "$PREFIX.initrd-$LB_LINUX_FLAVOURS" "$PREFIX.initrd"
ln -sf "$PREFIX.initrd-$FLAVOUR" "$PREFIX.initrd"
fi
fi
@ -689,7 +621,7 @@ if [ "$SUBARCH" = "ac100" ] || [ "$SUBARCH" = "nexus7" ]; then
fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
sourceslist="chroot/etc/apt/sources.list"
lb chroot_proc install "$@"

View File

@ -58,9 +58,15 @@ add_task ()
# failure.
for task; do
if [ -z "$HWE_BUILD" ]; then
# We need a ridiculous number of backslashes to protect
# 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"
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
}
@ -135,7 +141,7 @@ case $IMAGEFORMAT in
*)
case $PROJECT in
ubuntu-server|ubuntu-touch|ubuntu-pd)
ubuntu-server|ubuntu-touch|ubuntu-touch-custom)
;;
*)
add_package live lupin-casper
@ -168,7 +174,7 @@ if [ "$PREINSTALLED" = "true" ] && [ "$SUBPROJECT" != "wubi" ]; then
ubuntu-server)
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
@ -186,16 +192,20 @@ case $BINARYFORMAT in
;;
esac
SIGNED_KERNEL_PACKAGE="linux-signed-generic"
UNITY_HWE_HINTS="unity-settings-daemon notify-osd libqt4-sql-sqlite unity gnome-terminal"
HWE_X_PACKAGES="xserver-xorg-hwe-16.04 xserver-xorg-video-all-hwe-16.04 xserver-xorg-input-all-hwe-16.04"
HWE_KERNEL_FLAVOUR="generic-hwe-16.04"
HWE_SIGNED_KERNEL_PACKAGE="linux-signed-$HWE_KERNEL_FLAVOUR"
case $PROJECT in
ubuntu|ubuntu-dvd)
add_package install ubuntu-minimal ubuntu-standard
add_package install ubuntu-desktop $UNITY_HWE_HINTS
HWE_BUILD="yes"
add_task install minimal standard ubuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
;;
@ -219,11 +229,15 @@ case $PROJECT in
;;
kubuntu|kubuntu-dvd)
HWE_BUILD="yes"
add_task install minimal standard
add_task install kubuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='kubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live linux-signed-generic ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
add_chroot_hook remove-gnome-icon-cache
@ -258,16 +272,17 @@ case $PROJECT in
;;
xubuntu)
HWE_BUILD="yes"
add_task install minimal standard xubuntu-desktop
add_package install $HWE_X_PACKAGES
add_package install xterm
LIVE_TASK='xubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live linux-signed-generic ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
;;
ubuntu-netbook)
@ -276,44 +291,62 @@ case $PROJECT in
;;
mythbuntu)
HWE_BUILD="yes"
add_task install minimal standard mythbuntu-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='mythbuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live linux-signed-generic ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe multiverse'
;;
lubuntu)
HWE_BUILD="yes"
add_task install minimal standard lubuntu-desktop
LIVE_TASK='lubuntu-live'
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
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
# The Lubuntu STRUCTURE file has "feature
# no-follow-recommends". Mirror this.
export APT_OPTIONS="--yes --no-install-recommends"
;;
ubuntu-gnome)
HWE_BUILD="yes"
add_task install minimal standard ubuntu-gnome-desktop
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-gnome-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live linux-signed-generic ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
;;
ubuntu-mate)
HWE_BUILD="yes"
add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop
LIVE_TASK='ubuntu-mate-live'
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
COMPONENTS='main restricted universe multiverse'
# The Ubuntu MATE STRUCTURE file has "feature
@ -322,19 +355,25 @@ case $PROJECT in
;;
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_package install $HWE_X_PACKAGES linux-generic-hwe-16.04-
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=lowlatency ;;
amd64|i386) KERNEL_FLAVOURS=lowlatency-hwe-16.04 ;;
esac
;;
ubuntukylin)
HWE_BUILD="yes"
add_task install minimal standard ubuntukylin-desktop
add_package install $HWE_X_PACKAGES
add_package install ubuntukylin-default-settings
LIVE_TASK='ubuntukylin-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
KERNEL_FLAVOURS="$HWE_KERNEL_FLAVOUR"
case $ARCH in
amd64) add_package live linux-signed-generic ;;
amd64) add_package live $HWE_SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
;;
@ -413,13 +452,18 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
ubuntu-touch|ubuntu-pd)
if [ "$PROJECT" = "ubuntu-touch" ]; then
meta_package=ubuntu-touch
else
meta_package=ubuntu-pocket-desktop
fi
add_package install ubuntu-minimal $meta_package systemd-sysv- packagekit ubuntu-system-settings-online-accounts
ubuntu-base)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
ubuntu-touch|ubuntu-touch-custom)
HINTS="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'
BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu'
@ -557,7 +601,7 @@ case $ARCH in
esac
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
system-image)
# keep the kernel for the system-image build
@ -637,6 +681,7 @@ cat > /boot/firmware/config.txt << EOM
# Some settings may impact device functionality. See link above for details
kernel=uboot.bin
device_tree_address=0x02000000
# enable i2c
dtparam=i2c_arm=on
@ -743,7 +788,7 @@ EOF
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}/* \
config/
;;

View File

@ -11,9 +11,22 @@ backing_img=
apt-get -qqy install dosfstools gdisk
clean_loops() {
local kpartx_ret
local kpartx_stdout
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
fi
@ -69,16 +82,35 @@ mount_image() {
setup_mountpoint() {
local mountpoint="$1"
mount --bind /dev "$mountpoint/dev"
mount devpts-live -t proc "$mountpoint/dev/pts"
mount --rbind /dev "$mountpoint/dev"
mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys"
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
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
chroot "$mountpoint" apt-get update
}
teardown_mountpoint() {
# Reverse the operations from setup_mountpoint
local mountpoint="$1"
umount "$mountpoint/var/cache/apt"
umount "$mountpoint/var/lib/apt"
umount "$mountpoint/tmp"
umount "$mountpoint/sys"
umount "$mountpoint/proc"
umount -R "$mountpoint/dev"
apt-get install -qqy udev
udevadm settle
sleep 3
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
}
mount_partition() {
partition="$1"
mountpoint="$2"
@ -111,21 +143,11 @@ EOF
}
umount_settle() {
# Unmount device, and let it settle
umount $1
udevadm settle
sleep 3
}
umount_partition() {
local mountpoint=${1}
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
for submnt in proc sys dev/pts dev tmp;
do
umount_settle $mountpoint/$submnt
done
umount_settle $mountpoint
teardown_mountpoint $mountpoint
umount -R $mountpoint
udevadm settle
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
# buildd's don't have /etc/mtab symlinked
@ -249,4 +271,11 @@ convert_to_qcow2() {
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"
sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
"$CHROOT_ROOT/boot/grub/grub.cfg"
}

View File

@ -5,7 +5,7 @@ if [ -n "$SUBARCH" ]; then
exit 0
fi
. /build/config/functions
. config/functions
mkdir 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 dpkg-divert --remove --local --rename /usr/sbin/grub-probe
mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf"
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"
teardown_mountpoint binary/boot/filesystem.dir

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex
. /build/config/functions
. config/functions
BOOTPART_START=
BOOTPART_END=
@ -88,7 +88,7 @@ case $ARCH:$SUBARCH in
# not the best place for this, but neither flash-kernel nor
# u-boot have provisions for installing u-boot via maintainer
# script
/build/config/hooks/raspi2/mkknlimg --dtok \
config/hooks/raspi2/mkknlimg --dtok \
mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
mountpoint/boot/firmware/uboot.bin
;;

View File

@ -9,7 +9,7 @@ case $ARCH in
;;
esac
. /build/config/functions
. config/functions
apt-get -qqy install dosfstools gdisk
@ -61,18 +61,22 @@ install_grub() {
efi_boot_dir="/boot/efi/EFI/BOOT"
chroot mountpoint mkdir -p "${efi_boot_dir}"
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
arm64)
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
;;
amd64)
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"
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"
grub_modules="multiboot serial usb usb_keyboard"
efi_target=x86_64-efi
;;
esac
@ -80,8 +84,9 @@ install_grub() {
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
${CLOUD_IMG_STR}
# For Cloud Image compatability
GRUB_PRELOAD_MODULES="${grub_modules}"
GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
EOF
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \
@ -108,16 +113,16 @@ EOF
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
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
chroot mountpoint apt-get -y clean
chroot mountpoint apt-get -y update
rm mountpoint/tmp/device.map
sync
umount mountpoint/boot/efi
sleep 5
apt-get install -qqy udev
udevadm settle
mount
umount_partition mountpoint

View File

@ -7,7 +7,7 @@ case $ARCH in
;;
esac
. /build/config/functions
. config/functions
create_partitions() {
disk_image="$1"
@ -26,6 +26,7 @@ install_grub() {
mkdir 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 remove --purge grub-legacy-ec2
@ -51,7 +52,7 @@ EOF
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
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
umount_partition mountpoint

View File

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

View File

@ -11,7 +11,7 @@ case $ARCH in
exit 0;;
esac
. /build/config/functions
. config/functions
if [ -e binary/boot/disk.ext4 ]; then
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
# 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
amd64|i386) ;;
*) echo "OVA images are not supported for $ARCH yet.";
amd64)
ovf_id=94
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
cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0}))
@ -57,7 +70,10 @@ sed -i "${ovf}" \
-e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/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
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
@ -67,7 +83,7 @@ ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
manifest="${scratch_d}/${prefix}.mf"
cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256}
SHA256(${ovf##*/})= ${ovf_sha256}
EOF
# Now create the OVA

View File

@ -1,35 +1,41 @@
#!/bin/bash -eux
#!/bin/bash -ex
# vi: ts=4 noexpandtab
#
# 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.
# This build step creates a cloud-config ISO so that Cloud-Init will configure
# the initial user, creates meta-data that tells Vagrant how to interact with
# the cloud-init created users, and finally create the OVA.
# We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the
# instance. This build step creates a cloud-config ISO so that Cloud-Init
# will configure the initial user, creates meta-data that tells Vagrant how
# 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}
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
amd64|i386) ;;
amd64)
ovf_id=94
ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "Vagrant images are not supported for $ARCH"
exit 0
echo "Vagrant images are not supported for $ARCH yet."
exit 0;;
esac
if [ ! -e ${base_vmdk} ]; then
echo "Did not find VMDK to produce Vagrant images."
exit 0
fi
. /build/config/functions
. config/functions
# Virtualbox is needed for making a small VMDK
apt-get -qqy install genisoimage qemu-utils
@ -37,7 +43,26 @@ apt-get -qqy install genisoimage qemu-utils
# Lets be safe about this
box_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
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
prefix="${distro}-${suite}-${version}-cloudimg"
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
# 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}
chpasswd: { expire: False }
ssh_pwauth: True
manage_etc_hosts: localhost
END
# Create the fake meta-data
@ -111,15 +137,11 @@ Vagrant.configure("2") do |config|
config.vm.base_mac = "${macaddr}"
config.ssh.username = "ubuntu"
config.ssh.password = "${ubuntu_user_pass}"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provider "virtualbox" do |vb|
vb.name = "${prefix}"
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
EOF
@ -160,7 +182,10 @@ sed -i "${ovf}" \
-e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/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)
@ -169,7 +194,7 @@ manifest="${box_d}/${prefix}.mf"
cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256}
SHA256(${ovf##*/})= ${ovf_sha256}
EOF
# Now create the box

View File

@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then
fi
# Export the common functions to the extras
. /build/config/functions
. config/functions
# 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@@">
<Info>A virtual machine</Info>
<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>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection>
<ProductSection ovf:required="false">

View File

@ -16,8 +16,9 @@
<VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info>
<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>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection>
<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-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
dhcpd:x:116:122::/var/run:/bin/false
EOF
else
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-bus-proxy:*:16372:0:99999:7:::
nm-openvpn:*:16909:0:99999:7:::
dhcpd:*:16925:0:99999:7:::
EOF
else
echo "/etc/shadow post-debootstrap hash doesn't match record" >&2
@ -186,6 +188,7 @@ systemd-resolve:x:118:
systemd-bus-proxy:x:119:
input:x:121:
nm-openvpn:x:120:
dhcpd:x:122:
EOF
else
echo "/etc/group post-debootstrap hash doesn't match record" >&2
@ -271,6 +274,7 @@ systemd-resolve:!::
systemd-bus-proxy:!::
input:!::
nm-openvpn:!::
dhcpd:!::
EOF
else
echo "/etc/gshadow post-debootstrap hash doesn't match record" >&2

View File

@ -4,8 +4,19 @@ set -e
echo "Setting up click packages"
CLICKARCH=$(dpkg --print-architecture)
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_custom=/custom/click
@ -20,8 +31,6 @@ tmpdir="$(mktemp -d)"
cleanup () { rm -rf "$tmpdir"; }
trap cleanup EXIT
CLICKARCH=$(dpkg --print-architecture)
wget --no-verbose -O "$tmpdir/click_list" "$click_list"
for package in $(cat "$tmpdir/click_list")
do
@ -61,7 +70,7 @@ do
mv /etc/click/databases/10_core.conf \
/etc/click/databases/10_core.conf.tmp
fi
click install --force-missing-framework --root="$root" --all-users \
click install --force-missing-framework --root="$root" --all-users $click_install_flags \
"$tmpdir/$package"
if [ "$root" = "$click_db_custom" ]; then
mv /etc/click/databases/10_core.conf.tmp \