flatcar-scripts/sdk_lib/sdk_init_selfcontained.sh
Thilo Fromm b567344234 sdk-container: add scripts for containerised SDK
This change introduces a containerised SDK as a replacement for cork SDK
operations. It also simplifies versioning by removing the need for
manifest repos as well as usage of the "repo" tool by use of git
submodules for coreos-overlay and portage-stable.

The following feature scripts are added:
- run_sdk_container: Run a command in an SDK container, using the
        current scripts repo + ebuild submodules.
        current scripts repo + ebuild submodules.
- bootstrap_sdk_container / build_sdk_container_image: Bootstrap a new
        SDK and create an SDK container from the resulting SDK tarball.

The following additions have been made to SDK scripts:
- setup_board: add --pkgdir parameter to use a custom binary packge
  directory.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-11-26 17:54:43 +01:00

39 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
echo "This script will initialise your Flatcar SDK container as a self-contained SDK."
echo "Please note that the preferred way of using the Flatcar SDK container is by cloning"
echo " https://github.com/flatcar-linux/scripts"
echo "and using the ./run_sdk_container script."
echo
echo "Press [RETURN] to continue, CTRL+C to abort"
echo
read junk
# --
function clone_version() {
local repo="$1"
local dest="$2"
local version="$3"
git clone https://github.com/flatcar-linux/$repo "$dest"
(
cd "$dest"
git fetch --all
local tag=$(git tag -l | grep "${version}")
git checkout "$tag"
)
}
# --
version="$(source /mnt/host/source/.repo/manifests/version.txt; echo $FLATCAR_VERSION)"
mkdir -p /home/sdk/trunk/src/third_party/
clone_version scripts /home/sdk/trunk/src/scripts "$version"
clone_version portage-stable /home/sdk/trunk/src/third_party/portage-stable "$version"
clone_version coreos-overlay /home/sdk/trunk/src/third_party/coreos-overlay "$version"