Browse Source

s3.TUP install crosstool-ng automatically (v0.11.2)

create separate ctng-setup function
add ctng-setup call in create toolchain process, if not installed (correctly)
pull/20/head
WXbet 5 years ago
parent
commit
c8b640a4ea
  1. 67
      support/functions/_plugin_update_toolchain

67
support/functions/_plugin_update_toolchain

@ -3,7 +3,7 @@
#simplebuild_plugin tcupdate
tcupdate(){
pversion="0.11.1";
pversion="0.11.2";
pname="s3.TUP";
pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config";
@ -288,9 +288,15 @@ _create_tc(){
case $ret in
0) #Start - Build cross toolchain
if [ -f "$ctsrcdir/ct-ng" ]; then
icount=$(echo $opts | wc -w);i=0;
#Setup crosstool-NG automatically if not installed
if [ ! -f "$ctsrcdir/ct-ng" ]; then
echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Try to fix it automatically...\n""$re_";
_paktc_timer 5;
_ctng_setup "$START_BUILD";
fi;
#Build cross toolchains
icount=$(echo $opts | wc -w);i=0;
for tpl in $opts;do
if [ -f "$cttpldir/$tpl" ]; then
@ -354,35 +360,9 @@ _create_tc(){
echo -e "$r_l $txt_error:$y_l $tpl$w_l Template $txt_n_installed""$rs_";
sleep 2;
fi;
done;
else
echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Please run 'Setup' from menu!\n""$re_";
_paktc_timer 10;
fi;;
done;;
1) #Setup - Setup crosstool-NG
logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstool-NG_setup.log"
(
bcl=$(printf '%s\n' "${CTNG_SETUP_tasks[@]}");
sp=$(printf '%*s' 80 | tr ' ' '=')
echo -e "$sp\nbuild command list for crosstool-NG:\n$sp\ncd "$ctsrcdir"\n$(_replace_tokens "$bcl")\n$sp";
sleep 2;
if [ $START_BUILD -eq 1 ]; then
# setup crosstool wc
echo "Cleanup source directory "$ctsrcdir/"..."
rm -rf "$ctsrcdir" 2>/dev/null;
mkdir --parents "$ctsrcdir";
cd "$ctsrcdir";
#generate setup command list
for task in "${CTNG_SETUP_tasks[@]}";do
task=$(_replace_tokens "$task"); #replace tokens
setuptasks+=("$task");
done
( eval "${setuptasks[@]}" ) 2>&1;
else
echo -e "\nERROR -> The execution of crosstool-NG was aborted\n because it must not run as root!\n";
fi;
) | tee "$logfile" | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Setup crosstool-NG ]- " "$pb_" "$_lines" "$_cols";
_ctng_setup "$START_BUILD";
_paktc_timer 10;;
2) #Edit
tpl=$(echo "$opts" | awk '{printf $2}';);
@ -462,6 +442,31 @@ _ctng_menu(){
done;
( eval "${configtasks[@]}" ) 2>&1;
};
_ctng_setup(){
logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstool-NG_setup.log"
(
bcl=$(printf '%s\n' "${CTNG_SETUP_tasks[@]}");
sp=$(printf '%*s' 80 | tr ' ' '=')
echo -e "$sp\nbuild command list for crosstool-NG:\n$sp\ncd "$ctsrcdir"\n$(_replace_tokens "$bcl")\n$sp";
sleep 2;
if [ $1 -eq 1 ]; then
# setup crosstool wc
echo "Cleanup source directory "$ctsrcdir/"..."
rm -rf "$ctsrcdir" 2>/dev/null;
mkdir --parents "$ctsrcdir";
cd "$ctsrcdir";
#generate setup command list
for task in "${CTNG_SETUP_tasks[@]}";do
task=$(_replace_tokens "$task"); #replace tokens
setuptasks+=("$task");
done
( eval "${setuptasks[@]}" ) 2>&1;
else
echo -e "\nERROR -> The execution of crosstool-NG was aborted\n because it must not run as root!\n";
fi;
) | tee "$logfile" | "$gui" "$st_" "$bt_" "$title_ - \Z0$pdesc\Zn" "--colors" "--title" " -[ Setup crosstool-NG ]- " "$pb_" "$_lines" "$_cols";
};
_dl(){
[ -d "$dldir/#tmp" ] && rm --recursive --force "$dldir/#tmp"
mkdir --parents "$dldir/#tmp";

Loading…
Cancel
Save