714 Commits

Author SHA1 Message Date
Łukasz 'sil2100' Zemczak
9d18e5d2e3 Backport hack from jammy for fixing offline installs. 2023-03-16 14:04:25 +01:00
Samir Akarioh
aa1c6d9e19 feat: Add metadata on ubuntu-oci image
Add a file build.info on etc/cloud
with the serial information

Signed-off-by: Samir Akarioh <samir.akarioh@canonical.com>
(cherry picked from commit 105acdebc783291f740294b5c317f3e6d2da9de4)
2022-11-22 12:21:40 +01:00
Łukasz 'sil2100' Zemczak
f59dad4ce9 Some missing pieces. 2022-06-10 12:18:42 +02:00
Łukasz 'sil2100' Zemczak
8b0cd96803 Add intel-iot server images, build intel-iot with the 5.15 kernel. 2022-06-09 16:52:08 +02:00
Łukasz 'sil2100' Zemczak
fe5576194e Use the classic gadget for raspi images 2022-02-15 19:43:50 +01:00
Brian Murray
8288552dea 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:17:54 -08:00
Łukasz 'sil2100' Zemczak
4131dad0da Fix rootfs resize and a grub2 font warning. 2021-10-29 15:34:53 +02:00
Łukasz 'sil2100' Zemczak
60ade114c4 Sneak in a small fix for a (currently) unused use-case. 2021-10-28 18:11:44 +02:00
Dimitri John Ledkov
efd0641f6c 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>
(cherry picked from commit dc2a472871907bbed3ab89d2a46d924ece80d514)
2021-09-28 13:48:45 +02:00
Dimitri John Ledkov
3d65dbb767 Change iptables calls, to query rules and quickly check that connectivity works after transparent proxy has been installed. LP: #1917920
(cherry picked from commit 1cd8fe14b70e98220c519d679217737672ee9019)
2021-09-28 13:48:41 +02:00
Łukasz 'sil2100' Zemczak
4cf38c5151 Some more changes needed for enabling official intel-iot image builds. 2021-08-16 13:04:25 +02:00
Łukasz 'sil2100' Zemczak
44148c60a5 One more fix for intel-iot. 2021-08-12 13:45:35 +02:00
Łukasz 'sil2100' Zemczak
977c1cf74b A small fix for intel-iot 2021-08-04 17:35:11 +02:00
Brian Murray
6fac135f23 fix an extraneous || 2021-07-28 14:34:54 -07:00
Brian Murray
4b3f3c52dc add missing semicolons 2021-07-28 13:48:09 -07:00
Brian Murray
69afe8fd5d Add support for creating images (ubuntu-core and classic) with a kernel optimized for Intel IoT devices. (LP: #1938338) 2021-07-28 13:37:31 -07:00
Jean-Baptiste Lallement
fee8ba22f4 Added hook for AD support
Adding dependencies for Active Directory support to workaround LP: #1921862

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2021-05-21 16:56:38 +02:00
Thomas Bechtold
99add26dc3
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

(cherry picked from commit a81972a58b004897bf3e5c14ff371bc2f6b5e4b8)
2021-04-30 14:02:59 +02:00
Thomas Bechtold
9e15d88f4c
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

(cherry picked from commit ac4a95b9314cf1f8ce01f42016c271c0a6078372)
2021-04-30 14:02:59 +02:00
David Krauser
597d678e17
Fix broken minimal cloud image boot on amd64 (LP: #1920043)
I recently pulled initramfs logic out of the base build hook, and
dropped that into the `replace_kernel` function. Any cloud image that
does not leverage the generic virtual kernel was expected to call
`replace_kernel` to pull in a custom kernel. That function will
disable initramfs boot for images that use a custom kernel.

Minimal cloud images on amd64 use the linux-kvm kernel, but the build
hook does not utilize the `replace_kernel` function. Instead, the
kernel flavor is set in `auto/config`. I pulled that logic out of
`auto/config` and am now calling `replace_kernel` in the build hook.

I also moved a call to generate the package list so that it will pick
up the change to the linux-kvm kernel.
2021-03-22 10:26:06 -05:00
Łukasz 'sil2100' Zemczak
befad641dc Support the lowlatency-hwe-* when handling kernel flavours. 2021-02-02 11:51:21 +01:00
Łukasz 'sil2100' Zemczak
e22a16b068 Enable the HWE kernel for all flavours. 2021-02-01 22:25:00 +01:00
Dimitri John Ledkov
7680ece7b0
riscv64: backport HiFive unleashed & cloud-image building support
All commits are cherrypicks from hirsute, and includes:

make-lxd-metadata: add riscv64 lxd architecture tag
control: install qemu-utils & snapd on riscv64.
disk-image.binary: actually skip building MBR image on EFI platforms.
disk-image.binary: skip building MBR image on riscv64.
disk-image.binary: however still build MBR image on amd64.
disk-image-uefi.binary: build riscv64 image without a bootloader.
disk-image-uefi: riscv64 add u-boot spl
disk-image-uefi: riscv64 add ubuntu:ubuntu login, without expiry.
riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA.
riscv64: fixup subarch build, unbound variable
qcow2-image: unbreak builds without subarch.
disk-image-uefi: fix riscv64 subarch user-data.

LP: #1903034
2021-01-15 17:06:44 +00:00
Łukasz 'sil2100' Zemczak
4e8e1fed07 Ok, last commit didn't remove enough lines, sorry for that. 2020-12-03 18:21:57 +01:00
Łukasz 'sil2100' Zemczak
2029f49fe6 Still hardcode UC20 amd64 image size, but to the same value as for UC16 and UC18. 2020-12-03 12:22:31 +01:00
Łukasz 'sil2100' Zemczak
a4838e3245 Merge branch 'uc20-no-fixed-size' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/focal 2020-11-27 17:59:08 +01:00
Joshua Powers
ef950f5214
amd64: always install grub-pc with shim-signed
shim-signed depends on grub-efi-amd64-signed, which in turn has
alternative depends on either `grub-efi-amd64 | grub-pc`. However to
support booting with either via shim&signed-grub and BIOS, the choice
must be made to install grub-pc, not grub-efi-amd64.

This makes images consistent with Ubuntu Deskop, Live Server, buildd
bootable images; all of which already do install grub-pc and
shim-signed.

Additionally, this will ensure that autoremove is run after installing
anything in the CPC build hooks. This is done to avoid shipping images
that include packages that are autoremovable. This will clean-up as
packages are installed and detect any breakage at build time.

LP: #1901906
2020-11-13 09:07:12 -08:00
Łukasz 'sil2100' Zemczak
433c2363d8 Do not hard-code the UC20 amd64 image size anymore 2020-11-03 11:30:23 +01:00
Dimitri John Ledkov
2be2852ee0
auto/build: use setup|teardown_mountpoint to reduce duplication
(cherry picked from commit 109e6c6613aae4cbd4e8793709ab52c3cbce214c)
2020-10-05 10:32:15 +01:00
Robert C Jennings
e2ae9c245d
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.

(cherry picked from commit 84397b50989670c2cfff01de23a5a73e67cd4088)
2020-10-05 10:32:14 +01:00
Dimitri John Ledkov
ce5a138c79
seccomp: mount more up-to-date seccomp features
(cherry picked from commit 31861fd40dabd62e789aeb6d9e64b1ada7b908d8)
2020-10-05 10:32:12 +01:00
Dimitri John Ledkov
acc7e97f38
apparmor: mount more up-to-date apparmor features in the chroot.
(cherry picked from commit a14a31b7514e3f602f29f9af61e6b7bc97662dc2)
2020-10-05 10:32:10 +01:00
Robert C Jennings
39ebdf6902
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.

(cherry picked from commit 1ca11c979505ae1b8c4621f034d28070a2715293)
2020-10-05 10:32:07 +01:00
Robert C Jennings
136562b837
Handle seeded lxd snap with channel name for ubuntu-cpc:minimized (LP: #1889470)
The seed now specifies the lxd snap in focal as
'lxd=4.0/stable/ubuntu-20.04' which doesn't match the expectations of
the code with looks for lxd as the only snap in the seed for minimized
images.  This patch updates the pattern to accept 'lxd' or 'lxd=*'.
2020-07-29 14:55:19 -05:00
Iain Lane
54508e6583
Hack seeding of linux kernel in ubuntustudio/focal
ubuntustudio-default-settings in focal release has a Recommends to this
kernel, which makes it impossible to update the kernel later on, since
we would install the -updates and release kernel, which isn't allowed
and causes FTBFS. Hack out the focal-release kernel and let the rest of
the build process pull in the right one.

LP: #1884915
2020-07-21 16:23:39 +01:00
Łukasz 'sil2100' Zemczak
e611dfc1c4 Enable overrides of UC20 grade dangerous channels 2020-05-25 18:44:08 +02:00
Łukasz 'sil2100' Zemczak
225f2fe504 Fix indentation. 2020-05-07 10:48:51 +02:00
Dimitri John Ledkov
2d5f9581db ubuntu-image: fix focal+ pi images for armhf to use pi-armhf model name.
LP: #1876358
(cherry picked from commit 6e8b5b94c4a9f8db4afbaf566ebdb36110f08592)
2020-05-01 20:07:58 +01:00
Dimitri John Ledkov
dc456c240d Bump only the UC20 pc image to 8GB, and keep Pi images as small as possible.
LP: #1875430
(cherry picked from commit 668898d92c1a48ac4901661d0e5d7e4b117b09c0)
2020-05-01 20:07:46 +01:00
Dimitri John Ledkov
56ac1865f7 Switch Ubuntu desktop to only hwe-20.04 kernel flavour. 2020-04-16 01:30:31 +01:00
Łukasz 'sil2100' Zemczak
d2a2ac41a4 Use the raspi KERNEL_FLAVOUR for the raspi images. 2020-04-08 10:06:09 +02: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
Dimitri John Ledkov
910310dbbb Only install oem-20.04 kernel flavour on amd64, as it doesn't exist on other arches. 2020-03-13 20:18:16 +00:00
Łukasz 'sil2100' Zemczak
40c51f78b8 Switch to using the generic pi gadget repo for classic, use the main branches. 2020-03-06 11:57:47 +01:00
Łukasz 'sil2100' Zemczak
95772fd9df Merge branch 'ubuntu/master' of git+ssh://git.launchpad.net/livecd-rootfs into u-i-disk-info 2020-03-06 11:38:42 +01:00
Łukasz 'sil2100' Zemczak
e9170e053b Rename the raspi3 SUBARCH to raspi 2020-02-21 12:46:43 +01:00
Dimitri John Ledkov
17dc48cf65 Set uc20 image size to 10G. 2020-02-10 12:43:39 +00:00
Dimitri John Ledkov
438606c5e8 Encode CHANNEL specification in the UC20 model names. 2020-02-07 22:18:04 +00: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
Dimitri John Ledkov
f6ca600af2 Install oem-20.04 kernel flavour on Ubuntu Desktop builds. 2020-01-28 15:05:36 +00:00