Skip to content

Commit

Permalink
Merge pull request #2664 from kinnison/fix-2654
Browse files Browse the repository at this point in the history
rustup-init.sh: Check for /proc early
  • Loading branch information
kinnison authored Feb 16, 2021
2 parents 3ac5076 + 7b6d929 commit 90c8401
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ main() {
return "$_retval"
}

check_proc() {
# Check for /proc by looking for the /proc/self/exe link
# This is only run on Linux
if ! test -L /proc/self/exe ; then
err "fatal: Unable to find /proc/self/exe. Is /proc mounted? Installation cannot proceed without /proc."
fi
}

get_bitness() {
need_cmd head
# Architecture detection without dependencies beyond coreutils.
Expand Down Expand Up @@ -237,6 +245,7 @@ get_architecture() {
;;

Linux)
check_proc
_ostype=unknown-linux-$_clibtype
_bitness=$(get_bitness)
;;
Expand Down

0 comments on commit 90c8401

Please sign in to comment.