Wandering Thoughts archives

2013-04-11

Something I'd like to be easier in Solaris's IPS

IPS is the 'Image Packaging System', which seems to be essentially the default packaging system for Illumos distributions. Or at least it's the packaging system for several of them, most importantly OmniOS, and Oracle's Solaris 11, if you care about the latter. IPS is in some ways very clever and nifty but as a sysadmin there are some bits I wish it did differently, or at least easier. Particularly I wish that it made it easier to download and archive complete packages.

You may be wondering how a package system can possibly make that hard. I'm glad you asked. You see, IPS is not a traditional package system; if you want an extremely crude simplification it's more like git. In this git-like approach, the files for all packages are stored together in a hash-based content store and 'packages' are mostly just indexes of what hash identifier goes where with what permissions et al. This has various nominal advantages but also has the drawback that there is no simple package blob to download, the way there is in other packaging formats.

There are two related ways to get copies of IPS packages for yourself, both using the low-level pkgrecv command (instead of the higher-level pkg command). The most obvious way is to have pkgrecv just write things out into a pkg(5) file ('pkgrecv -a -d ...'). The drawback of this is that it really does write out everything it downloaded to a single file. This is fine if you're just downloading one package but it's not so great if you're using the -r switch to have pkgrecv download a package and its dependencies. The more complex way is to actually create your own local repo (which is a directory tree) with 'pkgrepo create /your/dir', then use pkgrecv (without -a) to download packages into that repo. This gives you everything you want at the cost of, well, having that repo instead of simple package files that you can easily copy around separately and so on.

(Both pkgrecv variants also have the drawback that you have to give them an explicit repository URL. Among other things this makes it hard to deal with cross-repository dependencies, for example if a package from an additional repository needs some new packages from the core distribution repo.)

What I'd like is a high-level pkg command (or a command option) that handled all of this complexity for me and wrote out separate pkg(5) files for each separate package.

(In theory I could do this with a shell script if various pkg subcommands had stable and sufficiently machine-parseable output. I haven't looked into pkg enough to know if it does; right now I'm at the point where I'm just poking around OmniOS.)

Sidebar: why sysadmins care about getting copies of packages

The simple answer is because sometimes we want to be able to (re)build exact copies of some system, not 'the system but with some or all of the packages updated to current versions'. We also don't want to have to depend on a remote package source staying in operation or keeping those packages around for us, because we've seen package sources go away (or decide that they need to clean up before their disk space usage explodes).

solaris/IPSPackageDownload written at 01:05:07; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.