From 123b4a8de0198f3f93f9cc47ff6b106b71d8ca6b Mon Sep 17 00:00:00 2001 From: root Date: Sat, 9 Feb 2019 11:31:21 +0100 Subject: [PATCH] fix toolchain check --- s3 | 6 +++++ support/configs/compiler_option | 2 +- support/functions/_misc | 4 +-- support/functions/_toolchain | 33 ++++++++++++++++--------- support/toolchains.cfg/mipsel_s3_ssl098 | 4 +-- support/toolchains.cfg/mipsel_s3_ssl100 | 4 +-- support/toolchains.cfg/mipsel_s3_ssl102 | 4 +-- support/toolchains.cfg/solo4k | 6 ++--- support/translation/de | 4 +-- support/translation/en | 4 +-- 10 files changed, 44 insertions(+), 27 deletions(-) mode change 100644 => 100755 s3 diff --git a/s3 b/s3 old mode 100644 new mode 100755 index dbcf7ed..9a85d0f --- a/s3 +++ b/s3 @@ -224,24 +224,29 @@ else for t in "${AVAI_TCLIST[@]}";do if [ "$t" == "$1" ];then + if [ "${2:0:3}" == "-p=" ] || [ "${2:0:3}" == "-P=" ];then if [ -f "$profdir/${2#*=}" ];then pf=$(cat "$profdir/${2#*=}"); pf_name="${2#*=}"; fi; fi; + if [ "${3:0:3}" == "-p=" ] || [ "${3:0:3}" == "-P=" ];then if [ -f "$profdir/${2#*=}" ];then pf=$(cat "$profdir/${2#*=}"); pf_name="${2#*=}"; fi; fi; + if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ];then UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1"; fi; + if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ];then UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1"; fi; + [ "$pf" == "empty" ] && c_m_d="$*" || c_m_d="all_off $pf $*"; # set only active module with profiles for cmd in $c_m_d;do if [ "${cmd:0:3}" == "-c=" ] || [ "${cmd:0:3}" == "-C=" ];then @@ -271,6 +276,7 @@ else USE_VERBOSE) s3cfg_vars[USE_VERBOSE]=1;; esac; done; + _pre_build "$t"; exit; fi; diff --git a/support/configs/compiler_option b/support/configs/compiler_option index f8c5bfe..1ecfb3b 100644 --- a/support/configs/compiler_option +++ b/support/configs/compiler_option @@ -1 +1 @@ --O1 \ No newline at end of file +-Os \ No newline at end of file diff --git a/support/functions/_misc b/support/functions/_misc index 6d54602..08d3c33 100644 --- a/support/functions/_misc +++ b/support/functions/_misc @@ -148,7 +148,7 @@ _pre_build(){ echo -en "$w_l backupcheck : "; if [ -f "$dldir/$dln" ];then echo -e "$g_l$dln $txt_found"; - echo -en "$w_l $txt_extracting :$y_l $txt_wait"; + echo -en "$w_l $txt_extracting :$y_l $txt_wait"; _console_extract_toolchain; run=1; else @@ -544,4 +544,4 @@ _gtedit(){ sed -i s@^_oscamconfdir_custom.*@_oscamconfdir_custom=\"$confdir\"@ "$tccfgdir/$_toolchainname"; source "$tccfgdir/$_toolchainname"; fi; -}; \ No newline at end of file +}; diff --git a/support/functions/_toolchain b/support/functions/_toolchain index 35dea12..a5f8d3a 100644 --- a/support/functions/_toolchain +++ b/support/functions/_toolchain @@ -147,7 +147,7 @@ _console_extract_toolchain(){ _toolchain_check(){ clear; echo -e "$w_l"; - ologo; + s3logo; headervars=( crypto.h pcsclite.h libusb.h pthread.h ); [ -f "$tccfgdir/$1" ] && source "$tccfgdir/$1"; if [ -d "$tcdir/$1/bin" ];then @@ -162,17 +162,24 @@ _toolchain_check(){ version=$("./$compilername" -dumpversion); machine=$("./$compilername" -dumpmachine); sr=$("./$compilername" -print-sysroot 2>/dev/null); - sysroot=${tcdir//"$1/bin"/}; + sysroot=${sr#"$tcdir/$1/bin/../"}; [ -z "$sysroot" ] && sysroot="$r_l$txt_too_old"; - echo -e "$w_l Compiler Info\n =============\n"; - echo -e "$w_l Version :$y_l $version"; - echo -e "$w_l Target :$y_l $machine"; - echo -e "$w_l Sysroot :$y_l $sysroot"; + echo -e "$w_l Compiler Info -----> $C$1$w_l\n ====================\n"; + echo -e "$w_l GCC Version :$y_l $version"; + echo -e "$w_l GCC Binary :$y_l $machine""-gcc"; + echo -e "$w_l GCC Sysroot :$y_l $sysroot"; + cd "$sr"; for e in "${headervars[@]}";do - temp=$(find "$sr"/* |grep -m1 "$e"); - [ ${#temp} -gt 8 ] && echo -e "$w_l Header :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header :$y_l $e$r_l\t($txt_not_found)"; + temp=$(find * |grep -m1 "$e"); + [ ${#temp} -gt 8 ] && echo -e "$w_l Header File :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header File :$y_l $e$r_l\t($txt_not_found)"; done; - _nl; + echo -e "\n$w_l Sysroot config ----> $C$_sysroot$w_l\n ====================\n"; + cd "$tcdir/$1/$_sysroot"; + for e in "${headervars[@]}";do + temp=$(find * |grep -m1 "$e"); + [ ${#temp} -gt 8 ] && echo -e "$w_l Header File :$y_l $e$g_l\t$txt_found" || echo -e "$w_l Header File :$y_l $e$r_l\t($txt_not_found)"; + done; + echo -e $re_; exit; }; _toolchain_repair(){ @@ -182,6 +189,10 @@ _toolchain_repair(){ cd $dldir;zzusatz=0;szusatz=0; [ -f "$tccfgdir/$1" ] && source "$tccfgdir/$1"; fn=$(echo $_md5sum |awk '{ printf $2 }'); + if [ ${#_md5sum} -lt 1 ];then + echo -e $w_l" md5sum in $Y$1$w_l config $R$txt_not_found$W\n\n"; + exit; + fi; if [ -f $fn ];then md5file=$(mktemp); echo $_md5sum > $md5file; @@ -196,7 +207,7 @@ _toolchain_repair(){ else echo -en $w_l"\n Toolchain md5 check :$r_l"; echo -en $answer |awk '{{print " " $2;}}' |head -1; - echo -en $W;sleep 1;zzusatz=0;szusatz=8; + echo -en $W;sleep 1;zzusatz=1;szusatz=8; echo -en $w_l" Toolchain download :$g_l"; dln=$fn;_pget; sleep 1; echo -en $w_l" Toolchain repair :$g_l"; @@ -282,4 +293,4 @@ _toolchain_gui_install(){ cd "$tcdir/$first"; (xz -d "$dldir/$tcname" -c |tar -xv) |"$gui" "$st_" --title " -[ $txt_extracting ]- " "$pb_" 20 74; fi; -}; \ No newline at end of file +}; diff --git a/support/toolchains.cfg/mipsel_s3_ssl098 b/support/toolchains.cfg/mipsel_s3_ssl098 index 41f29f2..2837fa3 100644 --- a/support/toolchains.cfg/mipsel_s3_ssl098 +++ b/support/toolchains.cfg/mipsel_s3_ssl098 @@ -5,7 +5,7 @@ _oscamconfdir_default="/var/keys"; _oscamconfdir_custom="" _compiler="mipsel-simplebuild3-linux-gnu-"; -_sysroot="/"; +_sysroot="mipsel-simplebuild3-linux-gnu/sysroot"; _libsearchdir="/lib"; _toolchainfilename="bWlwc2VsX3MzX3NzbDA5OC50YXIueHoK"; _md5sum="966c590d2178f6d401c93993eba4f7f9 Toolchain-mipsel_s3_ssl098.tar.xz"; @@ -17,4 +17,4 @@ Dreambox: dm500,dm800,500HD,800HD,800SE,7020HD, 7025,8000\n VU+ : Zero,Solo²,SoloSE,SoloSE(V2),Duo,Duo²"; -_tc_infolines="6"; \ No newline at end of file +_tc_infolines="6"; diff --git a/support/toolchains.cfg/mipsel_s3_ssl100 b/support/toolchains.cfg/mipsel_s3_ssl100 index a8c1ae8..8312452 100644 --- a/support/toolchains.cfg/mipsel_s3_ssl100 +++ b/support/toolchains.cfg/mipsel_s3_ssl100 @@ -5,7 +5,7 @@ _oscamconfdir_default="/var/keys"; _oscamconfdir_custom="" _compiler="mipsel-simplebuild3-linux-gnu-"; -_sysroot="/"; +_sysroot="mipsel-simplebuild3-linux-gnu/sysroot"; _libsearchdir="/lib"; _toolchainfilename="bWlwc2VsX3MzX3NzbDEwMC50YXIueHoK"; _md5sum="b1ff681eff62b0e639d37e001b97e1e0 Toolchain-mipsel_s3_ssl100.tar.xz"; @@ -17,4 +17,4 @@ Dreambox: dm500,dm800,500HD,800HD,800SE,7020HD, 7025,8000\n VU+ : Zero,Solo²,SoloSE,SoloSE(V2),Duo,Duo²"; -_tc_infolines="6"; \ No newline at end of file +_tc_infolines="6"; diff --git a/support/toolchains.cfg/mipsel_s3_ssl102 b/support/toolchains.cfg/mipsel_s3_ssl102 index 1329fab..91b35a1 100644 --- a/support/toolchains.cfg/mipsel_s3_ssl102 +++ b/support/toolchains.cfg/mipsel_s3_ssl102 @@ -5,10 +5,10 @@ _oscamconfdir_default="/var/keys"; _oscamconfdir_custom="" _compiler="mipsel-simplebuild3-linux-gnu-"; -_sysroot="/"; +_sysroot="mipsel-simplebuild3-linux-gnu/sysroot"; _libsearchdir="/lib"; _toolchainfilename="bWlwc2VsX3MzX3NzbDEwMi50YXIueHoK"; -md5sum="985ba51ae41cacd008fb6c7490e2f287 Toolchain-mipsel_s3_ssl102.tar.xz" +_md5sum="985ba51ae41cacd008fb6c7490e2f287 Toolchain-mipsel_s3_ssl102.tar.xz" _tc_info="\n !!! generic mipsel ssl 1.0.2 !!!\n this toolchain is compatible with\n diff --git a/support/toolchains.cfg/solo4k b/support/toolchains.cfg/solo4k index 994f04f..4d8a377 100644 --- a/support/toolchains.cfg/solo4k +++ b/support/toolchains.cfg/solo4k @@ -5,14 +5,14 @@ _oscamconfdir_default="/var/tuxbox/config"; _oscamconfdir_custom="" _compiler="arm-linux-gnueabihf-"; -_sysroot="arm-linux-gnueabihf"; +_sysroot="arm-linux-gnueabihf/"; _libsearchdir="/lib"; _toolchainfilename="c29sbzRrLnRhci54ego="; - +_md5sum="74d4de6ac2f4812426635cf54e3d85fa Toolchain-solo4k.tar.xz"; _tc_info="\n !!! beware the box must have FPU !!!\n this toolchain is compatible with\n \n VU+ : Solo4k"; -_tc_infolines="5" \ No newline at end of file +_tc_infolines="5" diff --git a/support/translation/de b/support/translation/de index eee3aed..22bb419 100644 --- a/support/translation/de +++ b/support/translation/de @@ -20,12 +20,12 @@ txt_sel='auswählen'; txt_delete='lösche'; txt_found='gefunden'; txt_create='erstelle'; -txt_loading=' lade'; +txt_loading=' lade'; #8 zeichen txt_profile='Profil'; txt_profiles='Profile'; txt_conf='Konfiguration'; txt_parameter='Parameter'; -txt_extracting='entpacke'; +txt_extracting=' entpacke'; #10 zeichen txt_wait='bitte warten...'; txt_existing='vorhandenen'; txt_ssh_profiles='SSH $txt_profiles'; diff --git a/support/translation/en b/support/translation/en index 44bba45..3809235 100644 --- a/support/translation/en +++ b/support/translation/en @@ -15,13 +15,13 @@ txt_no='no'; txt_use='use'; txt_back='back'; txt_error='error'; -txt_loading=' load'; +txt_loading=' load'; #8 chars txt_sel='select'; txt_delete='delete'; txt_found='found'; txt_create='create'; txt_conf='configuration'; -txt_extracting='extracting'; +txt_extracting='extracting'; #10 chars txt_wait='please wait...'; txt_existing='exists'; txt_profiles='profiles';