Compare commits

...

20 Commits

Author SHA1 Message Date
Iain Lane
5a088d522f
Update changelog to fix c+p fail 2019-07-16 16:27:13 +01:00
Iain Lane
0d54091641
Finalise changelog 2019-07-16 13:20:54 +01:00
Iain Lane
e81e8e55b8
Update changelog 2019-07-16 13:20:48 +01:00
Iain Lane
b7e6aee81b
live-build/functions: Seed core again on non-minimized builds
This is apparently still required; without it snapd gives an error
message like:

  stateengine.go:102: state ensure error: devicemgr: cannot proceed without seeding "core"

(cherry picked from commit 7f07cc899192b33c0eded30ffa514a6581df046e)
2019-07-16 13:17:08 +01:00
Michael Vogt
2dbda09b6a
Run "snap debug validate-seed" to do basic validation of the generated seed.yaml
(cherry picked from commit b208ded59ea9e54ad42bd071a39cebe2e4809aa4)

Signed-off-by: Iain Lane <iain.lane@canonical.com>
2019-07-16 13:16:57 +01:00
Tobias Koch
a1302a4a91
Backport error-checking on determining snap bases
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1828500

Signed-off-by: Iain Lane <iain.lane@canonical.com>
(cherry picked from commit 51ef72e5b97820e7e6529903ee18270c87491609)
2019-07-16 13:14:27 +01:00
Steve Langasek
bddc32b01f releasing package livecd-rootfs version 2.578.5 2019-05-30 12:13:58 -07:00
Steve Langasek
e528a8eabd Strip translation files out of the minimal images.
This is another thing that goes unused when there is no human console user
(and we already don't have the locales themselves present on a minimal
image).

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1829333
2019-05-30 12:13:50 -07:00
Balint Reczey
ba8797dc16 Update changelog 2019-05-24 12:43:19 +02:00
Balint Reczey
4931523fc1 Merge lp:~rbalint/livecd-rootfs -b wsl-disco 2019-05-24 12:40:21 +02:00
Steve Langasek
50ca382be5 releasing package livecd-rootfs version 2.578.4 2019-05-23 13:33:45 -07:00
Robert C Jennings
367e9fbfeb
magic-proxy: Send headers on error (LP: #1829944) 2019-05-21 19:22:35 -05:00
Steve Langasek
24e39d6844 releasing package livecd-rootfs version 2.578.3 2019-05-21 15:19:37 -07:00
Robert C Jennings
2fecd44890
ubuntu-cpc: Allow comments in series files and add comments
The addition of disk-image to series files in a prior commit required
some explanation.  Without comment support in series files that was
not possible.  This patch adds support for comments and adds those
comments as well.
2019-05-20 22:14:05 -05:00
Robert C Jennings
00b995c7e2
ubuntu-cpc: Ensure base disk image is the same between all build targets
The following targets have livecd.ubuntu-cpc.manifest (and
livecd.ubuntu-cpc.ext4) which differ in some way from the 'all'
target. They are all missing grub-efi and other modifications:

root-dir
squashfs
tarball

These targets do not depend on the 'disk-image' target. This means that
the ext4 produced will lack the uefi modifications (and any from the
disk-image target binary hooks).

Since the ext4 file is common to all builds there is a chance that a
parallel build from one of these targets could overwrite this artifact.
This patch ensures that all targets will produce consistent base output.
2019-05-20 22:14:05 -05:00
Robert C Jennings
f493132f90
ubuntu-cpc: Fixup comment references to file names post-parallelization 2019-05-20 22:13:23 -05:00
Balint Reczey
edbbc23970 Build WSL rootfs tarball
LP: #1827930
2019-05-17 16:40:31 +02:00
Michael Hudson-Doyle
51bd9d5b4a releasing package livecd-rootfs version 2.578.2 2019-05-08 10:44:02 +12:00
Michael Hudson-Doyle
523a964b64 Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds. (LP: #1828118) 2019-05-08 10:43:49 +12:00
Julian Andres Klode
a3dac25d86 releasing package livecd-rootfs version 2.578.1 2019-04-26 10:34:17 +02:00
16 changed files with 171 additions and 24 deletions

54
debian/changelog vendored
View File

@ -1,8 +1,58 @@
livecd-rootfs (2.579) UNRELEASED; urgency=medium
livecd-rootfs (2.578.6) disco; urgency=medium
[ Tobias Koch ]
* Do proper error checking when calling snap-tool info to determine
the base of a snap. (LP: #1828500)
[ Michael Vogt ]
* Run "snap debug validate-seed" during preseeding to do basic validation of
the generated seed.yaml
[ Iain Lane ]
* Seed core for non minimized builds, as it is still required (LP:
#1836594).
-- Iain Lane <iain.lane@canonical.com> Tue, 16 Jul 2019 13:20:52 +0100
livecd-rootfs (2.578.5) disco; urgency=medium
[ Balint Reczey ]
* Build WSL rootfs tarball (LP: #1827930)
[ Steve Langasek ]
* Strip translation files out of the minimal images, another thing that
goes unused when there is no human console user (and we already don't
have the locales themselves present on a minimal image). LP: #1829333.
-- Steve Langasek <steve.langasek@ubuntu.com> Thu, 30 May 2019 12:13:55 -0700
livecd-rootfs (2.578.4) disco; urgency=medium
[ Robert C Jennings ]
* magic-proxy: Send headers on error (LP: #1829944)
-- Steve Langasek <steve.langasek@ubuntu.com> Thu, 23 May 2019 13:33:40 -0700
livecd-rootfs (2.578.3) disco; urgency=medium
[ Robert C Jennings ]
* ubuntu-cpc: Ensure base disk image is the same between all build targets
(LP: #1827426)
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 21 May 2019 15:19:34 -0700
livecd-rootfs (2.578.2) disco; urgency=medium
* Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds.
(LP: #1828118)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Wed, 08 May 2019 09:59:35 +1200
livecd-rootfs (2.578.1) disco; urgency=medium
* Run clean_debian_chroot after minimize_manual (LP: #1826377)
-- Julian Andres Klode <juliank@ubuntu.com> Thu, 25 Apr 2019 11:43:11 +0200
-- Julian Andres Klode <juliank@ubuntu.com> Fri, 26 Apr 2019 10:34:05 +0200
livecd-rootfs (2.578) disco; urgency=medium

3
debian/control vendored
View File

@ -10,6 +10,7 @@ Package: livecd-rootfs
Architecture: any
Depends: ${misc:Depends},
apt-utils,
attr,
debootstrap,
distro-info,
dosfstools,
@ -32,7 +33,7 @@ Depends: ${misc:Depends},
python3-software-properties,
qemu-utils,
rsync,
snapd,
snapd (>= 2.39),
squashfs-tools (>= 1:3.3-1),
sudo,
u-boot-tools [armhf arm64],

View File

@ -131,6 +131,9 @@ Expire-Date: 0
# Drop all man pages
path-exclude=/usr/share/man/*
# Drop all translations
path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo
# Drop all documentation ...
path-exclude=/usr/share/doc/*
@ -191,6 +194,10 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp
# 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
echo "Restoring system translations..."
# This step processes the packages which still have missing translations
dpkg --verify --verify-format rpm | awk '/..5...... \/usr\/share\/locale/ {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
@ -308,17 +315,6 @@ EOF
apt-get -y --purge autoremove"
fi
if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then
# Save even more size by removing apt lists (that are currently removed
# downstream anyway)
rm -rf chroot/var/lib/apt/lists/*
# Having device notes in the docker image can cause problems
# (https://github.com/tianon/docker-brew-ubuntu-core/issues/62)
# so remove them. We only do this for docker out of an
# abundance of caution.
rm -rf chroot/dev/*
fi
configure_universe
if [ -d chroot/var/lib/preinstalled-pool ]; then

View File

@ -483,12 +483,20 @@ _snap_preseed() {
;;
*)
# Determine if and what core snap is needed
local core_snap=$(/usr/share/livecd-rootfs/snap-tool info \
local snap_info
snap_info=$(/usr/share/livecd-rootfs/snap-tool info \
--cohort-key="${COHORT_KEY:-}" \
--channel="$CHANNEL" "$SNAP_NAME" | \
grep '^base:' | awk '{print $2}'
--channel="$CHANNEL" "${SNAP_NAME}" \
)
if [ $? -ne 0 ]; then
echo "Failed to retrieve base of $SNAP_NAME!"
exit 1
fi
local core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}')
# If $core_snap is not the empty string then SNAP itself is not a core
# snap and we must additionally seed the core snap.
if [ -n "$core_snap" ]; then
@ -611,6 +619,12 @@ snap_prepare() {
local CUSTOM_BRAND_MODEL=${2:-generic:generic-classic}
snap_prepare_assertions "$CHROOT_ROOT" "$CUSTOM_BRAND_MODEL"
# ubuntu-cpc:minimized has its own special snap handling
if [ "$PROJECT:${SUBPROJECT:-}" != ubuntu-cpc:minimized ]; then
# Download the core snap
_snap_preseed "$CHROOT_ROOT" core stable
fi
}
snap_preseed() {
@ -635,6 +649,15 @@ snap_preseed() {
touch "$CHROOT_ROOT/var/lib/snapd/seed/.snapd-explicit-install-stamp"
;;
esac
# Do basic validation of generated snapd seed.yaml, doing it here
# means we catch all the places(tm) that snaps are added but the
# downside is that each time a snap is added the seed must be valid,
# i.e. snaps with bases need to add bases first etc.
if [ -e chroot/var/lib/snapd/seed/seed.yaml ]; then
snap debug validate-seed "$CHROOT_ROOT/var/lib/snapd/seed/seed.yaml"
fi
}
snap_from_seed() {
@ -718,6 +741,17 @@ clean_debian_chroot() {
# remove crufty files that shouldn't be left in an image
rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old
Chroot chroot apt clean
# For the docker images we remove even more stuff.
if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then
# Remove apt lists (that are currently removed downstream
# anyway)
rm -rf chroot/var/lib/apt/lists/*
# Having device nodes in the docker image can cause problems
# (https://github.com/tianon/docker-brew-ubuntu-core/issues/62)
# so remove them. We only do this for docker out of an
# abundance of caution.
rm -rf chroot/dev/*
fi
}
configure_universe() {

View File

@ -65,8 +65,8 @@ install_grub() {
chroot mountpoint mkdir -p "${efi_boot_dir}"
if [ -n "$partuuid" ]; then
# FIXME: code duplicated between 032-disk-image.binary
# and 033-disk-image-uefi.binary. We want to fix this to not
# FIXME: code duplicated between disk-image.binary
# and 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

View File

@ -8,7 +8,7 @@ if [ -n "$SUBARCH" ]; then
exit 0
fi
# This is the directory created by 031-0-create-root-dir.binary
# This is the directory created by create-root-dir.binary
rootfs_dir=rootfs.dir
squashfs_f="$PWD/livecd.ubuntu-cpc.squashfs"

View File

@ -8,7 +8,7 @@ if [ -n "$SUBARCH" ]; then
exit 0
fi
# This is the directory created by 031-0-create-root-dir.binary
# This is the directory created by create-root-dir.binary
rootfs_dir=rootfs.dir
cp $rootfs_dir.manifest livecd.ubuntu-cpc.rootfs.manifest

View File

@ -5,3 +5,4 @@ depends disk-image
depends qcow2
depends vmdk
depends vagrant
depends wsl

View File

@ -1 +1,3 @@
# Include disk-image to ensure livecd.ubuntu-cpc.ext4 is consistent
depends disk-image
base/create-root-dir.binary

View File

@ -1,2 +1,4 @@
# Include disk-image to ensure livecd.ubuntu-cpc.ext4 is consistent
depends disk-image
depends root-dir
base/root-squashfs.binary

View File

@ -1,2 +1,4 @@
# Include disk-image to ensure livecd.ubuntu-cpc.ext4 is consistent
depends disk-image
depends root-dir
base/root-xz.binary

View File

@ -0,0 +1,2 @@
depends root-dir
base/wsl.binary

View File

@ -7,7 +7,7 @@
# and checksums. This step produces an OVA that is suitable for use with
# Cloud's that support the OVF specification.
#
# 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 vmdk-image.binary
case ${SUBPROJECT:-} in
minimized)

View File

@ -0,0 +1,56 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate the compressed root directory for WSL
case ${SUBPROJECT:-} in
minimized)
echo "Skipping minimized $0 build as WSL systems are designed to be interactive"
exit 0
;;
*)
;;
esac
case $ARCH in
amd64|arm64)
;;
*)
echo "WSL root tarballs are not generated for $ARCH."
exit 0;;
esac
if [ -n "${SUBARCH:-}" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
. config/functions
rootfs_dir=wslroot.dir
# This is the directory created by create-root-dir.binary
cp -a rootfs.dir $rootfs_dir
setup_mountpoint $rootfs_dir
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl
create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest
teardown_mountpoint $rootfs_dir
# remove attributes not supported by WSL's tar
if [ -d $rootfs_dir/var/log/journal ]; then
setfattr -x system.posix_acl_access $rootfs_dir/var/log/journal
setfattr -x system.posix_acl_default $rootfs_dir/var/log/journal
fi
# The reason not using just tar .. -C $rootfs_dir . is that using '.' was found
# not working once and checking if using the simpler command is safe needs
# verification of the app installation on all Windows 10 builds we support
# with WSL.
cd $rootfs_dir
tar --xattrs --sort=name -czf ../livecd.ubuntu-cpc.wsl.rootfs.tar.gz *
cd ..
rm -rf $rootfs_dir

View File

@ -161,7 +161,7 @@ class MakeHooks:
with open(series_file, "r", encoding="utf-8") as fp:
for line in fp:
line = line.strip()
if not line:
if not line or line.startswith("#"):
continue
m = re.match(r"^\s*depends\s+(\S+.*)$", line)
if m:

View File

@ -843,6 +843,7 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
"""Return an HTTP error status and a message in the response body."""
self.send_response(status)
self.send_header("Content-Type", "text/plain; charset=utf-8")
self.end_headers()
self.wfile.write(message.encode("utf-8"))