Has anyone out there successfully incorporated custom scripts into the distribution constructor? What I'd like to to is to be able to incorporate arbitrary files into the image so that any boxes installed with my new image will have these files available at first boot. There is a lot of documentation on including custom scripts into the constructor but no good examples of the scripts themselves.
Edited by: carsonoid on Dec 27, 2012 2:43 PM
I agree that we don't have any useful examples of the scripts, but that's in part because we don't have much information on what kinds of customizations people are looking to do. If all you're trying to do is add some files, you may find it easiest to just put them in a small IPS package and include the package in the software listed in the DC manifest; that way you can later update the systems installed with that image just by updating the package in the repository and using "pkg update".
Just as an FYI, here is how I managed to accomplish my goal.
To include some files/packages in a default installation of Solaris 11.1 using only the disk. The custom files and packages should not be dependent on any networked repository.
1. Create a local (empty) repo on the machine that will be running the distribution constructor
`pkgrepo create /export/repoSolaris11`
2. Create a simple IPS package containing the files and publish it to the local repo
3. Create a new checkpoint in your distribution constructor xml manifest that points to a custom script.
4. The custom script should copy the /export/repoSolaris11 folder to the root of the /rpool/dc/ai/build_data/boot_archive/ folder
5. Run the distribution constructor and build a new .iso
The iso should have a more or less standard layout except you will have a local filesystem repo available to the installation enviroment.
6. Create a custom ai_manifest(5) file which includes an additional publisher entry at the top for your local filesystem repo. It should also include the custom packages for your repo:
<!-- Install custom packages, they should come from the local fileysystem repo -->
That's it! When you do the automated install it will install the custom packages from a repo contained on the iso itself. The instructions aren't 100% but it should help anyone else with this know the right direction.
One big caveat here is that the entire boot environment is loaded into a ramdisk. So make sure that your server has more ram than the repo's final size.
Edited by: carsonoid on Jan 3, 2013 10:09 AM