Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 996eb6c

Browse files
authored
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'
1 parent 832052a commit 996eb6c

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

scripts/obtain/dotnet-install.sh

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ check_min_reqs() {
230230
check_pre_reqs() {
231231
eval $invocation
232232

233-
local failing=false;
234-
235233
if [ "${DOTNET_INSTALL_SKIP_PREREQS:-}" = "1" ]; then
236234
return 0
237235
fi
@@ -247,14 +245,10 @@ check_pre_reqs() {
247245
local librarypath=${LD_LIBRARY_PATH:-}
248246
LDCONFIG_COMMAND="$LDCONFIG_COMMAND -NXv ${librarypath//:/ }"
249247

250-
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true
251-
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true
252-
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true
253-
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true
254-
fi
255-
256-
if [ "$failing" = true ]; then
257-
return 1
248+
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libunwind)" ] && say_warning "Unable to locate libunwind. Probable prerequisite missing; please install libunwind."
249+
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_warning "Unable to locate libssl. Probable prerequisite missing; please install libssl."
250+
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_warning "Unable to locate libicu. Probable prerequisite missing; please install libicu."
251+
[ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_warning "Unable to locate libcurl. Probable prerequisite missing; please install libcurl."
258252
fi
259253

260254
return 0
@@ -312,7 +306,21 @@ combine_paths() {
312306
get_machine_architecture() {
313307
eval $invocation
314308

315-
# Currently the only one supported
309+
if command -v uname > /dev/null; then
310+
CPUName=$(uname -m)
311+
case $CPUName in
312+
armv7l)
313+
echo "arm"
314+
return 0
315+
;;
316+
aarch64)
317+
echo "arm64"
318+
return 0
319+
;;
320+
esac
321+
fi
322+
323+
# Always default to 'x64'
316324
echo "x64"
317325
return 0
318326
}
@@ -332,9 +340,13 @@ get_normalized_architecture_from_architecture() {
332340
echo "x64"
333341
return 0
334342
;;
335-
x86)
336-
say_err "Architecture \`x86\` currently not supported"
337-
return 1
343+
arm)
344+
echo "arm"
345+
return 0
346+
;;
347+
arm64)
348+
echo "arm64"
349+
return 0
338350
;;
339351
esac
340352

@@ -872,7 +884,7 @@ do
872884
echo "$script_name is a simple command line interface for obtaining dotnet cli."
873885
echo ""
874886
echo "Options:"
875-
echo " -c,--channel <CHANNEL> Download from the CHANNEL specified, Defaults to \`$channel\`."
887+
echo " -c,--channel <CHANNEL> Download from the channel specified, Defaults to \`$channel\`."
876888
echo " -Channel"
877889
echo " Possible values:"
878890
echo " - Current - most current release"
@@ -891,8 +903,9 @@ do
891903
echo " examples: 2.0.0-preview2-006120; 1.1.0"
892904
echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
893905
echo " -InstallDir"
894-
echo " --architecture <ARCHITECTURE> Architecture of .NET Tools. Currently only x64 is supported."
906+
echo " --architecture <ARCHITECTURE> Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`."
895907
echo " --arch,-Architecture,-Arch"
908+
echo " Possible values: x64, arm, and arm64"
896909
echo " --runtime <RUNTIME> Installs a shared runtime only, without the SDK."
897910
echo " -Runtime"
898911
echo " Possible values:"

0 commit comments

Comments
 (0)