Skip to content

Commit c30dced

Browse files
committed
[LW-10649] Run the SSE4 check only outside of nix-chroot
1 parent ab60ea2 commit c30dced

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

nix/internal/linux-self-extracting-archive.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ set -eu
77

88
skip_bytes=$(( 1010101010 - 1000000000 ))
99

10-
if ! grep sse4 /proc/cpuinfo -q; then
11-
echo "ERROR: your cpu lacks SSE4 support, cardano will not work"
12-
exit 1
13-
fi
1410

1511
# We could be running as an auto-update from Daedalus ≤5.4.0 using `nix-chroot`,
1612
# then our behavior should be different:
@@ -21,6 +17,14 @@ if [ "${1-}" = "--extract" ] && [ -e /nix/var/nix/profiles/profile-@CLUSTER@ ] ;
2117
num_steps=6 # let’s have 6, so that we never reach 100% in UI, and the old update-runner also uses 6
2218
fi
2319

20+
if [ -z "$in_chroot" ] ; then
21+
# nix-chroot doesn’t contain `grep`
22+
if ! grep sse4 /proc/cpuinfo -q; then
23+
echo "ERROR: your cpu lacks SSE4 support, cardano will not work"
24+
exit 1
25+
fi
26+
fi
27+
2428
echo STATUS "Verifying SHA-256 checksum..."
2529
echo PROG 1/$num_steps
2630
our_checksum=$(tail -c+$((skip_bytes+1)) "$0" | sha256sum | cut -d' ' -f1)

0 commit comments

Comments
 (0)