Commit Graph

1091 Commits

Author SHA1 Message Date
Krzesimir Nowak
b7e13a2160
Merge pull request #1434 from flatcar/krnowak/debug-output
Print debug output on any error
2024-02-20 17:39:18 +01:00
Krzesimir Nowak
ab43658d60 overlay: Fix references to moved packages 2024-01-16 12:55:15 +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
5590da400e build_image_util: Store path list for recreating tmpfiles rules
The removal of files in the overlay present in the lowerdir creates
whiteout entries that mask the lowerdir entries. For those files that
have a tmpfile rule for creation, a reboot would cause the file to be
created in the upperdir, meaning this file is not updated from the
lowerdir when it changes. In addition we have filtered out some tmpfile
rules that caused upcopies (symlinks and directories) which meant that
removing the /etc/resolv.conf symlink didn't bring it back after reboot.
To make files from the lowerdir show up if they have a tmpfile rule that
normally would recreate them we keep a list of whiteout entries that we
clean up on boot. This also prevents freezing files because
systemd-tmpfiles does not need to recreate them in the upperdir.
2023-11-30 11:57:27 +01:00
Krzesimir Nowak
cc60a22da8 common: Print debugging info along the backtrace
Recently we had some problems with read-only filesystems, that pop up
in different places. It may be easier to catch if the debugging info
is printed in an error case instead of just one specific location.
2023-11-29 13:15:13 +01:00
Kai Lueke
317ad876e2 build_library/sysext_prod_builder: Add debug output
We see occasional failures due to a read-only filesystem on GitHub
Action runners:
  mkdir: cannot create directory ‘/home/sdk/trunk/src/scripts/artifacts/amd64-usr/developer-3790.0.0+nightly-20231116-2100-5-g49eb1a4c07-a1/rootfs/usr/share/flatcar/sysext’: Read-only file system

Add commands for a debug output.
2023-11-17 17:43:09 +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
Thilo Fromm
bea69017fa test_image_content.sh: remove 202209-12 exception (grub)
We updated grub to >=2.06 and thus 202209-12 can be removed from the
GLSA allowlist.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-11-08 09:19:05 +01:00
Thilo Fromm
456b3687ed sysext_prod_builder: Add suggestions from PR review
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-30 17:21:26 +01:00
Thilo Fromm
383e6097dd build_library/sysext_prod_builder: improve error message
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-30 17:21:26 +01:00
Thilo Fromm
9f45ea05e9 app-containers: use upstream docker, containerd, runc
This change removes Flatcar specific builds of docker[-cli], containerd,
runc, and cri-tools and instead switches to upstream Gentoo ebuilds
added to portage-stable.

The change updates docker to 24.0.6.

NOTE that there currently is no upstream ebuild for containerd-1.7.7, so
this change adds that ebuild based on the upstream containerd-1.7.6
ebuild.

Flatcar customisations like systemd units etc. are now applied in the
manglefs script of the respective sysexts, based on file system trees in
coreos-overlay/coreos/sysext/(containerd|docker).

The build_sysext script has been extended by an option to strip all
binaries in a sysext; the option is active by default. This takes care
of removing debug symbols from docker and containerd - which are not
removed by the default Gentoo build. The overall size of both containerd
and docker sysext is reduced by ~50%.

Lastly, the sysext command line syntax of build_image has been extended
to allow specifying multiple packages for a sysext. This was necessary
because docker-cli and docker do not have any runtime relationships and
therefore must both be specified for installation to correctly mirror
Flatcar's own docker packaging.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-30 17:21:26 +01:00
Thilo Fromm
c2d1c13abd Apply bash scripting suggestions from code review
Thank you Krzesimir!

Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
b775036a62 torcx removal: address PR comments
- updated github actions for runc, containerd, and docker to not handle
  nonexistent ebuilds in app-torcx/ anymore
- removed spurious package_run_dependencies from build_image_util.sh
- build_sysext: generate pkginfo before mangle script runs
  use zstd for compression; add cli flag to select compression
