Son of InstallLion.pkg
Last fall, I released a set of tools I called “InstallLion.pkg”. The introductory post is here.
Now that Mountain Lion has been released, you may be wondering: “Can I use these tools to create a deployment package for Mountain Lion?” The answer is yes. InstallLion.pkg can be used to make an installer package for Mountain Lion.
But I have a better set of tools for you. Today I’m introducing createOSXinstallPkg. This tool can be used to create installer packages for Lion and Mountain Lion and features many improvements over the “InstallLion.pkg” tools.
The first improvement: it’s much easier to use createOSXinstallPkg to create installer packages. With the old tools, you had to run one or two scripts — one to download an “IncompatibleAppList” package, and one to customize the InstallESD.dmg if you wanted to install additional packages along with the OS X install. And then you had to manually assemble the package, copying several components into the right places within a template package.
With createOSXinstallPkg, it’s as easy as:
sudo ./createOSXinstallPkg --source /Applications/Install\ OS\ X\ Mountain\ Lion.app
to create a basic uncustomized package that installs Mountain Lion.
But wait! There’s more!
Where to find it
You can download a zip archive of the createOSXinstallPkg tools here.
Or clone the Git repo: git clone https://code.google.com/p/munki.installlionpkg/
Documentation is here.
Additional improvements:
The installer packages generated by the original InstallLion.pkg tools could not install on volumes encrypted with FileVault 2. Packages created with createOSXinstallPkg can be installed on encrypted volumes.
The pre-install checks done by InstallLion.pkg-generated packages were basic and not 100% accurate — they prevented the install of Lion on most machines that could not handle it, but not all. Packages generated by createOSXinstallPkg use Apple’s pre-install checks for Lion and Mountain Lion, so packages you generate will attempt to install only on those Macs officially supported by Apple.
Finally: both InstallLion.pkg and createOSXinstallPkg allow you to add additional packages to be installed after OS X is installed. This feature is intended to allow you to: install a local account or two (especially a local admin account), disable the Setup Assistant that normally runs at first boot, and install the software needed for whatever software deployment or configuration management system you might have. This might then serve as the basis for a “thin imaging” workflow, in which you install the OS and a few other tools, and then let your software deployment or configuration management system finish the setup and configuration of the machine.
Some folks tried to use the additional packages feature as a replacement for InstaDMG and/or System Image Utility in order to build a sort of modular deployment image containing Microsoft Office or iLife or even some Adobe applications. This often failed. There are two reasons this often doesn’t work as hoped:
- For speed and accuracy, additional packages are added to the existing disk image, made writable through the use of disk image “shadow files”. This technique allows one to write to a normally read-only disk image. This is much faster and less error-prone than creating a large writable disk image, copying everything accurately from the InstallESD.dmg, adding the additional packages, then converting the new disk image to read-only. But the downside of this approach is that even when made writeable, the InstallESD disk image only has so much available space. For the Lion and Mountain Lion InstallESD images I’ve seen to date, this is around 350MB. createOSXinstallPkg now warns you and refuses to continue if you attempt to add more packages than will fit on the disk image.
- The second issue is even more important and more limiting. The OS X Install environment used by the Lion and Mountain Lion installers is very stripped down — it does not have all the tools and scripting languages available in a “full” installation of OS X. This means that many package scripts will fail to execute properly in this environment. Add that to the fact that many package scripts fail to do the correct thing when installing to anything other than the boot volume (which is NOT what is happening during an OS X install), and you’ll find you should add only those packages that are absolutely needed. Additionally, you should verify that all package scripts are compatible with the Lion/Mountain Lion install environment.
Enjoy! Feedback and discussion should be directed to the munki-dev list at http://groups.google.com/group/munki-dev/
Explore posts in the same categories: Deployment, Lion, Mountain Lion, OS X, Packaging, Python
July 25, 2012 at 5:39 am
[...] a follow-up to Greg Neagle’s unveiling of createOSXinstallPkg, a installer package-based tool for deploying Mac OS X 10.7.x and 10.8.x, I wanted to do a follow [...]
July 25, 2012 at 7:09 am
You rock Greg! Thanks for all your hard work.
September 27, 2012 at 12:08 pm
Yes Greg, you definitely rock! You have helped me numerous times!
Thanks
July 25, 2012 at 9:55 am
Thank you!
I will try ASAP!
July 30, 2012 at 7:45 am
Works fantastic Greg. Thanks again for saving us all tons of time with this tool.
August 1, 2012 at 11:14 am
[...] that you can create an Installer package to install Lion or Mountain Lion, you have the possibility of using this package instead of an “image” to initially [...]
August 21, 2012 at 8:46 am
[...] possible to use this method with a NetInstall image, or incorporate it into a package built with createOSXinstallPkg. And if you wanted to use this method with DeployStudio, you must do it as a [...]
January 2, 2013 at 1:33 pm
Reblogged this on Andyinindy's Blog.
January 7, 2013 at 5:01 am
[...] of new installation methods, Greg Neagle of Walt Disney Animation Studios produced the “CreateOSXInstallPackage“ tool, allowing a package-based install of the OS that doesn’t rely on a base image. [...]
January 23, 2013 at 10:56 am
[...] same processes that were used to build their user’s Macs. They could also leverage tools like createOSXinstallPkg to set up template VMs with either the latest available OS X installer from the Mac App Store or [...]
February 12, 2013 at 7:40 pm
I’m trying to deploy Mountain Lion using this tool, and using Casper Self Service to deploy the package. The package seems to deploy with no problems, and I’ve set the policy to reboot the machine, but the install never happens. The computer simply reboots and the OS is untouched. The Casper policy logs don’t show that anything went wrong with the install, but I’m guessing that’s going to be the norm, regardless of whether it works or not. I tried going through the console logs, but have no idea what I’m looking for that might give me clues. Any help would be most appreciated.
Thanks!
February 12, 2013 at 9:22 pm
Assuming that you’ve tested the package manually and it works as expected, this sounds like it’s more related to issues with Casper. I don’t use Casper myself, but I know others are successfully using Casper with packages built with createOSXinstallPkg. I’d recommend asking on the JAMF Nation discussion forums: https://jamfnation.jamfsoftware.com/discussions.html
February 13, 2013 at 8:32 am
Thanks for pointing me in the right direction. Turns out it was how I had set up the policy. Thanks!
February 13, 2013 at 11:17 am
For those playing along at home, the fix was:
When you tell Casper to restart, make sure you specify “Currently Selected Startup Disk (No Bless)”.
The OS X Install process causes the boot volume to be configured in an unusual way, causing the machine to boot from a disk image so it can install OS X on the “live” disk. If Casper re-blesses the startup disk (in the normal way), upon reboot, the machine simply reboots into the existing OS. No install will occur.
Preserving the blessed boot environment is vital to the OS X install process.
February 19, 2013 at 3:07 am
I get this error:
Downloading and adding IncompatibleAppList pkg…
Error 7 retrieving https://swscan.apple.com/content/catalogs/others/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
curl: (7) couldn’t connect to host
Traceback (most recent call last):
File “/Volumes/SA-dayta-2/createOSXinstallPkg_20120831/createOSXinstallPkg”, line 883, in
main()
File “/Volumes/SA-dayta-2/createOSXinstallPkg_20120831/createOSXinstallPkg”, line 857, in main
getPkgAndMakeIndexSproduct(destpath, os_vers=os_version)
File “/Volumes/SA-dayta-2/createOSXinstallPkg_20120831/createOSXinstallPkg”, line 561, in getPkgAndMakeIndexSproduct
url = findIncompatibleAppListPkgURL(catalog_url, package_name)
File “/Volumes/SA-dayta-2/createOSXinstallPkg_20120831/createOSXinstallPkg”, line 513, in findIncompatibleAppListPkgURL
catalog = plistlib.readPlistFromString(catalog_str)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py”, line 103, in readPlistFromString
return readPlist(StringIO(data))
TypeError: expected read buffer, NoneType found
I tried pasting the url into Safari and it does connect, so I have no idea why it should fail with curl.
February 19, 2013 at 4:39 am
To answer my own question it must be due to using a proxy which curl is not picking up. So more Googling I guess.
March 15, 2013 at 11:34 am
I have the same issue in my environment. I found success by letting curl know about my proxy. I created ~/.curlrc and put in the following entry:
proxy = http://:
Hope this helps.
March 6, 2013 at 5:00 am
[...] in 10 Days,” my process involves crafting an OS X installer package using Greg Neagle’s CreateOSXInstallPkg to incorporate Munki, iCloud prompt / Lion registration suppression, a local admin account, and [...]
April 15, 2013 at 4:48 am
Hi,
I am trying to implement a similar method to create a hackintosh installer USB from the InstallESD.dmg. I wanted the installer to automatically install the boot loader and copy a directory (Extra) to target volume.
I tried to create a OSInstall.collection plist with contents :
/System/Installation/Packages/OSInstall.mpkg
/System/Installation/Packages/chimera.pkg
where chimera.pkg is a flat pkg which installs the Chimera bootloader (Chameleon boot loader with a few experimental branches merged)
The installer does not start. It says :
”
There was a problem reading the Mac OS X installation disc.
Carefully clean the disc, and then try reinstalling
”
Installer log has these messages :
”
Opening OSInstall package ‘/System/Installation/Packages/OSInstall.collection’.
Collections: firtst non-recursive document (/System/Installation/Packages/chimera.pkg) is not an OSInstall document.
Collections:Couldn’t create collection from path /System/Installation/Packages/OSInstall.collection
Couldn’t verify OS X (Server) Install media.
”
Is there anything I should add beside creating the OSInstall.collection ?
April 15, 2013 at 4:50 am
Sorry, pasting plist contents did not work. I’ll try again with a | on each line
|
|
|
|
| /System/Installation/Packages/OSInstall.mpkg
| /System/Installation/Packages/chimera.pkg
|
|
April 15, 2013 at 4:52 am
Sorry again. Plist without tag s
?xml version=”1.0″ encoding=”UTF-8″?
!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”
plist version=”1.0″
array
string /System/Installation/Packages/OSInstall.mpkg /string
string /System/Installation/Packages/chimera.pkg /string
/array
/plist
May 12, 2013 at 5:40 pm
[…] covered previously, Greg Neagle’s createOSXinstallPkg is a versatile tool for installing or upgrading Mac OS X in a variety of situations. One of the […]