Using System Image Utility with Lion

Using SIU can be a pretty good way of setting up a fresh system, providing users with an out of box experience. While the notes below are written and tested on Lion, i believe they would work equally well in Snow Leopard.

Some basic steps to use SIU for imaging Lion.

– Prepare a Lion installation CD
– Prepare all software that needs to be deployed into packages using PackageMaker

General Notes on Packages

Some notes on preparation and utilization of Packages using PackageMaker (PM) and the “Add Packages…” action
– Software that are packaged entirely in an APP file can be easily installed by dragging into the PM tool and ensuring that the installation locations are right
– CD Installers or MPKG installers needs to be inspected and have the ACTUAL packed PKG files included instead of the MPKG
– Take note of the installation locations of the files and make sure that it goes to the right places
– Some packages REQUIRES a user to be pre-created or requires a user environment to install. PLEASE TEST the packages that you create to ENSURE that the list of packages works fine.

This results in my next comment of….
– TEST, TEST, TEST

Customizing actions to be done AFTER a NetInstall

In order to create users or take action AFTER the installation, it is required to run post install scripts. There are several ways to do this, but i have found that the way i like it best is to have these actions kick start IMMEDIATELY when the system reboots after installation. The way i have done this is to actually REPLACE the “Setup Assistant” application within /System/Library/CoreServices with a customized version which would run the things i want it to do. In short, what i customized within “Setup Assistant” was:-
1)  Moved the original “Setup Assistant” binary in Contents/MacOS to “Setup Mac Assistant”
2) Create an executable shell script called “Setup Assistant” instead
3) Write the shell script to do what ever i want it to do
4) Have a finalizing command that executes “Setup Mac Assistant”. Once that completes the script replaces the shell script “Setup Assistant” with “Setup Mac Assistant”

There are a variety of things that can be done using this method. I have
1) created a hidden admin user,
2) changed the initial created user at ID of 501 to a standard user instead of admin
3) changed the name of the computer to a PREFIX-MACADDRESS

There has been cases in my tests that there are installations that requires the CD to be in place or a DMG to be mounted for it to be successfully installed. In those cases, i have created a DMG and deployed those in a package into the system in a fixed known location. Then i use the above “Setup Assistant” method to run the installer CLI to get those software in place.

SIU Usage

1. Select to create a NetInstall Image using the Lion Installation CD and click on customize
2. Drag any partitioning actions AFTER the “Define Image” action. It is better to create known partition names for easier targeting later.
3. Drag the “Add Packages…” action BEFORE the “Create Image” action. Add the packages that was created with PackageMaker into this action.
4. Drag “Enable Automated Installation” AFTER the “Define Image Source”. If the named volume is known, type in the name at this point.
5. Put “Customize Package Selection” AFTER the “Add Packages…” action and select the predefined items
6. Run the workflow.

This would create a NetInstall Image with the relevant packages included and will automatically wipe and install a machine choosing this Network Image.

What’s the advantage of doing this compared to a clone?

Doing a clone results in all the software bits being configured for a base system and then replicated perhaps to other dis-similar systems, potentially resulting in mis-configuration of the underlying hardware. It also potentially introduces “noise” into the installed image such as uncleared cache or pre-deposited ID files.

Using this method, though requires a little more time and testing, would result in a system state which is FRESH as an installation without compromising user experience during setup.

I have the “Setup Assistant” script that i used in this process attached. May it be a reference if this method of setting up works out for you.

Setup Assistant Script