Skip to content

Commit

Permalink
Merge pull request #246 from cvgs/v26.1-rc-arch
Browse files Browse the repository at this point in the history
Fix for Issue #225: Use sysctl to check for ARM
  • Loading branch information
grahampugh authored May 22, 2022
2 parents e2bf9ad + dc8254a commit 41ad162
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erase-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,9 @@ fi
# Silicon Macs require a username and password to run startosinstall
# We therefore need to be logged in to proceed, if we are going to erase or reinstall
# This goes before the download so users aren't waiting for the prompt for username
arch=$(/usr/bin/arch)
# Check for Apple Silicon using sysctl, because arch will not report arm64 if running under Rosetta.
[[ $(/usr/sbin/sysctl -q -n "hw.optional.arm64") -eq 1 ]] && arch="arm64" || arch=$(/usr/bin/arch)
echo " [$script_name] Running on architecture $arch"
if [[ "$arch" == "arm64" && ($erase == "yes" || $reinstall == "yes") ]]; then
if ! pgrep -q Finder ; then
echo " [$script_name] ERROR! The startosinstall binary requires a user to be logged in."
Expand Down

0 comments on commit 41ad162

Please sign in to comment.