Skip to content

Commit 90c8401

Browse files
authored
Merge pull request #2664 from kinnison/fix-2654
rustup-init.sh: Check for /proc early
2 parents 3ac5076 + 7b6d929 commit 90c8401

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: rustup-init.sh

+9
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ main() {
140140
return "$_retval"
141141
}
142142

143+
check_proc() {
144+
# Check for /proc by looking for the /proc/self/exe link
145+
# This is only run on Linux
146+
if ! test -L /proc/self/exe ; then
147+
err "fatal: Unable to find /proc/self/exe. Is /proc mounted? Installation cannot proceed without /proc."
148+
fi
149+
}
150+
143151
get_bitness() {
144152
need_cmd head
145153
# Architecture detection without dependencies beyond coreutils.
@@ -237,6 +245,7 @@ get_architecture() {
237245
;;
238246

239247
Linux)
248+
check_proc
240249
_ostype=unknown-linux-$_clibtype
241250
_bitness=$(get_bitness)
242251
;;

0 commit comments

Comments
 (0)