Skip to content

Commit 4a7462c

Browse files
authored
Fail on unsupported ARM architecture levels (#455)
1 parent 6d8d9b6 commit 4a7462c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/dotnet-install.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ get_machine_architecture() {
298298
if command -v uname > /dev/null; then
299299
CPUName=$(uname -m)
300300
case $CPUName in
301+
armv1*|armv2*|armv3*|armv4*|armv5*|armv6*)
302+
echo "armv6-or-below"
303+
return 0
304+
;;
301305
armv*l)
302306
echo "arm"
303307
return 0
@@ -339,7 +343,13 @@ get_normalized_architecture_from_architecture() {
339343
local architecture="$(to_lowercase "$1")"
340344

341345
if [[ $architecture == \<auto\> ]]; then
342-
echo "$(get_machine_architecture)"
346+
machine_architecture="$(get_machine_architecture)"
347+
if [[ "$machine_architecture" == "armv6-or-below" ]]; then
348+
say_err "Architecture \`$machine_architecture\` not supported. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues"
349+
return 1
350+
fi
351+
352+
echo $machine_architecture
343353
return 0
344354
fi
345355

0 commit comments

Comments
 (0)