1353 Commits

Author SHA1 Message Date
Robert C Jennings
9ff34ae65e
Fix logic to ensure snapd is seeded in core18-only images
The _snap_post_process function is meant to install snapd if core18 is the
only core snap installed or removed snapd if core is installed and snapd
was not explicitly installed.  But the current logic in _snap_preseed
will never call _snap_post_process.  $core_name will never be empty
with the existing logic, but even if it were that would only be for the
'core' snap and we'd miss using the 'core18' logic that pulls in snapd.
Given the case statement in _snap_post_process can handle doing the
right thing given any snap we can just call it unconditionally.
2020-04-15 10:05:16 -05:00
Robert C Jennings
64b05104aa
Address snap base regression after snap-tool removal
With the removal of snap-tool failures are seen in image builds that do
not have the 'core' snap included by the seed.  This is the case for the
minimized subproject of the ubuntu-cpc project where lxd/core is removed.
In that subproject, any binary hook which adds a snap that is based
on 'core' will not add 'core' and fail 'snap debug validate-seed'.
snap-tool included the following logic in the 'snap-tool info' when
determining snap bases:

    # Have "base" initialized to something meaningful.
    if self.is_core_snap():
        snap_data["snap"]["base"] = ""
    elif snap_data["snap"].get("base") is None:
        snap_data["snap"]["base"] = "core"

