|
5 | 5 |
|
6 | 6 | set -e
|
7 | 7 |
|
| 8 | +# Do not remove this check. |
| 9 | +# Provides a way to skip the server requirements check from |
| 10 | +# outside the install flow. A system process can create this |
| 11 | +# file before the server is downloaded and installed. |
| 12 | +# |
| 13 | +# This check is duplicated between code-server-linux.sh and here |
| 14 | +# since remote container calls into this script directly quite early |
| 15 | +# before the usual server startup flow. |
| 16 | +if [ -f "/tmp/vscode-skip-server-requirements-check" ]; then |
| 17 | + echo "!!! WARNING: Skipping server pre-requisite check !!!" |
| 18 | + echo "!!! Server stability is not guaranteed. Proceed at your own risk. !!!" |
| 19 | + exit 0 |
| 20 | +fi |
| 21 | + |
8 | 22 | BITNESS=$(getconf LONG_BIT)
|
9 | 23 | ARCH=$(uname -m)
|
10 | 24 | found_required_glibc=0
|
11 | 25 | found_required_glibcxx=0
|
12 | 26 |
|
13 | 27 | # Extract the ID value from /etc/os-release
|
14 |
| -OS_ID="$(cat /etc/os-release | grep -Eo 'ID=([^"]+)' | sed 's/ID=//')" |
| 28 | +OS_ID="$(cat /etc/os-release | grep -Eo 'ID=([^"]+)' | sed -n '1s/ID=//p')" |
15 | 29 | if [ "$OS_ID" = "nixos" ]; then
|
16 | 30 | echo "Warning: NixOS detected, skipping GLIBC check"
|
17 | 31 | exit 0
|
@@ -64,7 +78,7 @@ if [ -n "$libstdcpp_path" ]; then
|
64 | 78 | fi
|
65 | 79 | fi
|
66 | 80 |
|
67 |
| -if [ -n "$(ldd --version | grep -v musl)" ]; then |
| 81 | +if [ -z "$(ldd --version 2>&1 | grep 'musl libc')" ]; then |
68 | 82 | if [ -f /usr/lib64/libc.so.6 ]; then
|
69 | 83 | # Typical path
|
70 | 84 | libc_path='/usr/lib64/libc.so.6'
|
@@ -96,7 +110,16 @@ if [ -n "$(ldd --version | grep -v musl)" ]; then
|
96 | 110 | fi
|
97 | 111 | fi
|
98 | 112 | else
|
99 |
| - echo "Warning: musl detected, skipping GLIBC check" |
| 113 | + if [ "$OS_ID" = "alpine" ]; then |
| 114 | + musl_version=$(ldd --version 2>&1 | grep "Version" | awk '{print $NF}') |
| 115 | + if [ "$(printf '%s\n' "1.2.3" "$musl_version" | sort -V | head -n1)" != "1.2.3" ]; then |
| 116 | + echo "Error: Unsupported alpine distribution. Please refer to our supported distro section https://aka.ms/vscode-remote/linux for additional information." |
| 117 | + exit 99 |
| 118 | + fi |
| 119 | + else |
| 120 | + echo "Warning: musl detected, skipping GLIBC check" |
| 121 | + fi |
| 122 | + |
100 | 123 | found_required_glibc=1
|
101 | 124 | fi
|
102 | 125 |
|
|
0 commit comments