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.
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