- ci_automation_common.sh: remove spurious `/` from match string
- coreos, board-packages, bootengine: bump ebuild revisions
- kernel commonconfig: add squashfs zstd support

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
6f651a298c build scripts: separate txt inventory; official naming for sysexts
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
89555ed2bd base OS sysexts: separate build script, inventory generation
This change refactors base OS sysext builds to use a separate build
script `build_library/sysext_prod_builder`, which is called from
`build_library/prod_image_util.sh` when `build_image` runs.

This allows for better separation of cleanup traps: prod image sysext
builds need its own trap / cleanup function for temporary build
directories and loopback mounts.

Prod sysext builds properly generate lincense and SBOM information, and
provide detailed file listings and disk space usage stats.

- SBOM / licenses JSON now include all packages of the
  final image, i.e. a combined list of base image and all base OS
  sysexts.
- Packages lists, files list and detailed files list include the sysext
  squashfs files for the base image, and separate sections with files /
  packages lists for each sysext.
- Disk usage contains both final disk image usage as well as usage of
  each individual sysext squashfs.
2023-10-23 16:05:45 +02:00
Thilo Fromm
8e01a2c8f9 build_image: add sysext command line option
This change refactors sysext builds during build_image and generalises
the code (no hard-coded containerd and docker anymore).

A command line option is added to build_image for sysexts to include in
the OS image. It defaults to containerd and docker but may be set to
arbitrary packages. The command line supports simple depenencies, i.e.
the "docker" sysext will re-use package information from the
"containerd" sysext and not include another containerd.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
8f8f262f19 torcx: remove from scripts, use docker+containerd sysexts
This change removes torcx libraries, references, and commandline options
from build automation scripts and from build_library/.

Containerd and docker are shipped via sysexts which are included in the
base image.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
aae3fd8260 prod_image_util.sh: remove pkgdb tarball (replaced by sysext)
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Thilo Fromm
9cede02f86 dev_container_util.sh: remove spurious DEVCONTAINER=1
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-10-23 16:05:45 +02:00
Krish Jain
cc029bb5ca use DEVCONTAINER=1 2023-10-23 16:05:45 +02:00
Krish Jain
3c4639b0ce use sudo_clobber function 2023-10-23 16:05:45 +02:00
Krish Jain
298e283944 fix permissions issue 2023-10-23 16:05:45 +02:00
Krish Jain
4633cc3e7c Fix syntax errors, quoting 2023-10-23 16:05:45 +02:00
Krish Jain
f6f5c32417 add information about the packages contained in the built sysext 2023-10-23 16:05:45 +02:00
Krish Jain
fe949f5900 Make sure binary packages are built in build_packages already 2023-10-23 16:05:45 +02:00
Krish Jain
4e8b276319 Remove duplicate making directory root_fs_dir/etc/extensions 2023-10-23 16:05:45 +02:00
Krish Jain
abe8bf683a Use helper function query_available_package() 2023-10-23 16:05:45 +02:00
Krish Jain
4b00bc14a4 tail, not head 2023-10-23 16:05:45 +02:00
Krish Jain
9709a64239 incorporate suggestions from Jeremi 2023-10-23 16:05:45 +02:00
Krish Jain
2be2e884b3 Add manglefs script for containerd 2023-10-23 16:05:45 +02:00
Krish Jain
3d17f65088 Create seperate docker and containerd sysext 2023-10-23 16:05:45 +02:00
krishjainx
851009c6cc Install docker as a system extension, use manglefs script ( convert the unit dependencies from wants to upholds); one sysext for all docker for now 2023-10-23 16:05:45 +02:00
Kai Lüke
a85e51b03d
Merge pull request #1170 from flatcar/kai/usr-btrfs
disk_layout: use btrfs for the /usr partition
2023-10-20 13:26:21 +02:00
Krzesimir Nowak
c23dde1713 build_library/grub_install: Try mounting ESP directory in a loop
Apparently successful `[[ -b "${LOOP_DEV}p1" ]]` check is not enough -
the mount can still fail. So instead of doing those checks, try
mounting and reprobing in the loop with some small exponential
backoffs.
2023-10-13 08:38:11 +02: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
Thilo Fromm
17512925e7 SDK prefix: implement suggestions from code review
- remove explicit "-multilib" from prefix keywordsas it is set in
  profile
