diff --git a/sdk_lib/Dockerfile.sdk-update b/sdk_lib/Dockerfile.sdk-update new file mode 100644 index 0000000000..2a7ca2325c --- /dev/null +++ b/sdk_lib/Dockerfile.sdk-update @@ -0,0 +1,11 @@ +ARG BASE + +FROM ${BASE} +COPY --chown=sdk:sdk sdk_container/ /mnt/host/source +COPY --chown=sdk:sdk . /mnt/host/source/src/scripts + +RUN chown sdk:sdk /mnt/host/source +RUN /home/sdk/sdk_entry.sh ./update_chroot --toolchain_boards="amd64-usr arm64-usr" + +RUN /home/sdk/sdk_entry.sh ./setup_board --board="arm64-usr" --regen_configs +RUN /home/sdk/sdk_entry.sh ./setup_board --board="amd64-usr" --regen_configs diff --git a/sdk_lib/sdk_container_common.sh b/sdk_lib/sdk_container_common.sh index 11325ff6dc..e0c3906fe4 100644 --- a/sdk_lib/sdk_container_common.sh +++ b/sdk_lib/sdk_container_common.sh @@ -61,6 +61,11 @@ function get_sdk_version_from_versionfile() { } # -- +function get_version_from_versionfile() { + ( source "$sdk_container_common_versionfile"; echo "$FLATCAR_VERSION"; ) +} +# -- + # return true if a given version number is an official build # function is_official() { diff --git a/update_sdk_container_image b/update_sdk_container_image new file mode 100755 index 0000000000..26dd129426 --- /dev/null +++ b/update_sdk_container_image @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Copyright (c) 2021 The Flatcar Maintainers. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This script will update an SDK container image and create a new minor version. + + +set -eu +set -x + +cd $(dirname "$0") +source sdk_lib/sdk_container_common.sh + +os_version="$(get_version_from_versionfile)" +base_sdk_version="$(get_sdk_version_from_versionfile)" +new_sdk_version="" + +keep="false" +cleanup="" + +usage() { + echo " $0 - Update SDK container image." + echo " Create a new container image based on the current SDK ($base_sdk_version)" + echo " with current changes from coreos-overlay and portage-stable." + echo + echo " Just like build_sdk_container_image the resulting container comes in 3 flavours:" + echo " 1. flatcar-sdk-all - includes both ARM64 and AMD64 support" + echo " 2.+3. flatcar-sdk-(amd64|arm64) - only includes support for one target." + echo " Usage:" + echo " $0 [-k] [-x