Commit Graph

339 Commits

Author SHA1 Message Date
Daniel Zatovic
820bc74c3b sysext: Change the sysext seperator from : to |
To be able to use the SLOT syntax, which uses : we need to change the
sysext seperator to |.
2025-05-13 11:26:09 +02:00
James Le Cuirot
80dfea84b0
Revert "build_image: Temporarily nobble condition around generate_update"
This reverts commit 94f95acdc7.
2025-03-21 18:02:38 +05:30
James Le Cuirot
94f95acdc7
build_image: Temporarily nobble condition around generate_update
Once we have passed the shim review, we will delay this task until the
kernel has been signed later in the pipeline.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-12-23 13:01:22 +00:00
James Le Cuirot
aa70fc929f
Delay generating test update payload in official builds
The update payload needs the kernel, which isn't signed during the image
job. Secure Boot is not currently enabled for update tests, but we may
as well do this properly. The production update upload is generated
manually at the end after everything has already been signed.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-12-20 16:29:32 +00:00
James Le Cuirot
e44b946abf
build_image: Deduplicate --extract_update and --generate_update options
The --extract_update option used to do exactly that, just extract the
USR-A partition for updates and no more. Now it does the same thing as
--generate_update, except it names the file flatcar_test_update.gz
rather than flatcar_production_update.gz. --generate_update is never
actually used because official update payloads are manually generated
with the generate_payload script later on.

Resolve this confusion by deduplicating the common code between them.
Any update payload produced during this stage of the build is only
useful for testing, so change --generate_update to always create
flatcar_test_update.gz. --generate_update now implies --extract_update
and both are enabled by default.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-12-03 16:01:19 +00:00
James Le Cuirot
9f8eac6540
Drop lots of obsolete release signing and upload code
Most of this hinges on the --upload option being passed, and it never is
any more. Much of it also uses Google Buckets, which we no longer use,
save for some GCE-specific bits.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
2024-11-26 14:58:24 +00:00
Krzesimir Nowak
9a3e26bf9b build_image,ci-automation: Add app-containers/docker-buildx to docker-flatcar sysext 2024-09-02 14:05:56 +02:00
Jeremi Piotrowski
79294342a9 build_library: Place EXTRA_SYSEXTS in a separate file
This allows it to be sourced from other scripts and used e.g. in
generating an image changes summary.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2024-03-11 12:51:09 +00:00
Jeremi Piotrowski
1bb108e326 build_image: Allow building sysexts for an existing image
by skipping the check for an existing image directory if we're not
building an image. This makes './build_image sysext' work.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2024-03-11 11:57:45 +00:00
Jeremi Piotrowski
5d5dd59102 build_image: Build sysext store after image when requested
This function is meant to prebuild certain sysexts to be released along
with each release. These will not be built into the image, but instead
can be fetched by the user on demand.

The command to build sysexts would be:

  ./build_image prod sysext

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2024-03-11 11:57:45 +00: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
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
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
flatcar-ci
7d76cfedf7 ci-automation + setup_board: publish and use binpkgs
This change adds a job for publishing binary packages to the build cache
server to the ci automation.

Also, setup_board is updated to use the buildcache package cache if a
nightly build version is detected.

Signed-off-by: flatcar-ci <infra+ci@flatcar-linux.org>
2022-01-07 17:16:44 +01:00
Thilo Fromm
9fba5789f9 ci-automation: simplified CI automation unsing containers
ci-automation builds on the SDK container and simplifies CI automation
build tasks (SDK bootstrap, SDK container, packages, image, VMs).

See ci-automation/README.md for a brief introduction.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-11-26 17:54:43 +01:00
Thilo Fromm
eaff2d47eb build_image: add binhost option for dev container
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-10-05 16:38:43 +02:00
Krzesimir Nowak
6ed7cd66d5 *: Drop jobs parameter
The `--jobs` parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to `${NUM_JOBS}` set by `common.sh`. Also, even if the
`--jobs` parameter was used for some script, that script usually
didn't forward the jobs value to other scripts, so the other scripts
ended up using `${NUM_JOBS}` again. Also, the `${FLAGS_jobs}` variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
`${FLAGS_jobs}` variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs `emerge` uses, export the `NUM_JOBS` environment variable
before calling any script.

