From 1ed20d400300389e67a9f3a9f737d121f3eb71ff Mon Sep 17 00:00:00 2001 From: orangepi-xunlong <258384131@qq.com> Date: Fri, 19 Nov 2021 09:11:55 +0800 Subject: [PATCH] Support Orange Pi Zero2 LTS --- build | 90 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 32 deletions(-) diff --git a/build b/build index 3d49f58..e4f6007 100755 --- a/build +++ b/build @@ -45,47 +45,72 @@ check_make_ok() { select_boards() { - local cnt=0 - local choice - local call=${1} + local cnt=0 + local choice + local call=${1} - boards=("orangepir1" "orangepizero" "orangepipc" "orangepipch5" "orangepipcplus" "orangepiplus2e" "orangepione" "orangepioneh5" "orangepilite" "orangepiplus" "orangepizeroplus2h3" "orangepizeroplus" "orangepipc2" "orangepiprime" "orangepizeroplus2h5" "orangepiwin" "orangepiwinplus" "orangepi3" "orangepi3-lts" "orangepilite2" "orangepioneplus" "orangepi4" "orangepirk3399" "orangepi800" "orangepizero2" "orangepir1plus") + boards=("orangepir1" + "orangepizero" + "orangepipc" + "orangepipch5" + "orangepipcplus" + "orangepiplus2e" + "orangepione" + "orangepioneh5" + "orangepilite" + "orangepiplus" + "orangepizeroplus2h3" + "orangepizeroplus" + "orangepipc2" + "orangepiprime" + "orangepizeroplus2h5" + "orangepiwin" + "orangepiwinplus" + "orangepi3" + "orangepi3-lts" + "orangepilite2" + "orangepioneplus" + "orangepi4" + "orangepirk3399" + "orangepi800" + "orangepizero2" + "orangepizero2-lts" + "orangepir1plus") - if [[ -f /etc/orangepi-release ]]; then + if [[ -f /etc/orangepi-release ]]; then - source /etc/orangepi-release + source /etc/orangepi-release - elif [[ -f /etc/armbian-release ]]; then + elif [[ -f /etc/armbian-release ]]; then - source /etc/armbian-release + source /etc/armbian-release + [[ $BOARD == orangepi-r1 ]] && BOARD=orangepir1 + [[ $BOARD == orangepi-rk3399 ]] && BOARD=orangepirk3399 + [[ $BOARD == orangepizeroplus2-h3 ]] && BOARD=orangepizeroplus2h3 + [[ $BOARD == orangepizeroplus2-h5 ]] && BOARD=orangepizeroplus2h5 - [[ $BOARD == orangepi-r1 ]] && BOARD=orangepir1 - [[ $BOARD == orangepi-rk3399 ]] && BOARD=orangepirk3399 - [[ $BOARD == orangepizeroplus2-h3 ]] && BOARD=orangepizeroplus2h3 - [[ $BOARD == orangepizeroplus2-h5 ]] && BOARD=orangepizeroplus2h5 + else - else - - printf "All available boards:\n" - for var in ${boards[@]} ; do - printf "%4d. %s\n" $cnt ${boards[$cnt]} + printf "All available boards:\n" + for var in ${boards[@]} ; do + printf "%4d. %s\n" $cnt ${boards[$cnt]} ((cnt+=1)) - done + done - while true ; do - read -p "Choice: " choice - if [ -z "${choice}" ] ; then - continue - fi - if [ -z "${choice//[0-9]/}" ] ; then - if [ $choice -ge 0 -a $choice -lt $cnt ] ; then - export BOARD="${boards[$choice]}" - break - fi - fi - printf "Invalid input ...\n" - done - fi + while true ; do + read -p "Choice: " choice + if [ -z "${choice}" ] ; then + continue + fi + if [ -z "${choice//[0-9]/}" ] ; then + if [ $choice -ge 0 -a $choice -lt $cnt ] ; then + export BOARD="${boards[$choice]}" + break + fi + fi + printf "Invalid input ...\n" + done + fi [[ $BOARD == orangepir1 ]] && BOARD=orangepir1-h2 [[ $BOARD == orangepizero ]] && BOARD=orangepizero-h2 @@ -107,6 +132,7 @@ select_boards() [[ $BOARD == orangepilite2 ]] && BOARD=orangepilite2-h6 [[ $BOARD == orangepioneplus ]] && BOARD=orangepioneplus-h6 [[ $BOARD == orangepizero2 ]] && BOARD=orangepizero2-h616 + [[ $BOARD == orangepizero2-lts ]] && BOARD=orangepizero2-h616 [[ $BOARD == orangepir1plus ]] && BOARD=orangepir1plus-rk3328 export BOARD="${BOARD}"