Commit Graph

242 Commits

Author SHA1 Message Date
James Le Cuirot
d1ba9b19fb
Switch from raw (.fd) EDK2 firmware images to QCOW2, plus 4MB on amd64
The new arm64 firmware supporting Secure Boot (see next commit) is in
QCOW2 format only, avoiding the extra space taken up by the 64MB
padding. Supporting both raw and QCOW2 images would be messy, so switch
entirely to QCOW2.

Only the 4MB images are in QCOW2 format on amd64, so also switch away
from the 2MB images. 4MB images are now the default for most
distributions as they are needed to apply certain Windows updates.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-11-12 11:59:40 +00:00
Mathieu Tortuyaux
c80760c999
Merge pull request #1783 from flatcar/kai/proxmox-support
OEM: Provide Proxmox images
2024-11-12 12:52:31 +01:00
Mathieu Tortuyaux
6e674b26d3
oem: provide proxmox images
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2024-11-12 12:51:36 +01:00
James Le Cuirot
bcd203ebcb
app-crypt/efitools: Drop in favour of app-emulation/virt-firmware
virt-fw-vars handles X.509 conversion and QCOW2 conversion transparently
and can update all the variables in a single invocation.

Bonus: Asking it to list the variables doesn't cause a segfault due to
the feature not really being implemented. :D

The 00000000-0000-0000-0000-000000000000 owner GUID is what flash-var
used to set, as we didn't specify the -g argument. We don't need to set
a meaningful value as this file is only for testing.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-11-06 12:04:18 +00:00
James Le Cuirot
1d7d53fad9
Upgrade to Catalyst 4
Catalyst 4 has totally changed the way repositories are handled. It only
works when the name of the directory containing the repository matches
the configured name of that repository. This was not the case for us,
with the coreos repository residing in the coreos-overlay directory. We
wanted to move and rename our repositories anyway, but this is a big
change, so we'll do separately. For now, this just renames coreos to
coreos-overlay.

Catalyst 4 also ingests the main repository snapshot as a squashfs
rather than a tarball. It features a utility to generate such a
snapshot, but it doesn't fit Flatcar well, particularly because it
expects each ebuild repository to reside at the top level of its own git
repository. It was very easy to call tar2sqfs manually though.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-07-15 14:27:59 +01:00
Jeremi Piotrowski
14f1c4f735 grub_install: Remove core.{elf,efi} after copying
We currently carry multiple copies of the same grub core.elf or core.efi
on the boot partition. Save some space by removing duplicates that are
never used at runtime. CPIO build needed to be adapted because it
publishes grub efi files.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2024-06-21 11:04:35 +03:00
Mathieu Tortuyaux
441e10bec5
oem: provide akamai images
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2024-06-19 15:37:57 +02:00
Adrian Vladu
6efe345d89 image: add kubevirt image build
As Ignition supports KubeVirt, add a custom oem for it and also the
required parts to be able to build an image in .qcow2 format that
is already using internal .qcow2 gzip compression.

Fixes: https://github.com/flatcar/Flatcar/issues/1358

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
2024-04-30 09:19:16 +03:00
Mathieu Tortuyaux
9f02c8d262
vm_image_util: produce qcow2 images for Scaleway
For importing Scaleway images, extension needs to be '.qcow2'

See: https://www.scaleway.com/en/docs/compute/instances/how-to/snapshot-import-export-feature/
> Make sure that the QCOW / QCOW2 image file you want to import,
> uses the file extension .qcow or .qcow2 to avoid issues while importing the image.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2024-04-26 09:47:29 +02:00
Mathieu Tortuyaux
5c2a8cf8b9
vm_image_util: add IMAGE_DISK_EXTENSION variable
This variable allows to override the disk extension which is initially
based on the DISK_FORMAT.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2024-04-26 09:47:29 +02:00
Mathieu Tortuyaux
0d4031a6d8
Merge pull request #1880 from apricote/hetzner
OEM: Provide Hetzner Images
2024-04-17 15:17:33 +02:00
Kai Lueke
2e3f175fc1 build_library: Use original qemu image name in qemu script
The move to symlinking to the qemu-uefi image also resulted in the
qemu-uefi image being referenced in the qemu-bios and qemu-uefi-secure
scripts instead of referencing the image symlinks. Same for the VM name
shown in the qemu window title.
When generating the qemu scripts, use the original qemu image name and
VM name.
2024-04-17 12:19:08 +09:00
Julian Tölle
48c81bc978 oem: provide hetzner images 2024-04-16 17:08:04 +02:00
Kai Lueke
286a8ca4c1 Skip non-UEFI qemu image symlink/script for arm64
We didn't generate this before and don't need it.
2024-04-10 16:42:36 +09:00
Kai Lueke
de4eb8f755 Set up symlinks for same image artifacts to remove qemu/qemu_uefi_secure
The qemu and qemu_uefi_secure images have the same contents as the
qemu_uefi image which wastes space on the release server. A similar
case is the PXE vmlinuz which is the same as the regular one, too.

