Skip to content

Commit

Permalink
Introduce generic toolchains based on bootlin
Browse files Browse the repository at this point in the history
- use precompiled ready to use toolchains from https://toolchains.bootlin.com/
- display generic toolchain on top of lists
- aarch64_generic, armv7_generic, mips32el_generic, sh4_generic focus the compatiblity with a wide range of devices
  • Loading branch information
WXbet committed Mar 29, 2024
1 parent 77f95fe commit bcdd313
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 19 deletions.
2 changes: 2 additions & 0 deletions support/functions/_misc
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ _init_menu(){
IFS="#"
COUNT=0
MENU_OPTIONS="BACK#$txt_back#"
MENU_OPTIONS_GEN=""
MENU_OPTIONS_STD=""
counter
}
_select_menu(){
Expand Down
43 changes: 24 additions & 19 deletions support/functions/_toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ _toolchain_config_menu(){

_toolchain_main_menu(){
_fill_tc_array
_init_menu

IFS="#"
COUNT=0
MENU_OPTIONS="BACK#$txt_back_main#"
Expand All @@ -98,27 +100,22 @@ _toolchain_main_menu(){
then
unset _self_build
source "$tccfgdir/$i"
if [ "$systype" == "ok" ]
then
MENU_OPTIONS+="$_toolchainname#$_description#"
counter
elif [ "$_self_build" == "yes" ]
if [ "$systype" == "ok" -o "$_self_build" == "yes" ]
then
MENU_OPTIONS+="$_toolchainname#$_description#"
[[ "$i" =~ "_generic" ]] && MENU_OPTIONS_GEN+="$_toolchainname#$_description#" || MENU_OPTIONS_STD+="$_toolchainname#$_description#"
counter

fi
fi
done
fi

MENU_OPTIONS+="EXIT#$txt_firstmenu_exit#"
MENU_OPTIONS+="${MENU_OPTIONS_GEN}${MENU_OPTIONS_STD}EXIT#$txt_firstmenu_exit#"
counter

out=$(
"$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ Toolchain $txt_menu ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS})
IFS=$OIFS
first=$(echo "$out" | awk '{printf $1}')
tc_info=$(echo "$out" | awk '{printf $2}';)
tc_info=$(echo "$out" | awk '{printf $2}')

case $first in
EXIT)
Expand All @@ -137,7 +134,7 @@ _toolchain_main_menu(){
then
source "$tccfgdir/$tc_info"
"$gui" "$st_" "$nc_" "$bt_" "$title_" "$ib_" "$_tc_info" $((_tc_infolines + 5)) 65
sleep 5
sleep 10
fi
_toolchain_main_menu;;
*)
Expand Down Expand Up @@ -185,7 +182,7 @@ _console_extract_toolchain(){
[ -d "$tcdir/$_toolchainname" ] && rm -rf "$tcdir/$_toolchainname"
mkdir "$tcdir/$_toolchainname"
cd "$tcdir/$_toolchainname"
xz -d "$tc_dl" -c | tar -x
tar -xf "$tc_dl" --strip-components=1
printf "\r$w_l $txt_extracting :$g_l$txt_done! \n\n"
}

Expand Down Expand Up @@ -364,24 +361,32 @@ _toolchain_add_menu(){
if [ ! "$i" == "native" ]
then
source "$tccfgdir/$i"
MENU_OPTIONS+="$_toolchainname#$_description#"
[[ "$i" =~ "_generic" ]] && MENU_OPTIONS_GEN+="$_toolchainname#$_description#" || MENU_OPTIONS_STD+="$_toolchainname#$_description#"
counter
fi
done

MENU_OPTIONS+="EXIT#$txt_menu_builder1#"
MENU_OPTIONS+="${MENU_OPTIONS_GEN}${MENU_OPTIONS_STD}EXIT#$txt_menu_builder1#"
counter

out=$(
"$gui" "$st_" "$nc_" "$bt_" "$title_" --help-button --help-label INFO --title "-[ $txt_add_menu ]-" --menu "$txt_main_revision$(REVISION)" "${COUNT+8}" 75 0 ${MENU_OPTIONS[@]})
IFS=$OIFS
first=$(echo "$out" | awk '{printf $1}')
tc_info=$(echo "$out" | awk '{printf $2}')

case $first in
EXIT)
bye;;
BACK | '')
_toolchain_main_menu;;
HELP)
if [ -f "$tccfgdir/$tc_info" ]
then
source "$tccfgdir/$tc_info"
"$gui" "$st_" "$nc_" "$bt_" "$title_" "$ib_" "$_tc_info" $((_tc_infolines + 5)) 65
sleep 10
fi
_toolchain_add_menu;;
*)
_toolchain_gui_install
_toolchain_main_menu;;
Expand All @@ -391,20 +396,20 @@ _toolchain_add_menu(){
_toolchain_remove_menu(){
_fill_tc_array
_init_menu

if [ "$tcempty" == "0" ]
then
for i in "${INST_TCLIST[@]}"
do
if [ ! "$i" == "native" ]
then
source "$tccfgdir/$i"
MENU_OPTIONS+="$_toolchainname#$_description#"
[[ "$i" =~ "_generic" ]] && MENU_OPTIONS_GEN+="$_toolchainname#$_description#" || MENU_OPTIONS_STD+="$_toolchainname#$_description#"
counter
fi
done
fi

MENU_OPTIONS+="EXIT#$txt_menu_builder1#"
MENU_OPTIONS+="${MENU_OPTIONS_GEN}${MENU_OPTIONS_STD}EXIT#$txt_menu_builder1#"
counter

out=$(
Expand Down Expand Up @@ -441,7 +446,7 @@ _toolchain_gui_install(){
[ -d "$tcdir/$first" ] && rm -rf "$tcdir/$first" && printf "$txt_delete $tcdir/$first"
mkdir "$tcdir/$first"
cd "$tcdir/$first"
(xz -d "$dldir/$tcname" -c |tar -xv) |"$gui" "$st_" --title " -[ $txt_extracting $tcname ]- " "$pb_" 20 74
(tar -xvf "$dldir/$tcname" --strip-components=1) |"$gui" "$st_" --title " -[ $txt_extracting $tcname ]- " "$pb_" 20 74
else
printf "$r_l $txt_error:$y_l $stcname$w_l Toolchain $txt_no_download""$rs_"
fi
Expand Down
25 changes: 25 additions & 0 deletions support/toolchains.cfg/aarch64_generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_toolchainname="aarch64_generic";
default_use="USE_LIBCRYPTO";
extra_use="";
extra_cc="";
extra_ld="";
extra_c="";
_description="aarch64 stb's (generic)";
_oscamconfdir_default="/etc/tuxbox/config";
_oscamconfdir_custom="";
_compiler="aarch64-buildroot-linux-gnu-";
_sysroot="aarch64-buildroot-linux-gnu/sysroot";
_libsearchdir="/usr/lib";
_toolchainfilename="aHR0cHM6Ly90b29sY2hhaW5zLmJvb3RsaW4uY29tL2Rvd25sb2Fkcy9yZWxlYXNlcy90b29sY2hhaW5zL2FhcmNoNjQvdGFyYmFsbHMvYWFyY2g2NC0tZ2xpYmMtLXN0YWJsZS0yMDE4LjExLTEudGFyLmJ6Mg==";
_md5sum="3dabef3ced22e58bc061be2f74dfae85 aarch64--glibc--stable-2018.11-1.tar.bz2";
_tc_info="!!! Bootlin Stable Toolchain 2018.11-1 !!!\n
\n
generic cross toolchain for aarch64 devices\n
\n
arch aarch64\n
glibc 2.27\n
gcc 7.3.0\n
gdb 7.12.1\n
linux 4.1.52\n
binutils 2.29.1\n";
_tc_infolines="10";
25 changes: 25 additions & 0 deletions support/toolchains.cfg/armv7_generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_toolchainname="armv7_generic";
default_use="USE_LIBCRYPTO";
extra_use="";
extra_cc="";
extra_ld="";
extra_c="-mfpu=vfpv3-d16"; #special optimization for HiSilicon MV430 devices
_description="armv7 stb's (generic)";
_oscamconfdir_default="/etc/tuxbox/config";
_oscamconfdir_custom="";
_compiler="arm-buildroot-linux-gnueabihf-";
_sysroot="arm-buildroot-linux-gnueabihf/sysroot";
_libsearchdir="/usr/lib";
_toolchainfilename="aHR0cHM6Ly90b29sY2hhaW5zLmJvb3RsaW4uY29tL2Rvd25sb2Fkcy9yZWxlYXNlcy90b29sY2hhaW5zL2FybXY3LWVhYmloZi90YXJiYWxscy9hcm12Ny1lYWJpaGYtLWdsaWJjLS1zdGFibGUtMjAxOC4xMS0xLnRhci5iejI=";
_md5sum="cf6286d326c14d6a51ba05c33c8218a0 armv7-eabihf--glibc--stable-2018.11-1.tar.bz2";
_tc_info="!!! Bootlin Stable Toolchain 2018.11-1 !!!\n
\n
generic cross toolchain for armv7eabihf devices\n
\n
arch armv7\n
glibc 2.27\n
gcc 7.3.0\n
gdb 7.12.1\n
linux 4.1.52\n
binutils 2.29.1\n";
_tc_infolines="10";
25 changes: 25 additions & 0 deletions support/toolchains.cfg/mips32el_generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_toolchainname="mips32el_generic";
default_use="USE_LIBCRYPTO";
extra_use="";
extra_cc="";
extra_ld="";
extra_c="";
_description="mips32el stb's (generic)";
_oscamconfdir_default="/etc/tuxbox/config";
_oscamconfdir_custom="";
_compiler="mipsel-buildroot-linux-gnu-";
_sysroot="mipsel-buildroot-linux-gnu/sysroot";
_libsearchdir="/usr/lib";
_toolchainfilename="aHR0cHM6Ly90b29sY2hhaW5zLmJvb3RsaW4uY29tL2Rvd25sb2Fkcy9yZWxlYXNlcy90b29sY2hhaW5zL21pcHMzMmVsL3RhcmJhbGxzL21pcHMzMmVsLS1nbGliYy0tc3RhYmxlLTIwMTguMTEtMS50YXIuYnoy";
_md5sum="6c1170df27d57dd3bbff9456f0afa813 mips32el--glibc--stable-2018.11-1.tar.bz2";
_tc_info="!!! Bootlin Stable Toolchain 2018.11-1 !!!\n
\n
generic cross toolchain for mips32el devices\n
\n
arch mips32el\n
glibc 2.27\n
gcc 7.3.0\n
gdb 7.12.1\n
linux 4.1.52\n
binutils 2.29.1\n";
_tc_infolines="10";
25 changes: 25 additions & 0 deletions support/toolchains.cfg/sh4_generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_toolchainname="sh4_generic";
default_use="USE_LIBCRYPTO";
extra_use="";
extra_cc="";
extra_ld="";
extra_c="";
_description="sh4 stb's (generic)";
_oscamconfdir_default="/etc/tuxbox/config";
_oscamconfdir_custom="";
_compiler="sh4-buildroot-linux-gnu-";
_sysroot="sh4-buildroot-linux-gnu/sysroot";
_libsearchdir="/usr/lib";
_toolchainfilename="aHR0cHM6Ly90b29sY2hhaW5zLmJvb3RsaW4uY29tL2Rvd25sb2Fkcy9yZWxlYXNlcy90b29sY2hhaW5zL3NoLXNoNC90YXJiYWxscy9zaC1zaDQtLWdsaWJjLS1zdGFibGUtMjAxOC4xMS0xLnRhci5iejI=";
_md5sum="ad318a6d09ce1d18912b83293c8ed434 sh-sh4--glibc--stable-2018.11-1.tar.bz2";
_tc_info="!!! Bootlin Stable Toolchain 2018.11-1 !!!\n
\n
generic cross toolchain for sh4 devices\n
\n
arch sh4\n
glibc 2.27\n
gcc 7.3.0\n
gdb 7.12.1\n
linux 4.1.52\n
binutils 2.29.1\n";
_tc_infolines="10";

0 comments on commit bcdd313

Please sign in to comment.