10 Commits

Author SHA1 Message Date
Dimitri John Ledkov
d5a8116428
Add support for generic preinstalled images. LP: #1923832 2021-04-26 11:04:37 +01:00
Łukasz 'sil2100' Zemczak
1b0212a76c Use the full name of the 'boot' flag in parted calls 2021-02-24 12:58:08 +01:00
Dimitri John Ledkov
e8f53aabdf
disk-image.binary: however still build MBR image on amd64.
It is used to derive vagrant and ec2 images. I do wonder, if those
could be converted to derive from uefi one.
2020-11-18 00:09:08 +00:00
Dimitri John Ledkov
8e548f37d9
disk-image.binary: skip building MBR image on riscv64. 2020-11-17 23:40:53 +00:00
Dimitri John Ledkov
ff175e3f4a
disk-image.binary: actually skip building MBR image on EFI platforms.
The case is for arch:subarch combo, not just arch alone even if
subarch is empty. Thus currently on adm64/arm64/armhf ubuntu-cpc
builds mbr image is created and then ignored, as the convert to qcow2
hook prefers the uefi image whenever available.

Skipping building these correctly, should speed up the build a little
bit and use slightly less disk space.
2020-11-17 23:37:52 +00:00
Joshua Powers
b0c8b628b2
ubuntu-cpc: only install shim-signed, run autoremove
The CPC build hooks for amd64 incorrectly attempt to install shim-signed
in addition to grub-efi-amd64 and grub-pc. These latter two packages
conflict with each other. Instead shim-signed should install whatever
packages are required.

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.
2020-10-26 11:48:24 -07:00
David Krauser
83499f1a95 Add mechanism to detect initrdless boot fallback
In v2.672 the default boot behavior of cloud images changed:

- Prior to v2.672, cloud images with the linux-generic kernel attempt
  to boot without an initramfs, would fail, and then retry with an
  initramfs.

- After v2.672, cloud images with the linux-generic kernel boot with
  an initramfs on the first try.

While the behavior is different between the two, they both result in
an instance that has booted with an initramfs. To ensure the changes
in v2.672 do not regress, we need an automated way to check if we are
attempting to boot without an initramfs and failing.

With this change, when we attempt to boot with an initramfs and fail,
initrdless_boot_fallback_triggered is set to non-zero in the grubenv.
This value can be checked after boot by looking in /boot/grub/grubenv
or by using the grub-editenv list command.
2020-07-22 16:41:10 -04:00
David Krauser
4c504f6781 Fix broken minimal cloud image boot on amd64
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.
2020-07-16 17:25:46 -04:00
David Krauser
1ca1330eae Boot with an initramfs by default in cloud images
Generic cloud images with the linux-generic kernel are not able to
boot without an initramfs. Previously, these images attempted to boot
without an initramfs, would fail, and then retry with an initramfs.
This slows the boot and is confusing behavior.
2020-07-08 17:13:49 -04:00
Tobias Koch
cbd4eb5717 Use series files with dependency handling to generate hook symlinks dynamically
This patch currently only applies to the "ubuntu-cpc" project.
          
More and more logic has been going into the hook scripts to decide under which conditions they should run or not. As we are moving to parallelized builds of image sets, this will get even more complicated. Base hooks will have to know which image sets they belong to and modification of the dependency chain between scripts will become more complicated and prone to errors, as the number of image sets grows.
            
This patch introduces explicit ordering and dependency handling for scripts through the use of `series` files and an explicit syntax for dependency specification.
2018-12-10 09:18:02 +01:00