Big Sur upgrade deployment issues

rpayne
Contributor II

I'm having an issue with the osupgrade.sh workflow. I've updated the script, and packaged the full installer macOS 11.2.2 in a dmg. The issue seems to being in the part of the script that looks for the installer.

If the installer is present, it's supposed to run it. It's not. Every time, it deletes it and downloads the one in the cache policy, then, deletes it and does it again. The Installer that is in the package run fine if manually executed. The path in the script options is also set correctly. Is anyone else having this issue?

3 REPLIES 3

rpayne
Contributor II

Can't seem to figure it out

luke_michelson
New Contributor III
New Contributor III

@rpayne I'm having the same issue with macOSUpgrade.sh script. I'm going to manually step through the script to see if I can figure out the issue.

luke_michelson
New Contributor III
New Contributor III

@rpayne In the script macOSUpgrade.sh line 66 the parameter 5, which is the version of the OS, is passed from Jamf.

installerVersion="$5"
installerVersion_Full_Integer="$( /bin/echo "$installerVersion" | /usr/bin/awk -F. '{ print ($1 * 10 ** 4 + $2 * 10 ** 2 + $3 )}' )"
installerVersion_Major_Integer=$(/bin/echo "$installerVersion" | /usr/bin/cut -d. -f 1,2 | /usr/bin/awk -F. '{for(i=1; i<=NF; i++) {printf("%02d",$i)}}')

I have it set to 11.2.2. In the while loop starting at line 389 and ending at line 440 the following line of code are used to get the version of the downloaded OS installer:

if [ "$installerVersion_Full_Integer" -lt 110000 ]; then
                currentInstallerVersion=$(/usr/libexec/PlistBuddy -c "print 'System Image Info:version'" "$installerPlist")
else
                currentInstallerVersion=$(/usr/libexec/PlistBuddy -c "print DTPlatformVersion" "$installerPlist")
fi

Manually checking /Applications/Install macOS Big Sur.app/Content/Info.plist DTPlatformVersion is 11.2. The if statement at line 405:

 if [ "$currentInstallerVersion" = "$installerVersion" ]; then
            /bin/echo "Installer check: Target version is ok ($currentInstallerVersion)."

Is never true, since 11.2.2 != 11.2. So the script does the download function repeatedly until it reach the maxTrialCount and fails. I checked and if I set parameter 5 to 11.2 the upgrade script works. Looking in Info.plist there isn't a string that has the minor release, i.e 11.2.2 to compare against.