This commit is contained in:
j3d1 2020-01-31 15:29:45 +01:00
parent 1a0bda34de
commit aaf8c2b72c
2 changed files with 32 additions and 2 deletions

View file

@ -24,6 +24,12 @@ function unbox_outer_stage(){
mkdir -p target mkdir -p target
export TARGET=$(pwd)/target export TARGET=$(pwd)/target
export UNBOX_ENV_FILE=$(pwd)/.env
if [ -e .env ]; then
rm .env
fi
if type -t first_stage > /dev/null; then if type -t first_stage > /dev/null; then
first_stage first_stage
@ -51,18 +57,31 @@ function unbox_outer_stage(){
else else
echo no post_install_stage found echo no post_install_stage found
fi fi
if [ -e ${UNBOX_ENV_FILE} ]; then
rm ${UNBOX_ENV_FILE}
fi
exit 0 exit 0
} }
function unbox_inner_stage(){ function unbox_inner_stage(){
echo "-----------SECOND STAGE-----------" echo "-----------SECOND STAGE-----------"
#echo $@ export UNBOX_ENV_FILE=$(pwd)/.env
source repo/entry.sh if [ -e ${UNBOX_ENV_FILE} ]; then
source ${UNBOX_ENV_FILE}
fi
if [ -e repo/entry.sh ]; then
source repo/entry.sh
else
echo chosen repository does not contain entry.sh file
fi
if type -t second_stage > /dev/null; then if type -t second_stage > /dev/null; then
second_stage second_stage
else else
echo second stage not found echo second stage not found
fi fi
if [ -e ${UNBOX_ENV_FILE} ]; then
rm ${UNBOX_ENV_FILE}
fi
exit 0 exit 0
} }

View file

@ -6,6 +6,17 @@ function prefix_time(){
done done
} }
function export_env(){
if [ $# -lt 2 ]; then
echo not enogh arguments for export_env
exit 1
fi
VAR=${1}
shift
echo ${VAR}=${@} >> ${UNBOX_ENV_FILE}
export ${VAR}=${@}
}
function mem_size(){ function mem_size(){
echo $(($(cat /proc/meminfo | grep MemTotal | awk '{print $2}')*1024)) echo $(($(cat /proc/meminfo | grep MemTotal | awk '{print $2}')*1024))
} }