diff --git a/INSTALL b/INSTALL index e1e63ae..9641b69 100755 --- a/INSTALL +++ b/INSTALL @@ -9,6 +9,8 @@ if [ "$(uname -s)" = "Darwin" ]; then else DISTRIB=$(cat /etc/lsb-release | grep "DISTRIB_ID" | awk -F "=" '{print $2}') DISTRIB_RELEASE=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE" | awk -F "=" '{print $2}') + # Numeric form of the release for comparisons: 26.04 -> 2604, 18.10 -> 1810 + DISTRIB_VER=$(awk -F. '{ printf "%d%02d", $1, $2 }' <<< "$DISTRIB_RELEASE") fi AML_FLASH_TOOL_DIR="$BASE/aml-flash-tool" @@ -28,14 +30,15 @@ error_msg() { } setup_ubuntu_host() { - local hostdeps="libusb-dev git parted lib32z1 lib32stdc++6 libusb-0.1-4 libusb-1.0-0-dev libusb-1.0-0 ccache libncurses5 pv base-files linux-base xz-utils" + local hostdeps="libusb-dev git parted lib32z1 lib32stdc++6 libusb-0.1-4 libusb-1.0-0-dev libusb-1.0-0 ccache pv base-files linux-base xz-utils" local deps=() local installed=$(dpkg-query -W -f '${db:Status-Abbrev}|${binary:Package}\n' '*' 2>/dev/null | grep '^ii' | awk -F '|' '{print $2}' | cut -d ':' -f 1) - if [[ "$DISTRIB" == "Ubuntu" ]] && [[ "$DISTRIB_RELEASE" == "18.10" || "$DISTRIB_RELEASE" =~ "20" || "$DISTRIB_RELEASE" =~ "22" || "$DISTRIB_RELEASE" =~ "24" ]]; then - hostdeps="$hostdeps lib32ncurses6" + # ncurses5 was dropped after 18.04; 18.10 and newer carry the ncurses6 packages + if (( DISTRIB_VER >= 1810 )); then + hostdeps="$hostdeps libncurses6 lib32ncurses6" else - hostdeps="$hostdeps lib32ncurses5" + hostdeps="$hostdeps libncurses5 lib32ncurses5" fi for packet in $hostdeps; do diff --git a/aml-flash-tool/INSTALL b/aml-flash-tool/INSTALL index 666db62..89884b9 100755 --- a/aml-flash-tool/INSTALL +++ b/aml-flash-tool/INSTALL @@ -9,6 +9,8 @@ if [ "$(uname -s)" = "Darwin" ]; then else DISTRIB=$(cat /etc/lsb-release | grep "DISTRIB_ID" | awk -F "=" '{print $2}') DISTRIB_RELEASE=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE" | awk -F "=" '{print $2}') + # Numeric form of the release for comparisons: 26.04 -> 2604, 18.10 -> 1810 + DISTRIB_VER=$(awk -F. '{ printf "%d%02d", $1, $2 }' <<< "$DISTRIB_RELEASE") fi FLASH_TOOL="$BASE/flash-tool" @@ -56,7 +58,7 @@ if [ "$DISTRIB" != "macOS" ]; then RULE="$RULES_DIR/70-persistent-usb-ubuntu12.rules" sudo cp $RULE /etc/udev/rules.d sudo sed -i s/OWNER=\"amlogic\"/OWNER=\"`whoami`\"/g /etc/udev/rules.d/$(basename $RULE) - elif [[ "$IGNORE_CHECK" == "yes" || "$DISTRIB_RELEASE" =~ "14" || "$DISTRIB_RELEASE" =~ "16" || "$DISTRIB_RELEASE" =~ "18" || "$DISTRIB_RELEASE" =~ "19" || "$DISTRIB_RELEASE" =~ "20" || "$DISTRIB_RELEASE" =~ "22" || "$DISTRIB_RELEASE" =~ "24" ]]; then + elif [[ "$IGNORE_CHECK" == "yes" ]] || (( DISTRIB_VER >= 1400 )); then RULE="$RULES_DIR/70-persistent-usb-ubuntu14.rules" sudo cp $RULE /etc/udev/rules.d else diff --git a/aml-flash-tool/UNINSTALL b/aml-flash-tool/UNINSTALL index 9591357..a563b24 100755 --- a/aml-flash-tool/UNINSTALL +++ b/aml-flash-tool/UNINSTALL @@ -9,6 +9,8 @@ if [ "$(uname -s)" = "Darwin" ]; then else DISTRIB=$(cat /etc/lsb-release | grep "DISTRIB_ID" | awk -F "=" '{print $2}') DISTRIB_RELEASE=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE" | awk -F "=" '{print $2}') + # Numeric form of the release for comparisons: 26.04 -> 2604, 18.10 -> 1810 + DISTRIB_VER=$(awk -F. '{ printf "%d%02d", $1, $2 }' <<< "$DISTRIB_RELEASE") fi KHADAS_TOOL_NAME="aml-burn-tool" @@ -37,7 +39,7 @@ if [[ "$DISTRIB" != "macOS" ]]; then if [[ "$DISTRIB_RELEASE" =~ "12" ]]; then RULE="/etc/udev/rules.d/70-persistent-usb-ubuntu12.rules" - elif [[ "$DISTRIB_RELEASE" =~ "14" || "$DISTRIB_RELEASE" =~ "16" || "$DISTRIB_RELEASE" =~ "18" || "$DISTRIB_RELEASE" =~ "20" ]]; then + elif (( DISTRIB_VER >= 1400 )); then RULE="/etc/udev/rules.d/70-persistent-usb-ubuntu14.rules" else # error_msg "Ubuntu $DISTRIB_RELEASE haven't been verified!" diff --git a/rk-flash-tool/INSTALL b/rk-flash-tool/INSTALL index 48dc905..64a09b5 100755 --- a/rk-flash-tool/INSTALL +++ b/rk-flash-tool/INSTALL @@ -11,6 +11,8 @@ else ANDROID_TOOL_CONFIG="$BASE/tools/Linux_Upgrade_Tool/config.ini" DISTRIB=$(cat /etc/lsb-release | grep "DISTRIB_ID" | awk -F "=" '{print $2}') DISTRIB_RELEASE=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE" | awk -F "=" '{print $2}') + # Numeric form of the release for comparisons: 26.04 -> 2604, 18.10 -> 1810 + DISTRIB_VER=$(awk -F. '{ printf "%d%02d", $1, $2 }' <<< "$DISTRIB_RELEASE") fi FLASH_TOOL="$BASE/flash-tool" @@ -54,7 +56,7 @@ fi if [ "$DISTRIB" != "macOS" ]; then echo "Installing USB rules..." - if [[ "$IGNORE_CHECK" == "yes" || "$DISTRIB_RELEASE" =~ "16" || "$DISTRIB_RELEASE" =~ "18" || "$DISTRIB_RELEASE" =~ "20" || "$DISTRIB_RELEASE" =~ "22" || "$DISTRIB_RELEASE" =~ "24" ]]; then + if [[ "$IGNORE_CHECK" == "yes" ]] || (( DISTRIB_VER >= 1600 )); then RULE="$RULES_DIR/80-rockchip-usb.rules" sudo cp $RULE /etc/udev/rules.d else diff --git a/tone-dfu-tool/INSTALL b/tone-dfu-tool/INSTALL index 8d52fba..5bad86a 100755 --- a/tone-dfu-tool/INSTALL +++ b/tone-dfu-tool/INSTALL @@ -9,6 +9,8 @@ if [ "$(uname -s)" = "Darwin" ] ; then else DISTRIB=$(cat /etc/lsb-release | grep "DISTRIB_ID" | awk -F "=" '{print $2}') DISTRIB_RELEASE=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE" | awk -F "=" '{print $2}') + # Numeric form of the release for comparisons: 26.04 -> 2604, 18.10 -> 1810 + DISTRIB_VER=$(awk -F. '{ printf "%d%02d", $1, $2 }' <<< "$DISTRIB_RELEASE") fi KHADAS_TOOL="$BASE/tone-burn-tool" @@ -51,7 +53,7 @@ fi if [ "$DISTRIB" != "macOS" ]; then echo "Installing USB rules..." - if [[ "$IGNORE_CHECK" == "yes" || "$DISTRIB_RELEASE" =~ "16" || "$DISTRIB_RELEASE" =~ "18" || "$DISTRIB_RELEASE" =~ "20" || "$DISTRIB_RELEASE" =~ "22" || "$DISTRIB_RELEASE" =~ "24" ]]; then + if [[ "$IGNORE_CHECK" == "yes" ]] || (( DISTRIB_VER >= 1600 )); then RULE="$RULES_DIR/80-tone-usb.rules" sudo cp $RULE /etc/udev/rules.d else