Set up symlinks for same images, and also detect this when compressing
to set up symlinks there as well. To reduce complexity, the qemu and
qemu_uefi_secure images are not supported anymore and the Jenkins or
GitHub CI will skip over them if specified. Users that build their own
images need to adapt, though.
2024-04-09 15:09:29 +02:00
Adrian Vladu
7d4917d67c image_to_vm: add support for hyper-v vhdx format
Add support for Gen 2 Hyper-V VMs.

`./image_to_vm` tool has now a new supported format: `hyperv_vhdx`,
that produces .vhdx dynamic disks.

How to use:

```bash
 ./image_to_vm.sh --from ../build/images/amd64-usr/developer-latest/ --format hyperv_vhdx
```

See: https://github.com/flatcar/Flatcar/issues/1009

Uses PR: https://github.com/flatcar/bootengine/pull/92

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
2024-04-09 10:52:06 +03:00
Kai Lueke
7379db37e8 vm_image_util.sh: Bump default VM memory to 2 GB
While Flatcar itself runs fine with 1 GB, many workloads do not and
having to debug this is time consuming when one forgets to bump the VM
memory, e.g., in the Qemu script.
Default to 2 GB as known-good setting for things like Kubernetes or
setting up LUKS devices.
2024-04-04 12:55:37 +09:00
Kai Lueke
1513f3a966 Remove ACI image building bits
The ACI OEM container image was used with rkt for GCE. For long time
this has been migrated to systemd-nspawn and now systemd-sysext.
Remove the unused build library code.
2024-04-03 16:18:56 +09:00
Jeremi Piotrowski
9b50112c5a build_library: Reduce xattr spam when creating cpio
Mksquashfs running against a btrfs filesystem tries to capture btrfs specific
xattrs (btrfs.compression) generating a lot of spam. Remove the spam by
ignoring btrfs xattrs.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2024-03-15 09:26:36 +01:00
Mathieu Tortuyaux
1017216cbe
oem: provide scaleway images
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2024-03-05 13:51:07 +01:00
Jeremi Piotrowski
6ff9f8b098 Add support for secure boot in qemu_template.sh
We have an existing qemu_uefi_secure format definition, but it is
necessary to update it so that it actually works. Qemu needs to be
passed the correct flags to enable SMM, we need to switch to the Q35
machine, and we need to copy over the secboot variant of the OVMF
firmware.
2024-02-26 12:01:09 +01:00
Jeremi Piotrowski
8019f7fd9f vm_image_util.sh: update path to arm64 UEFI firmware
The arm64 firmware is now called AAVMF with the updated edk2-aarch64
ebuild.
2024-02-26 12:01:09 +01:00
Mathieu Tortuyaux
1cb7be951d
coreos-base/oem-gce: remove ACI built image
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-12-04 18:16:06 +01:00
Mathieu Tortuyaux
5cfbf6e1eb
coreos-base/oem-gce: migrate gce to sysext format
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-12-04 18:15:58 +01:00
Kai Lueke
87ff566aae Use OpenStack image for Brightbox
The special Brightbox image uses the OpenStack userdata in Ignition but
lacked Afterburn usage. It actually works to use the OpenStack image and
directly which also enables Afterburn, thus we can drop the special
image.
Don't build a special image for Brightbox but recommend to use OpenStack
images directly. A symlink is added to help with the download of
hardcoded user scripts.
2023-11-15 13:33:55 +01:00
Mathieu Tortuyaux
b36cb28768
overlay coreos-base/oem-packet: migrate to sysext format
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-10-09 14:35:08 +02:00
Mathieu Tortuyaux
989d20a2f1
overlay core-base/oem-digitalocean: migrate to sysext format
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-10-09 14:35:07 +02:00
Mathieu Tortuyaux
57e7b5aebc
overlay coreos-base/oem-openstack: add oem-openstack
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-10-09 14:35:07 +02:00
Mathieu Tortuyaux
ce2c0e7475
overlay coreos-base/oem-ami: new sysext image
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
2023-09-26 13:34:09 +02:00
Kai Lüke
9ffceaf3fe
Merge pull request #1132 from krishjainx/qcow2-inline-compression
Allow use qcow2 inline compression
2023-09-25 17:37:15 +02:00
Krzesimir Nowak
fa3dc6b649 build_library/vm_image_util: Opt VMware OEM into sysext images 2023-09-20 09:18:43 +02:00
Kai Lueke
d711725fe0 vm_image_util: Fix variable quoting to create correct OEM sysext file
The OEM sysext image file in the OEM partition had the version variable
name being part of the filename instead of the substituted version value
because of wrong quoting when the fixed string got replaced by ${…}.
2023-09-14 11:46:40 +02:00
krishjainx
2124f63dcb Allow use qcow2 compressed format in place of additional compressed layer 2023-09-12 11:21:08 -04:00
Kai Lueke
995ae2cdbc Support OEM systemd-sysext images and Flatcar extensions
The vendor tools on the OEM partition weren't updated. We now want to
ship them as systemd-sysext images which we can easily update. This
change extends the Flatcar A/B update mechanism to cover the OEM
systemd-sysext images. The same mechanism is also able to support
"official" Flatcar extensions, e.g., a ZFS extension.
2023-09-08 14:50:43 +02:00
Thilo Fromm
1f2706d44e build_sysext: guess image build dir and auto-create it
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-07-07 14:49:50 +02:00
Thilo Fromm
190fd2c38e build_sysext: bugfixes, QoL changes, help updated
This change improves build_sysext by sourcing a missing lib dependency,
adding a number of comfort / quality-of-life options, and updating the
output of '--help' accordingly.

