| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Note: To file an issue for any Flatcar repository, please use the central Flatcar issue tracker.
Welcome to the scripts repo, your starting place for most things here in the Flatcar Container Linux SDK. To get started you can find our documentation on the Flatcar docs website.
The SDK can be used to
The repository is meant to be the entry point for Flatcar builds and development. Ebuilds for all packages reside in one of 2 subdirectories - coreos-overlay and portage-stable:
scripts
+--sdk_container
+---------src
+--third_party
+------coreos-overlay
+------portage-stable
portage-stable is kept in alignment with upstream Gentoo and should not contain any modifications (with only minor, well-justified exceptions). Consider it a small sub-set of Gentoo.
coreos-overlay contains significantly modified or even entirely self-written ebuilds.
The scripts repository makes ample use of tags to mark releases. Sometimes, local and origin tags can diverge (e.g. when re-tagging something locally to test a build). Also, git pull and git fetch do not automatically pull new tags, so long-standing local sourcetrees may lack newer versions. To fetch and update all tags and to remove tags locally which have been deleted upstream, do
$ git pull --all --tags --prune --prune-tags
If upstream retagged (of if a tag was changed locally) the corresponding upstream tag will not be pulled so the local tag remains. In order to override local tags with upstream, run
$ git pull --all --tags --prune --prune-tags --force
We provide a containerised SDK via https://github.com/orgs/flatcar/packages. The container comes in 3 flavours:
The container can be run in one of two ways - "standalone", or integrated with the scripts repo:
In standalone mode, the SDK is just another Docker container. Interaction with the container happens via use of docker directly. Use for experimenting and for throw-away work only, otherwise please use integrated mode (see below).
You can now work with the SDK container.
In order to build OS images (via ./build_image and ./image_to_vm) the SDK tooling requires privileged access to /dev. This is necessary because the SDK currently employs loop devices to create and to partition OS images.
To start a container in privileged mode with /dev available use:
This is the preferred mode of working with the SDK. Interaction with the container happens via wrapper scripts from the scripts repository. Both the host's scripts repo as well as the ebuild paths (portage-stable and coreos-overlay) are made available in the container, allowing for work on these directly. The wrapper scripts will re-use existing containers instead of creating new ones to preserve your work in the container, enabling consistency.
To clone the scripts repo and pick a version:
When using GitHub's "fork" feature, please make sure to fork all branches, not just main. Forking only main is the default on GitHub.
The SDK container wrapper script run_sdk_container requires release tags in our release branches and fails to start if no release branch is present (see e.g. flatcar/Flatcar#1705). If you have forked manually, please make sure to include all tags. You can retrofit upstream tags to a fork by using e.g.:
git remote add upstream https://github.com/flatcar/scripts.git
git fetch --tags upstreamThis is necessary because the SDK uses git describe --tags to determine the current version, and forks don't include the original repository's tags by default.
To use the SDK container:
Subsequent calls to ./run_sdk_container will re-use the container (as long as the local release version check-out the scripts repo does not change). Check out docker container ls --all and you'll see something like
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 19ea3b6d00ad ghcr.io/flatcar/flatcar-sdk-all:3033.0.0 "/bin/sh -c /home/sd…" 4 hours ago Exited (0) About an hour ago flatcar-sdk-all-3033.0.0_os-3033.0.0
Re-use of containers happens on a per-name basis. The above example's container name flatcar-sdk-all-3033.0.0_os-3033.0.0 is generated automatically. Using docker container rm the container can be discarded - a subsequent call to ./run_sdk_container will create a new one. Custom containers can be created by use of the -n <name> command line option; these will be re-used in subsequent calls to ./run_sdk_container when using the same <name>.
The local sourcetree can also be used with an entirely custom SDK container image. Users must ensure that the image is either fetch-able or present locally. The custom image can be specified using -C <custom-image>. This option is useful e.g. for building the local sourcetree with different SDK versions.
Check out ./run_sdk_container -h for more information on command line options.
Building an SDK container is done using ./build_sdk_container_image <tarball>. The tarball input is the result of an SDK bootstrap (see below). Version information for both OS as well as for the SDK will be extracted from the tarball name. The version file will be updated accordingly before the SDK container is built. During the build, toolchain packages will be built and installed into the SDK container image. Both supported boards (amd64-usr and arm64-usr) will be initialised in the container image.
The script ./bootstrap_sdk_container bootstraps a new SDK tarball using an existing SDK container and seed tarball. Specifying the seed version as well as the designated new SDK version is required for this script.
Script stubs for various build stages can be found in the ci-automation folder. These are helpful for gluing Flatcar Container Linux builds to a continuous integration system.
| Back | FazBrowse Home | New Git URL |