From 996eb6c92c9c012c2147358292022756993425fd Mon Sep 17 00:00:00 2001 From: John Beisner Date: Wed, 11 Apr 2018 09:24:23 -0700 Subject: [PATCH] Dotnet install-script updates (#9033) * Introduce support for arm & arm64 architectures; when detecting a missing 'library' prerequisite - do not fail the installation. * Auto-detect 'armv7l' and 'aarch64' --- scripts/obtain/dotnet-install.sh | 45 ++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 55de51b91..80dde3a56 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -230,8 +230,6 @@ check_min_reqs() { check_pre_reqs() { eval $invocation - local failing=false; - if [ "${DOTNET_INSTALL_SKIP_PREREQS:-}" = "1" ]; then return 0 fi @@ -247,14 +245,10 @@ check_pre_reqs() { local librarypath=${LD_LIBRARY_PATH:-} LDCONFIG_COMMAND="$LDCONFIG_COMMAND -NXv ${librarypath//:/ }" - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true - fi - - if [ "$failing" = true ]; then - return 1 + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libunwind)" ] && say_warning "Unable to locate libunwind. Probable prerequisite missing; please install libunwind." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_warning "Unable to locate libssl. Probable prerequisite missing; please install libssl." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_warning "Unable to locate libicu. Probable prerequisite missing; please install libicu." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_warning "Unable to locate libcurl. Probable prerequisite missing; please install libcurl." fi return 0 @@ -312,7 +306,21 @@ combine_paths() { get_machine_architecture() { eval $invocation - # Currently the only one supported + if command -v uname > /dev/null; then + CPUName=$(uname -m) + case $CPUName in + armv7l) + echo "arm" + return 0 + ;; + aarch64) + echo "arm64" + return 0 + ;; + esac + fi + + # Always default to 'x64' echo "x64" return 0 } @@ -332,9 +340,13 @@ get_normalized_architecture_from_architecture() { echo "x64" return 0 ;; - x86) - say_err "Architecture \`x86\` currently not supported" - return 1 + arm) + echo "arm" + return 0 + ;; + arm64) + echo "arm64" + return 0 ;; esac @@ -872,7 +884,7 @@ do echo "$script_name is a simple command line interface for obtaining dotnet cli." echo "" echo "Options:" - echo " -c,--channel Download from the CHANNEL specified, Defaults to \`$channel\`." + echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." echo " -Channel" echo " Possible values:" echo " - Current - most current release" @@ -891,8 +903,9 @@ do echo " examples: 2.0.0-preview2-006120; 1.1.0" echo " -i,--install-dir Install under specified location (see Install Location below)" echo " -InstallDir" - echo " --architecture Architecture of .NET Tools. Currently only x64 is supported." + echo " --architecture Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`." echo " --arch,-Architecture,-Arch" + echo " Possible values: x64, arm, and arm64" echo " --runtime Installs a shared runtime only, without the SDK." echo " -Runtime" echo " Possible values:"