- split heredoc for generating emerge wrapper so we don't need to
  escape
- add sys-apps/bubblewrap and virtual/tmpfiles to package update
  automation list
- use prefix build fix for libgpg-error from upstream

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-09-29 15:22:45 +02:00
Thilo Fromm
ba4342d2b7 Apply suggestions from code review
Thank you @krnowak! Great review and awesome feedback, as always.

Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2023-09-29 15:22:45 +02:00
Thilo Fromm
a4d4a94068 Flatcar SDK: add experimental prefix builds
This change adds experimental prefix builds to the Flatcar SDK.

Prefix builds use a custom sys prefix path and emerge all binaries and
runtime dependencies into that prefix.

This path can then e.g. be shipped as a portable sysext since it
includes all dependencies, and has libraries at a custom path so these
do not conflict with libraries on target systems.

Prefix uses a staging environment (path) featuring a full-blown
development environment, and a "final" environment for installing.
Staging and final need to be created using setup_prefix first,
which will also create an emerge wrapper to emerge ebuilds into staging
and subsequently final. The root fs in final may then e.g. be used to
create a distro independent, portable sysext.

Co-authored-by: James Le Cuirot <chewi@gentoo.org>
Co-authored-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Co-authored-by: Thilo Fromm <thilofromm@microsoft.com>
2023-09-29 15:22:45 +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
Kai Lüke
04dbadea3b disk_layout: use btrfs for the /usr partition
The compression feature of btrfs allows us to store more in the
size-limited /usr and OEM partitions. The size should of course still
be monitored to not bloat the image but more headroom helps to try
things out quickly without hitting the hard limit which fails the
build.
Use btrfs with zstd compression for the /usr partition. While for ext2
a hack exists to force read-only mounts by manipulating some bytes of
the filesystem, on btrfs we can use the subvolume read-only flag
instead which also works for the default top level subvolume. However,
it also makes also sense to mount the filesystem with the "norecovery"
mount option to prevent any write attempts even when the "ro" option is
set (not needed when using dm-verity in read-only mode but when
directly mounting without dm-verity). A new subvolumes is not created
because subvolumes don't offer anything special as long as we use the
A/B partition update mechanism (but they could be an alternative for
that). Note that switching to the btrfs on the /usr partition is only
possible when the Flatcar Stable release has all patches in
update-engine and seismograph's rootdev.
2023-09-25 12:56:04 +02:00
Krzesimir Nowak
fa3dc6b649 build_library/vm_image_util: Opt VMware OEM into sysext images 2023-09-20 09:18:43 +02:00
Krzesimir Nowak
7b2199c24a build_library/build_image_util: Fix locale generation
The `localedef` tool expects `/usr/lib/locale` directory to
exist. This directory used to be created by the `sys-libs/glibc`
package (with the `keepdir` directive), but after the update of the
package, the locale generation stuff (and the `keepdir` directive )was
moved to the `sys-libs/locale-gen` package. This package is not
installed in the production images, so the `/usr/lib/locale` directory
was not created. In such a situation, calling localedef to generate
C.UTF-8 locale resulted in an error like:

cannot create temporary file: ${SOME_ROOTFS}/usr/lib/locale/locale-archive.ufpG15: No such file or directory

Create the directory before calling localedef to fix the problem.
2023-09-15 16:14:29 +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
Sayan Chowdhury
abb6bdb682
build_library/grub: Remove the grub modules not ported/removed
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
2023-08-24 13:22:41 +05:30