The snap store does not return a base if the base is core which makes
this necessary.  This patch looks for the base in 'snap info' output
and if none is found (and the snap is not snapd or core) it assumes the
base is 'core' and installs it.  This restores the behavior lost in the
migration from snap-tool to snap cli.
2020-02-25 20:24:13 -06:00
Robert C Jennings
2b0d201ee6
Use snap cli rather than custom snap-tool (LP: #1864252)
snap-tool was added to support a deprecate cohort-key feature of the
snap store.  Recent changes in snap assertions have added additional
fields which snap-tool is not retrieving.  This resulted in snap install
failures on first boot.

This patch removes snap-tool and returns to using the snap cli.
This ensures snap downloads will function without odd incompatibilities.
2020-02-24 17:03:59 -06:00
Adam Conrad
7c85d91d41 Limit the lxd group to images with an installer; it's less appropriate for random tarball images, which are configured in ways we don't know. 2019-10-13 23:16:48 -06:00
Dimitri John Ledkov
f918cd5eb1 Subiquity: install linux-firmware in the installer layer, to make firmware blobs available in the live session. LP: #1847835 2019-10-13 20:53:04 +01:00
Michael Hudson-Doyle
c89806ba4d Do not create a hook manually for ubuntu-cpc builds, make-hooks does not like that. 2019-10-09 14:34:08 +13:00
Michael Hudson-Doyle
4788e90315 Create the lxd group as a system group for all projects. (LP: #1844498) 2019-10-09 10:12:32 +13:00
Dimitri John Ledkov
4c534bc6be subiquity: Use LazyUnmount=yes on memorymapped /usr/lib/modules.
Subiquity images mount /usr/lib/modules from a squashfs, which systemd
tries to unmount on shutdown, whilst they are still being in use. As
systemd-udevd kmod built-in's libkmod has modules.* files
memorymapped. This produces an warning on shutdown, flooding the
screen with messages as systemd switches to a more verbose
output. Specify LazyUnmount=yes on that mount, such that unmount call
succeeds without flooding the shutdown log.
2019-10-08 19:04:20 +01:00
Robert C Jennings
8cb442c3e8
magic-proxy: dump proxy log to stdout on failure
When we encounter a failure in 'lb binary' the launchpad builders can
only surface the build output from stdout.  If the binary hook failure
implicates the archive we can not determine fault without the apt
proxy log.  This patch will dump the proxy log to stdout to aid in
debugging these failures.
2019-10-04 10:28:02 -05:00
Steve Langasek
0902ffefb3 002-add-foreign-kernel.chroot_early: enable amd64 as a foreign arch on i386 image builds, since this is where the kernel comes from henceforth. 2019-10-02 15:59:25 -07:00
Łukasz 'sil2100' Zemczak
1f8f86c17c Final fix to 999-ubuntu-image-customization.chroot, tested to be working. 2019-09-19 14:03:14 +02:00
Łukasz 'sil2100' Zemczak
6cd2343bea Fix the styling to fit the rest a bit better. 2019-09-16 14:55:32 +02:00
Łukasz 'sil2100' Zemczak
c7f3374f9f Final changes to the 999-ubuntu-image-customization.chroot hook. 2019-09-16 14:46:04 +02:00
Dimitri John Ledkov
9a6f28c131 lb_chroot_layered: also snap_validate_seed after all snaps are seeded
Cherrypick of the similar change done in the non-layered codepath.
2019-09-13 12:36:20 +01:00
Dimitri John Ledkov
b9f9dc1ca5 Execute chroot_hacks in live layer only.
As discussed and explained to Jibel and Didier on 17th of June, based
on canary image build logs, it showed clearly that lb controlled
initrd was only built once at the very first layer by
chroot_hacks. However, that is the wrong layer to build the final
initrd at, as at this point casper is not present yet and is not part
of the build.

Thus insure that chroot_hacks only runs at the live layer.

Ideally a subset of chroot_hacks should run on every layer, as each
layer should be squeaky clean, and most of layers without
initrds. However, jibel & didrocks are still implementing requested
patches to unbreak layer images and make each layer smaller. Hence
this minimal portion of the overall required work.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2019-09-11 14:40:56 +01:00
Łukasz 'sil2100' Zemczak
2341514fad Fix typo. 2019-09-10 17:35:46 +02:00
Łukasz 'sil2100' Zemczak
c3002a563a Merge branch 'u-i-cloud-init' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/master 2019-09-10 10:46:12 +02:00
Łukasz 'sil2100' Zemczak
d7c4bb4d85 Do not initialize EXTRA_SNAPS with an empty value. Allow overrides via the environment. 2019-09-06 12:09:08 +02:00
Łukasz 'sil2100' Zemczak
56234333f3 Add explaination to why ubuntu-image == device image. 2019-09-06 11:55:33 +02:00
Łukasz 'sil2100' Zemczak
006ed85460 Add support for the Nitrogen6x board. 2019-09-05 17:31:51 +02:00
Colin Watson
5a251ed8a7 Merge branch 'iptables-legacy' into ubuntu/master 2019-09-03 15:34:32 +01:00
Colin Watson
dc61b17db3 Use iptables-legacy on older kernel versions
Use iptables-legacy rather than iptables when running on older
(pre-4.15) kernel versions.  The newer nf_tables-based tools misbehave
at least on 4.4.
2019-09-03 15:23:06 +01:00
Iain Lane
2d19a9446e
snap_preseed: Handle SNAP_NO_VALIDATE_SEED being unset
Some builds run with `set -u` and were broken due to this.
2019-09-03 14:52:30 +01:00
Iain Lane
b68a5abf65
snap seeding: Defer validation for regular image builds
When getting the list of snaps to include on an image via germinate, we
process the snaps in alphabetical order. Currently we seed several
packages `gnome-foo` and also `gtk-common-themes`, the default provider
of `gtk-3-themes`. Since `gtk-common-themes` is alphabetically after
`gnome-foo`, the `seed.yaml` we generate is invalid when we are part way
through generating.

What we really care about, though, is not that the `seed.yaml` is always
valid at every step, but it is that it is valid at the *end* of seeding.
So for the germinate case, let's defer validation to happen once at the
end. Other callsites of `snap_preseed`, where callers are careful to
seed snaps in the right order, are unaffected by this.
2019-09-02 12:56:00 +01:00
Colin Watson
9a65a4013d Undivert update-initramfs more carefully
Previously the wrapper script and diversion were left in place on images
such as buildd images that don't have initramfs-tools installed.

LP: #1841573
2019-08-27 12:45:57 +01:00
Colin Watson
ce58687eed Fix placement of update-grub undiversion
Chroot deconfiguration should happen in the opposite order from chroot
configuration, so, for symmetry, undivert_grub should be called between
"lb chroot_debianchroot remove" and "lb chroot_sysfs remove".
2019-08-27 09:17:55 +01:00
Łukasz 'sil2100' Zemczak
f6cbbf01e1 Add a new u-i specific chroot hook, move the NoCloud system-boot cloud-init datasource configuration there to make sure all u-i built ship with it. 2019-08-08 12:22:33 +02:00
Dimitri John Ledkov
584ac368b0 Merge branch 'kvm-derives-uefi' of git+ssh://git.launchpad.net/~davidkrauser/livecd-rootfs/+git/livecd-rootfs into ubuntu/master 2019-07-26 14:35:16 -03:00
Łukasz 'sil2100' Zemczak
b4ba74885f Remove pulseaudio and udisks2 from kassel images. This will fix the image build failures. 2019-07-23 18:19:33 +02:00
David Krauser
0eecd0c344 KVM disk images should derive from the uefi image. 2019-07-22 13:12:21 -04:00
Robert C Jennings
0afb887cb7
ubuntu-cpc: use sys.exit() rather than quit() 2019-07-22 11:29:04 -05:00
Robert C Jennings
5083d76835
ubuntu-cpc: remove unused final.binary hook support
Right now this is a solution looking for a problem as the implementation
no longer relies on it.
2019-07-22 11:29:04 -05:00
Robert C Jennings
cb535805d7
ubuntu-cpc: rework image artifact cleanup
The livecd.ubuntu-cpc.ext4 that is present in each build (plus kernel
and initrd) are not renamed from /build/binary/boot/filsystem.ext4
and friends until after the binary hooks are run, so this patch moves
from trying to perform this cleanup in a binary hook.  Now the cleanup
will be run at the end of live-build/binary for the ubuntu-cpc project.
2019-07-22 11:29:04 -05:00
Robert C Jennings
14b7f62b17
ubuntu-cpc: Only produce explicitly named artifacts (LP: #1837254)
In parallel builds where a list of image targets are provided the build
may produce binaries that are not part of the named set of targets but
are created by series dependencies.  These implicitly created binaries
may be generated by multiple builds but are unused as our convention for
the ubuntu-cpc project is to only consume binaries from the explicitly
named image targets; this avoid overwriting the same object by multiple
parallel builds.

This patch adds support for a 'provides' keyword for series files. It can
be specified multiple times per series file.  The field is used by the
make-hooks script to generate a list of output files created explicitly by
the named image targets.  The list is saved to the "explicit_provides"
file in the hooks output directory. In the case of the "all" target
this list would be empty.  This list is consumed by the "final.binary"
hook file.

This patch adds support for optional final.binary hooks in hooks.d/base
and/or hooks.d/extra.  These final.binary hooks are always included as
the last hook(s) if either exist with the hook in "extra" running last.

The base/final.binary hook includes logic to parse the "explicit_provides"
file generated by the make-hooks script and remove any binary output not
explicitly specified.

Some series files named unnecessary dependencies, specifically
disk-image, to keep output of implicit artifacts consistent between
parallel builds.  These unnecessary dependencies are removed in this
patch.
2019-07-22 11:29:04 -05:00
David Krauser
5a2b49950a Fixing broken binary hook symlinks for hyperv gallery image builds. 2019-07-17 15:27:06 -04:00
Iain Lane
979dbde6a2
Fix slight whitespace error 2019-07-16 10:27:47 +01:00
Iain Lane
b208ded59e
Merge branch 'snap-validate-seed' of git+ssh://git.launchpad.net/~mvo/livecd-rootfs into ubuntu/master 2019-07-16 10:27:27 +01:00
Michael Vogt
4fb73c2b19 functions: use CHROOT_ROOT in snap_preseed 2019-07-16 08:29:09 +02:00
Michael Vogt
248efab2fd live-build: move snap seed validation into snap_preseed 2019-07-15 20:12:33 +02:00
Michael Vogt
ac717bff40 live-build: move snap seed validation into preinstall_snaps (thanks to rcj) 2019-07-15 17:32:28 +02:00
Iain Lane
7f07cc8991
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"
2019-07-15 16:15:31 +01:00
Tobias Koch
18468c4218 Check exit status of snap-tool info call while determining base snap 2019-07-15 07:49:59 +02:00
Michael Vogt
8bc09a160b Run "snap debug validate-seed" to do basic validation of the geerated seed.yaml 2019-07-12 17:55:16 +02:00
Łukasz 'sil2100' Zemczak
1e275b6b46 Append seeded snaps to manifests for all images. 2019-07-02 11:39:07 +02:00
Dimitri John Ledkov
124d074101 Unbreak cpc/server builds, by ensuring that includes are copied with archived symlinks, and only hooks resolve symlinks when getting copied. 2019-06-20 23:27:36 +01:00
Dimitri John Ledkov
095c8f4696 Install s390-tools-zkey into the installer layer for zkey support in subiquity. 2019-06-20 23:26:13 +01:00
Colin Watson
dc85df854b Add tzdata to buildd images
It isn't strictly build-essential, but it has traditionally been present
in both Debian and Ubuntu, and a variety of things fail without it.
2019-06-19 17:20:54 +01:00
Steve Langasek
796a89a3c0 Remove dangling symlink /usr/lib/systemd/system/local-fs.target.wants/media-region.lower.mount. It's unclear why this has just started causing build failures, but the symlink should have been removed in 2.592 with the rest of the MAAS stuff. 2019-06-15 11:09:45 -07:00
David Krauser
0e3b1e206b
Add support for HyperV Gallery images 2019-06-11 23:26:07 -04:00
Tiago Stürmer Daitx
f2bbe1fd85
Merge patviafore/linux_kvm_image: Add linux-kvm image
We are creating a derivative of disk-image, replacing the kernel with
linux-kvm, removing initramfs, and creating a qcow2 image.

Source: ~patviafore/livecd-rootfs/+git/livecd-rootfs:linux_kvm_image

Modifications: fixed conflict in debian/changelog entry and bumped
version.

Signed-off-by: Tiago Stürmer Daitx <tdaitx@gmail.com>
2019-06-11 22:17:20 -03:00