For `EMERGE_FLAGS` and `REBUILD_FLAGS` we unconditionally specify the
`--jobs` flag's value to `${NUM_JOBS}` because they are passed to
`emerge`. On the other hand we drop the `--jobs` parameter from the
`UPDATE_ARGS` variable, because this variable passed to `setup_board`
or `update_chroot`, which don't have this flag any more.
2021-02-17 13:26:36 +01:00
Kai Lüke
42068f1cbc
build_image: Add prodtar command to build a tar ball
Create a tar ball with the contents of the / and /usr partitions
to be used as follows with systemd-nspawn (via machinectl):
  machinectl import-tar flatcar-container.tar.gz flatcar-container
  machinectl start flatcar-container
  machinectl shell flatcar-container
or with docker by converting it to an OCI image:
  docker import -c "CMD /bin/bash" flatcar-container.tar.gz flatcar-container

Since the new "prodtar" command relies on the results of the "prod" command,
it bundles it so that "prod prodtar" and "prodtar" is the same.
2020-02-07 17:33:37 +01:00
Flatcar Buildbot
1dad511f69 2317.0.1 2019-11-07 19:40:01 +01:00
Andrew Jeddeloh
16d5f05275 build_image: rename dev_image to dev_container 2018-07-25 13:11:17 -07:00
Andrew Jeddeloh
1718adb22a *: remove dev image
The dev image has been broken for some time. Some bits are left because
the dev container (not broken) still uses them. They should be renamed.
2018-07-25 13:11:17 -07:00
Andrew Jeddeloh
935466b68d *: remove restart_in_chroot_if_needed
Replace calls to restart_in_chroot_if_needed with assert_inside_chroot.
This removes a dependency on chromite.
2018-05-30 13:07:58 -07:00
Andrew Jeddeloh
370b7d9fdc *: make prod images default
Make prod images default instead of dev images. Additionally, clean up
some of the flag logic around the --dev_image flag in image_to_vm.sh
2017-12-18 13:26:39 -08:00
Euan Kemp
d3867403ed build_image: populate torcx store from manifest
This moves the default symlinking logic into build image as well.

This assumes that a torcx store is available locally with all images
referenced in the torcx manifest.

This is accomplished with a highly-indented double-for-loop, but I think
it's still decently readable.
2017-09-08 16:58:51 -07:00
David Michael
a0bebcc38b build_image: copy torcx images into the vendor store
This adds the option --torcx_store to specify the path to a
directory containing torcx images to be baked into the OS image.  A
blank string can be given instead of a path to restore the previous
behavior and leave an empty vendor store.

The default value is the default path created by build_torcx_store,
which is used when build_packages updates torcx images.  This means
that the current pattern "./build_packages && ./build_image prod"
should result in a fully updated OS image with all torcx images
available in the vendor store.
2017-06-02 14:23:03 -07:00
Benjamin Gilbert
c98788befc image_to_vm: Default to qemu_uefi on ARM
qemu makes no sense on that platform.
2017-05-02 15:02:09 -07:00
Michael Marineau
74edf63449 Merge pull request #611 from glevand/for-merge-arm64-verity
scripts: Add arm64 verity support
2017-01-30 11:07:21 -08:00
Euan Kemp
302e5bd405 build_image: specify arguments more clearly 2016-12-19 14:22:47 -08:00
Geoff Levand
4ca0c5bc19 build_image: Cleanup enable_rootfs_verification
To clean things up and prepare for arrm64 support move
all the enable_rootfs_verification processing into one
location and add some comments.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-12-13 13:46:05 -08:00
Geoff Levand
0ef44633ef build_image: Remove enable_verity flag
To make verity work both enable_rootfs_verification and enable_verity
need to be set.  Without one verity just gets half enabled.  Remove
the enable_verity flag and do the full verity setup when
enable_rootfs_verification is set.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-12-13 13:46:05 -08:00
Michael Marineau
edfc39c2af build_image: re-enable verity by default 2016-10-20 15:02:54 -07:00
Michael Marineau
4ed9a1a2a5 build_image: disable verity again
The Xen loader in GRUB never received support for our hacky scheme of
adding the verity hash to the kernel cmdline. Disable till that's fixed.

Partially reverts 2016567 and 533b1b9.
2016-10-10 14:08:05 -07:00
Michael Marineau
533b1b9b02 build_image: always enable verity when /usr is read-only
Consolidates two very similar flags into one and fix an issue where
verity could get enabled in the GRUB config when rootfs verification was
turned off (e.g. on arm64 which cannot use verity yet).
2016-09-30 15:35:10 -07:00
Michael Marineau
2016567d6f build_image: enable verity by default 2016-09-28 17:06:30 -07:00
Geoff Levand
c053521e37 build_image: Fix image type conditional
PROD_IMAGE is a flag that indicates a production image should be
built, and will be set for dev builds if the user specifies that
both dev and prod images should be built.  build_image was
incorrectly using the PROD_IMAGE variable to conditionaly do some
setup depending on the image type.

