300 Commits

Author SHA1 Message Date
Steve Langasek
e41c6f50df Drop use of deprecated apt-key. 2022-09-21 16:08:36 -07:00
Steve Langasek
abcfabdbc0 Drop support for building i386 images aside from the launchpad builder images. 2022-07-25 12:50:56 -07:00
Jean-Baptiste Lallement
80ccea8d63 Separate WSL from CPC
Create a separate WSL image than CPC so it can be managed independently.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-03-17 10:11:39 +01:00
Łukasz 'sil2100' Zemczak
e4c846199b Following Dave's changes to the classic pi gadget, switch to using the classic branch for desktop images as well. 2022-02-22 11:33:26 +01:00
Brian Murray
e5beee30fd Add the capability to build an ISO image for the Intel IoT project. Additionally, stop using universe with the project given that the kernel is now in main. 2021-11-16 17:00:38 -08:00
Thomas Bechtold
2b2f67c7fb Keep changelogs in minimized builds for native deb pkgs
Debian changelog.Debian.* files are already keept for minimized
builds. But those changelogs are from non-native .deb packages (see
man dh_installchangelogs). Native .deb packages name their changelog
just changelog.* . So keep them in a minimized build, too.

LP: #1943114
2021-09-20 13:43:27 +02:00
Michael Hudson-Doyle
5fda0bb2aa apply dpkg minimizations to minimal layer, and undo them for full layer 2021-08-03 16:36:02 +12:00
Steve Langasek
c7b751e401 Drop code for the 'ubuntu-core' project when not using image_format: ubuntu-image, as this is obsolete and not used to build core* snaps in recent series. 2021-05-11 17:12:20 -07:00
Dimitri John Ledkov
dc2a472871
magic-proxy: replace http.client with urllib calls
Initialize passwords from sources.list.
Use urllib everywhere.
This way authentication is added to all the required requests.
And incoming headers, are passed to the outgoing requests.
And all the response headers, are passed to the original client.
And all the TCP & HTTP errors are passed back to the client.
Thus should avoiding hanging requests upon failure.
Also rewrite the URI when requesting things.
This allows to use private-ppa.buildd outside of launchpad.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2021-04-30 17:50:28 +01:00
Dimitri John Ledkov
1cd8fe14b7
Change iptables calls, to query rules and quickly check that connectivity works after transparent proxy has been installed. LP: #1917920 2021-04-30 17:48:09 +01:00
Thomas Bechtold
a81972a58b
add configure_oci function and use it in ubuntu-oci
With that, the Dockerfile modifications[0] currently done externally
are done now here. That means that the created rootfs tarball can be
directly used within a Dockerfile to create a container from scratch:

FROM scratch
ADD livecd.ubuntu-oci.rootfs.tar.gz /
CMD ["/bin/bash"]

[0]
https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
2021-04-22 08:48:00 +02:00
Thomas Bechtold
ac4a95b931
Add new ubuntu-oci project
This is a copy of the ubuntu-base project.
Currently ubuntu-base is used as a base for the docker/OCI container
images. The rootfs tarball that is created with ubuntu-base is
published under [0]. That tarball is used in the FROM statement of the
Dockerfile as base and then a couple of modifications are done inside
of the Dockerfile[1].
The ubuntu-oci project will include the changes that are currently
done in the Dockerfile. With that:

1) a Dockerfile using that tarball will be just a 2 line thing:

   FROM scratch
   ADD ubuntu-hirsute-core-cloudimg-amd64-root.tar.gz /
   CMD ["/bin/bash"]

2) Ubuntu has the full control about the build process of the
docker/OCI container. No external sources (like [1]) need to be
modified anymore.
3) Ubuntu can publish containers without depending on the official
dockerhub containers[2]. Currently the containers for the AWS ECR
registry[3] use as a base[4] the official dockerhub containers. That's
no longer needed because a container just needs a Dockerfile described
in 1)

When the ubuntu-oci project has the modifications from [1] included,
we'll also update [1] to use the ubuntu-oci rootfs tarball as a base
and drop the modifications done at [1].

Note: Creating a new ubuntu-oci project instead of using ubuntu-base
will make sure that we don't break users who are currently using
ubuntu-base rootfs tarballs for doing their own thing.

