Skip to content

Commit d00c2e7

Browse files
cheungtitusTItus Cheung
andauthored
Added support of Linux on Mac with ARM processors (#631)
Co-authored-by: TItus Cheung <[email protected]>
1 parent 6c37c5d commit d00c2e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

discourse-setup

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ scale_ram_and_cpu() {
257257
avail_cores=`sysctl hw.ncpu | awk '/hw.ncpu:/ {print $2}'`
258258
else
259259
avail_gb=$(check_linux_memory)
260-
avail_cores=`lscpu --parse=core | egrep -v ^# | sort -u | wc -l`
260+
threads_per_core=$(lscpu | awk 'BEGIN {FS=":"} /Thread\(s\) per core/ {print $2}')
261+
avail_cores=$((`lscpu | awk '/^CPU\(s\)/ {print $2}'`*${threads_per_core}))
261262
fi
262263
echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores"
263264

0 commit comments

Comments
 (0)