The OEM sysext finction in build_library/vm_image_util.sh is also
updated to use new command line format.

1. Include missing dependency toolchain_util.sh to fix an error in
   board_options.sh (get_board_arch undefined).
2. Use positional parameters for mandatory arguments.
   build_dir and sysext_name are mandatory and are now positional
   arguments instead of options.
   binary_package is the third positional argument but can be omitted
   if --metapkgs was specified.
3. --squashfs_base is now guessed better and will use the most recent
   build by default.
4. A new boolean flag --ignore_version_mismatch for the more daring
   developer was added. The flag will cause the script to continue if a
   version mismatch between SDK board packages and squashfs base is
   detected.
5. Error messages were improved for when mandatory parameters were not
   provided.
6. The '--help' message was improved and adjusted to the new parameters.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-07-07 11:44:39 +02:00
Krzesimir Nowak
00ac7586a4 *: Remove support for niftycloud OEM 2023-07-05 14:34:17 +02:00
Krzesimir Nowak
ad0360e744 *: Remove support for interoute OEM 2023-07-05 14:33:26 +02:00
Krzesimir Nowak
ec723be9d9 *: Drop unused pkgdb stuff 2023-07-05 08:43:25 +02:00
Krzesimir Nowak
16fee4f5b1 build_library/vm_image_util.sh: Switch OEM sysext image building to build_sysext 2023-07-05 08:43:25 +02:00
Krzesimir Nowak
8c2883114a build_library/vm_image_util.sh: Set up a path to sysext base image 2023-07-05 08:40:15 +02:00
Kai Lueke
af4daf3516 Upload dev-key-signed OEM sysext update payload
For release tests and updating a machine to a dev build we already have
the dev-key-signed generic update payload but not yet the OEM sysext
update payload.
Generate the dev-key-signed OEM sysext update payload during build and
upload it.
2023-06-14 18:30:48 +02:00
Kai Lueke
f790e3e648 build_library: For now don't use a version for the OEM sysext image
The initial MVP of the OEM sysext usage we release won't have updates
for the sysext image and, therefore, it is not bound to the OS version.
The special name suffix instead of the version hints bootengine at using
it if no matching version is found. The name will also be used at hint
for update-engine to clean it up when versioned sysext images arrive.
2023-06-14 13:00:30 +02:00
Krzesimir Nowak
23df3170ff build_library: Force initial version of OEM sysexts for now
We don't have an update process of the OEM sysexts implemented yet, so
use a fake "initial" version for them and make them independent from
OS version.
2023-06-06 15:10:07 +02:00
Krzesimir Nowak
8b17ca2b02 overlay coreos-base/oem-qemu: Make it a sysext package
It isn't doing much as nothing QEMU-specific was being installed into
the OEM partition.

With that done, we opt into building an OEM sysext image for QEMU
platform.
2023-06-06 15:10:07 +02:00
Krzesimir Nowak
995910cd78 overlay coreos-base/oem-azure: Make it a sysext package
This package will be used for the sysext image, instead of for
installing files into /usr/share/oem. This means that we can drop some
files or move them elsewhere. The systemd service file is not needed,
because it is installed by the app-emulation/wa-linux-agent package
now. This also means that the ignition file as lost its purpose. The
grub.cfg and oem-release must be installed in /usr/share/oem, next to
the sysext raw image file, so handling of these files is moved to the
newly added coreos-base/common-oem-files package. `eject` symlink to
`/usr/bin/true` is installed in the newly added manglefs.sh script.

With this done, we also opt into building an OEM sysext image for
Azure platform.
2023-06-06 15:10:07 +02:00
Krzesimir Nowak
46b98ba0d2 image_to_vm: Require pkgdb tarball and handle sysext building 2023-06-06 13:01:09 +02:00
Krzesimir Nowak
33d2af5600 build_library: Adapt to /oem being the new OEM partition mountpoint
This requires us to add another directory to keep when removing a
regenerable state from rootfs. Other changes were straightforward find
and replace.
2023-05-30 15:53:17 +02:00
Krzesimir Nowak
fa48f70a37 *: Make catalyst and emerge verbose by default
That way we can see a report of what emerge is going to do and the
status of the use flags for the installed packages. The downside is
that we are going to have reports about using deprecated and
unsupported profile in even more places.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
520b92ad7e *: Expand short emerge flags and use bash arrays
Emerge flags are cryptic in general, but short flags even more so, so
expand them. While at it, I noticed some places where bash arrays
could be used, so convert those places too.
2023-02-16 13:57:05 +01:00