From 73dc9e026412f987cfbd3ac7003fe7c08dad16de Mon Sep 17 00:00:00 2001 From: Maxim Polyakov Date: Mon, 25 Oct 2021 22:17:14 +0300 Subject: [PATCH] ci: Add a script to create a tarball from RTEMS obj files Add a mechanism for creating a tarball with RTEMS object files to export it to an external repository. This tarball will be unpacked into rtems_os and used in the process of building the application without rebuilding the RTEMS image. This will reduce the build time. Signed-off-by: Maxim Polyakov --- ci/ci-create-rtems-export-tarball.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 ci/ci-create-rtems-export-tarball.sh diff --git a/ci/ci-create-rtems-export-tarball.sh b/ci/ci-create-rtems-export-tarball.sh new file mode 100755 index 0000000..8af3a24 --- /dev/null +++ b/ci/ci-create-rtems-export-tarball.sh @@ -0,0 +1,25 @@ +#!/bin/bash -eu + +RTEMS_ARCH="i386" +RTEMS_BSP="pc386" + +CI_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))" +ROOT_DIR="${CI_DIR}/.." +RTEMS_DIR="${ROOT_DIR}/rtems_rtos" +EXPORT_DIR="${ROOT_DIR}/rtems_export" + +function get_version_lable_rtems_os +{ + base=$(git -C ${RTEMS_DIR}/rtems describe --tags --dirty) + branch=$(git -C ${RTEMS_DIR}/rtems branch | grep \* | cut -d ' ' -f2-) + echo ${RTEMS_ARCH}"-"${RTEMS_BSP}"-"$branch"-"$base +} + +mkdir -p ${EXPORT_DIR} +echo "Export cross-tools and RTEMS object files to " +echo "${EXPORT_DIR}/rtems-export-$(get_version_lable_rtems_os).tar.gz" +ls ${RTEMS_DIR}/build-$(get_version_lable_rtems_os) +tar -C ${RTEMS_DIR} -zcvf \ + ${ROOT_DIR}/rtems_export/rtems-export-$(get_version_lable_rtems_os).tar.gz \ + ./build-$(get_version_lable_rtems_os) \ + ./rtems-exe