In the past, I have mentioned that IPS is great. I think it is about time I gave you more information about it. This time, I’ll talk about the manifest and some core IPS ideals.
IPS, Image Packaging System, has some really neat ideas. Each package contains a manifest. The manifest is a file which list actions. Some very common actions are “install a file at path X,” “create a symlink from X to Y,” as well as “create user account X.” The great thing about this, is that the manifest completely describes what needs to be done to the system to install a package. Uninstalling a package simply undoes the actions — delete files, symlinks, users. (This is where the “image” in IPS comes from — you can assemble the system image from the manifests.)
For example, here is the (slightly hand edited) manifest for OpenIndiana’s rsync package:
set name=pkg.fmri value=pkg://firstname.lastname@example.org,5.11-0.151.1.7:20121003T221151Z set name=org.opensolaris.consolidation value=sfw set name=variant.opensolaris.zone value=global value=nonglobal set name=description value="rsync - faster, flexible replacement for rcp" set name=variant.arch value=i386 set name=pkg.summary value="rsync - faster, flexible replacement for rcp" set name=pkg.description value="rsync - A utility that provides fast incremental file transfer and copy." set name=info.classification value="org.opensolaris.category.2008:Applications/System Utilities" dir group=sys mode=0755 owner=root path=usr dir group=bin mode=0755 owner=root path=usr/bin dir group=sys mode=0755 owner=root path=usr/share dir group=bin mode=0755 owner=root path=usr/share/man dir group=bin mode=0755 owner=root path=usr/share/man/man1 dir group=bin mode=0755 owner=root path=usr/share/man/man5 license 88142ae0b65e59112954efdf152bb2342e43f5e7 chash=3b72b91c9315427c1994ebc5287dbe451c0731dc license=SUNWrsync.copyright pkg.csize=12402 pkg.size=35791 file 02f1be6412dd2c47776a62f6e765ad04d4eb328c chash=945deb12b17a9fd37461df4db7e2551ad814f88b elfarch=i386 elfbits=32 elfhash=1d3feb5e8532868b099e8ec373dbe0bea4f218f1 group=bin mode=0555 owner=root path=usr/bin/rsync pkg.csize=191690 pkg.size=395556 file 7bc01c64331c5937d2d552fd93268580d5dd7c66 chash=328e86655be05511b2612c7b5504091756ef7e61 group=bin mode=0444 owner=root path=usr/share/man/man1/rsync.1 pkg.csize=50628 pkg.size=165934 file 006fa773e1be3fecf7bbfb6c708ba25ddcb0005e chash=9e403b4965ec233c5e734e6fcf829a034d22aba9 group=bin mode=0444 owner=root path=usr/share/man/man5/rsyncd.conf.5 pkg.csize=12610 pkg.size=37410 depend fmri=consolidation/sfw/sfw-incorporation type=require depend email@example.com type=require
The manifest is very easily readable. It is obvious that there are several sets of actions:
- specifies the FMRI, description, and architecture among others
- lists all the directories that need to be created/deleted during installation/removal
- specifies the file with the text of the license for the package
- in general, most actions are file actions — each installs a file
- lastly, rsync depends on system/library and sfw-incorporation
The above example is missing symlinks, hardlinks, user accounts, services, and device driver related actions.
Many package management systems have the ability to execute arbitrary scripts after installation or prior to removal. IPS does not allow this since it would violate the idea that the manifest completely describes the package. This means (in theory), that one can tell IPS to install the base packages into a directory somewhere, and at the end one has a working system.
It all sounds good, doesn’t it? As always, the devil is in the details.
First of all, sometimes there’s just no clean way to perform all package setup at install time. One just needs a script to run to take care of the post-install configuration. Since IPS doesn’t support this, package developers often create a transient SMF manifest and let SMF run the script after the installation completes. This is just ugly, but not the end of the world.
I’m going to try something new. Instead of posting a random thought every so often, I’m going to take requests. What do you want me to talk about next?