Posted on 01-07-2021 08:32 AM
Anyone happen to have an extension attribute written that detects whether or not Rosetta 2 is installed on the new M1 computers? This would help for deploying a policy to enable Rosetta on anything where it is currently disabled just in case an update removes it for whatever reason.
Posted on 02-25-2021 06:40 AM
Also interested in this. I do not know how to check to see if Rosetta is installed.
Posted on 02-25-2021 06:48 AM
Pulled from this thread, which is a good read https://www.jamf.com/jamf-nation/discussions/37357/deploy-rosetta-on-m1-machines-before-everything-else#responseChild212868
: << DOC
EA to determine whether Rosetta is installed.
Possible results:
"installed" - arm64 Mac - Rosetta is installed
"missing" - arm64 Mac - Rosetta is not installed
"ineligible" - Intel Mac - Rosetta cannot be installed
DOC
arch=$(/usr/bin/arch)
if [ "$arch" == "arm64" ]; then
# is rosetta 2 installed?
if [[ -f "/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist" ]]; then
result="installed"
else
result="missing"
fi
else
result="ineligible"
fi
echo "<result>$result</result>"
Posted on 06-15-2021 12:09 PM
@Jason33 Were you able to get this to work?
07-29-2021 08:52 AM - edited 07-29-2021 08:59 AM
Apple has moved the LaunchDaemon's default install path.
You can add an OR operator to check `/System/Library/LaunchDaemons/` as well.
arch=$(/usr/bin/arch)
if [ "$arch" == "arm64" ]; then # is rosetta 2 installed?
if [[ -f "/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist" || -f "/System/Library/LaunchDaemons/com.apple.oahd.plist" ]];
then result="installed"
else result="missing"
fi
else result="ineligible"
fi
echo "<result>$result</result>"
That's messy and if changed, it may not work in the future. I just got this code from Apple Enterprise Support for using CoreFoundation to check if the system can run x86_64 code with the arch binary.
% cat can_run_x86.sh
#!/bin/sh
arch -x86_64 /usr/bin/true 2> /dev/null
if [ $? -eq 0 ]; then
echo "Can run X86_64 code!"
else
echo "X86_64 code is not runnable!"
fi
...SO, put that in the EA and you get...
TLDR: USE THIS
#!/bin/sh
arch=$(/usr/bin/arch)
if [ "$arch" == "arm64" ]; then # is rosetta 2 installed?
arch -x86_64 /usr/bin/true 2> /dev/null
if [ $? -eq 1 ];
then result="missing"
else result="installed"
fi
else result="ineligible"
fi
echo "<result>$result</result>"
Posted on 12-03-2021 08:29 AM
Thanks for this update. I just realized that I have 75 Macs that have been constantly reinstalling Rosetta at every Check-In because of this change of location.