Add a new variable IMAGE_BUILD_TYPE that can be tested for the type
of image currently being built and replace the PROD_IMAGE usage.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-05-03 14:06:14 -07:00
Michael Marineau
678c37c3c2 build_image: disable verity on arm64
Our current scheme injects the verity hash into a free spot in x86
kernel images. This is a bad thing to try on other types ;-)
2016-05-02 11:35:48 -07:00
Matthew Garrett
9ae9ce8332 Increase the size of /usr on devel images
devel images contain significantly more code and we're overflowing the
filesystem. Increase this, but only for devel images.
2016-04-27 13:40:36 -07:00
Michael Marineau
743d4bce37 build_image: Add support for --getbinpkg
Allows build_image to be used without first running build_packages.

Note: setup_board --force is required before build_packages will work
properly after doing this since baselayout won't be installed otherwise.
2016-02-20 14:26:50 -08:00
Michael Marineau
ab3f1ee0b8 build_image: remove hack to work around an old bug 2016-02-20 14:14:16 -08:00
Michael Marineau
9ab853a668 build_image: remove eclean, run in build_packages instead
Allows the binary package cache to be preserved when using build_image
without a fully populated board root.
2016-02-20 14:11:41 -08:00
Michael Marineau
5ba4c7181d *: drop usage of COREOS_VERSION_STRING
This variable was semi-deprecated ages ago so `version.txt` could follow
a similar variable naming pattern to `os-release`. Finally drop usage of
it here in favor of `$COREOS_VERSION`.
2016-02-15 13:55:55 -08:00
Michael Marineau
f6064d52e8 build_image: fix generation of version.txt
The generation of version.txt was the only thing depending on sourcing
the deprecated BUILD, BRANCH, and PATCH values from version.txt which
common.sh no longer does since 0b6acf86. Derive them instead.
2015-12-02 12:32:34 -08:00
George Tankersley
283452e883 verity: add verity plumbing and hash injection to build scripts 2015-07-01 17:34:11 -07:00
techdragon
79ce0a3304 Enhanced dev_image_util with equivalent to --base_pkg
- "./build_image prod" already has the ability to specify which package will specify all the packages that should be pulled in and built into an image by specifying a package name using the --base_pkg command line flag. This creates an equivalent option for "./build_image dev" creating a --base_dev_pkg flag that passes a package name into the create_dev_img() function in dev_image_util.sh the same way that --base_pkg is passed into create_prod_image() inside prod_image_util.sh.
2015-03-02 13:21:56 +08:00
Alex Polvi
1854bc2028 build_image: add ability to pick different base package 2015-01-02 15:07:52 -05:00
Michael Marineau
d443daa168 grub: the one bootloader to rule them all
This uses our new GRUB2 features to handle GPT priority partition
selection, terminal selection, OEM tweaks, etc. The old SYSLINUX and
PV-GRUB configs are now unused except for maintaining compatibility
with older installs. Of the old configs only the ones that
coreos-postinst copies are needed. The new setup supports using GRUB2
under Xen, giving us automatic fallback support on all of our platforms
for the very first time!

Since grub.cfg is copied into place instead of generated, build_image's
--boot_args option is no longer supported. It could be re-added later
with some sed goo but for now it is easy enough to just edit grub.cfg.
2014-12-05 16:51:11 -08:00
Michael Marineau
729f9da872 common: make sure /etc/mtab is correct before mounting anything
If mtab ever gets replaced by a regular file all sorts of things break.
2014-12-03 16:30:19 -08:00
Michael Marineau
4d3c198161 tools: remove support for parallel_emerge
Using parallel_emerge has been disabled by default for all commands
except build_image for quite a while now, build_image kept it just
because it was still a bit faster than normal emerge. Keeping
parallel_emerge complicates future changes to build_image so it needs to
drop it entirely. Since that means nothing uses it by default we might
as well just rip out support for it entirely.
2014-07-19 16:38:17 -07:00
Michael Marineau
51c78a4685 build_image: generate update tools zip by default
Missed this in 7231b95a, the update zip should still be built when the
usr partition is extracted for generating updates but build_image itself
is not generating and signing the update.
2014-06-24 14:01:09 -07:00