If you’re using Munki and you have Macs you want recovery partitions on (they’re on there by default, but you may have accidentally deleted a recovery partition by reformatting the entire drive instead of just the main partition), here’s one way you can approach it.
First, definitely use Create Recovery Partition Installer to create the installer. More details at Recreating a deleted recovery partition on a Mac.
Thing is—it creates a package, which installs receipts. In most cases, you don’t want to reinstall the recovery partition, because the recovery partition is already there and doesn’t need to be reinstalled. By default for .pkg files, Munki will check for receipts to see if a package is installed. We don’t really need the package installed. We just need to see if there is a recovery partition or not.
Munki actually has several ways to check if a package is “installed,” and one of those is an install check script.
So I just created recovery partition packages for Yosemite and El Capitan, and then gave them this install check script:
<string>#!/bin/bash
# Create a variable to see if a recovery partition exists
testVariable=$(diskutil list | grep “Apple_Boot”)
# If it’s empty, it’s not installed
if [ -z “$testVariable” ]; then
exit 0
# If it’s not empty, it’s installed
else
exit 1
fi</string>
So it basically looks for, in the partition table, a partition of type Apple_Boot. If it sees that type there, it means the recovery partition is installed. Otherwise, it means the recovery partition is not installed.
Leave a Reply