[0] https://partner-images.canonical.com/core/
[1]
https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
[2] https://hub.docker.com/_/ubuntu
[3] https://gallery.ecr.aws/ubuntu/ubuntu
[4]
https://launchpad.net/~ubuntu-docker-images/ubuntu-docker-images/+oci/ubuntu/+recipe/ubuntu-20.04
2021-04-22 07:39:15 +02:00
Dimitri John Ledkov
109e6c6613
auto/build: use setup|teardown_mountpoint to reduce duplication 2020-07-24 20:59:57 +01:00
Robert C Jennings
84397b5098
Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount)
Builds in LP with the Xenial kernel were happy with the recursive mount of
/sys inside the chroot while performing snap-preseeding but autopkgtests
with the groovy kernel failed.  With the groovy kernel the build was
unable to unmount sys/kernel/slab/*/cgroup/* (Operation not permitted).

This patch mounts /sys and /sys/kernel/security in the chroot in the
same way we've added for binary hooks.  This provides the paths under
/sys needed for snap-preseed while avoiding issues unmounting other
paths.
2020-07-18 16:52:18 -05:00
Dimitri John Ledkov
31861fd40d
seccomp: mount more up-to-date seccomp features 2020-07-18 00:24:16 +01:00
Dimitri John Ledkov
a14a31b751
apparmor: mount more up-to-date apparmor features in the chroot. 2020-07-18 00:20:41 +01:00
Robert C Jennings
1ca11c9795
Apply snap-preseed optimizations after seeding snaps
The snap-preseed command can do a number of things during the build
that are currently performed at first boot (apparmor profiles, systemd
unit generation, etc).  This patch adds a call to reset the seeding and
apply these optimizations when adding a seeded snap.  As a prerequisite
to calling snap-preseed we need to make /dev/mem available as well as
mounts from the host to perform this work, so those are also added here.
2020-07-17 21:17:33 +01:00
Dimitri John Ledkov
56ac1865f7 Switch Ubuntu desktop to only hwe-20.04 kernel flavour. 2020-04-16 01:30:31 +01:00
Dimitri John Ledkov
cb574d4cb3 minimized: reinstall packages one by one, instead of all of them together, as otherwise apt fails to immediately configure libc6:amd64 & libgcc-s1. LP: #1867607 2020-03-16 10:42:30 +00:00
Łukasz 'sil2100' Zemczak
e9170e053b Rename the raspi3 SUBARCH to raspi 2020-02-21 12:46:43 +01:00
Dimitri John Ledkov
db0c7d68f2 Although the request flavour to install is oem-20.04, it really is called just oem on disk. Override the flavour name from oem-20.04 to oem when renaming built artefacts. This also means that ubuntu-cdimage needs to simply download 'oem' vmlinuz+initrd pairs, not 'oem-20.04'. 2020-01-30 11:13:51 +00:00
Łukasz 'sil2100' Zemczak
2870738f00 Merge the manually-pushed 2.636 from Laney. 2020-01-24 18:47:22 +01:00
Michael Hudson-Doyle
94c2d606ca Preserve apt preferences created by any package we install (i.e. ubuntu-advantage-tools) against live-build's attempt to delete them. (LP: #1855354) 2019-12-13 13:16:33 +13:00
Łukasz 'sil2100' Zemczak
474f232840 Snapd for uc20 model assertions does not support global channel overrides. 2019-12-12 16:58:42 +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
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
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
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
Łukasz 'sil2100' Zemczak
1e275b6b46 Append seeded snaps to manifests for all images. 2019-07-02 11:39:07 +02:00
David Krauser
0e3b1e206b
Add support for HyperV Gallery images 2019-06-11 23:26:07 -04:00
Dimitri John Ledkov
d7b629cae6 Do not force lzma on ubuntu-core builds, the compress format default should be set universally inside initramfs-tools-ubuntu-core package instead of getting duplicated multiple times all over the place. 2019-06-05 13:50:20 +01:00
Dimitri John Ledkov
702ccb4c77 Merge branch 'dead-ubuntu-touch' of git+ssh://git.launchpad.net/~xnox/livecd-rootfs into ubuntu/master 2019-06-04 23:42:31 +01:00
Dimitri John Ledkov
af96b80116 Merge branch 'dead-ubuntu-desktop-next' of git+ssh://git.launchpad.net/~xnox/livecd-rootfs into ubuntu/master 2019-06-04 23:40:37 +01:00
Dimitri John Ledkov
44fd9ba9fd Drop ubuntu-touch configs 2019-05-30 12:13:31 +01:00
Dimitri John Ledkov
2aa3a59b7c Drop ubuntu-desktop-next configs 2019-05-30 12:00:59 +01:00
Dimitri John Ledkov
5b89298cd9 Drop old arm platforms. 2019-05-30 11:49:06 +01:00
Steve Langasek
c306763147 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-17 18:25:21 +02:00
Julian Andres Klode
bed915a0fb Don't purge busybox-static in minimized, no longer installed
This caused the builds to fail because we were purging are non
existing package.
2019-05-13 14:22:53 +02:00
Michael Hudson-Doyle
42992467a1 Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds. (LP: #1828118) 2019-05-08 10:04:23 +12:00
Julian Andres Klode
e95ad81c47 Run clean_debian_chroot after minimize_manual
This avoids us having apt cache files in the final image.

For auto/build, we move the call to clean_debian_chroot to the end,
this also takes care of the caches generated by apt-get update
in case of a preinstalled-pool.

For layered, it's just a simple swap of the lines.

LP: #1826377
2019-04-25 11:51:30 +02:00
Tobias Koch
05e71b3840 Do not include any snaps in ubuntu-cpc:minimized builds 2019-04-12 13:37:02 -07:00
Balint Reczey
2d162dd121 Pass --sort=name to tar to make tarballs more reproducible and rsync-friendly 2019-04-10 14:38:35 +02:00
Jean-Baptiste Lallement
38bb0b3301 Fix grub divert for multilayer images
grub-probe must not be called during image build so grub is diverted. In
multilayer image the chroot is always the tip of the filesystem, so we
divert grub at the beginning of each pass and undivdert it as the end.
For flat images, it's diverted just before building the chroot and
undiverted after.
2019-03-18 09:33:07 +01:00
Steve Langasek
ea5f01942f divert grub when calling into lb chroot
UbuntuStudio image builds have recently begun failing as a result of adding a
grub theme customization to their flavor, which they then try to apply by
running update-grub from their maintainer scripts.  This fails with:

  Setting up plymouth-theme-ubuntustudio (0.57) ...
  update-alternatives: using /usr/share/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth to provide /usr/share/plymouth/themes/default.plymouth (default.plymouth) in auto mode
  update-alternatives: using /usr/share/plymouth/themes/ubuntustudio-text/ubuntustudio-text.plymouth to provide /usr/share/plymouth/themes/text.plymouth (text.plymouth) in auto mode
  update-initramfs: diverted by livecd-rootfs (will be called later)
  /usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
  dpkg: error processing package plymouth-theme-ubuntustudio (--configure):
   installed plymouth-theme-ubuntustudio package post-installation script subprocess returned error exit status 1

Packages providing grub themes should be able to call update-grub from their
maintainer scripts, and they should be able to be installed under
livecd-rootfs.  It's surprising to me that this hasn't been a problem before
now for any flavors.

We know that grub-probe should not be called as part of an image build, so
just use our standard helper function to divert it before running the chroot
stage and undivert it after.
2019-03-09 20:08:29 +00:00
Balint Reczey
039ed8ec31 Merge fixing minimized text spacing 2019-02-06 17:55:10 +07:00
Balint Reczey
0182d380ca Nicely separate motd text about minimizing from texts above 2019-02-05 17:24:09 +07:00
Tobias Koch
5b70d86f5c Inject a proxy into the build providing a snapshot view of the package repo.
When the REPO_SNAPSHOT_STAMP variable is set, the auto/build script will attempt
to launch a transparent HTTP proxy on port 8080, and insert an iptables rule to
redirect all outgoing HTTP requests to this proxy.

The proxy, contained in the `magic-proxy` Python script, examines each request
and silently overrides those pointing to InRelease files or files that are
listed in InRelease files. It will instead provide the contents of the requested
file as it was at REPO_SNAPSHOT_STAMP, by downloading the corresponding asset
"by hash".
2019-02-01 11:26:20 +01:00
Michael Hudson-Doyle
a9991a908e revert change to ubuntu-server:live snap seeding 2019-02-01 17:22:25 +13:00
Jean-Baptiste Lallement
283871573d Changed the naming scheme for multi layer images to dot format 2019-01-30 12:29:56 +01:00