Developing with multiple BEs in OpenSolaris
By mrj on Mar 04, 2009
For example, I will usually have 3 boot environments (BE) on my systems at one time. The first BE usually has the base build that my gate is a child of. The second BE is my test BE which I BFU, and generally seem to kill quite often. And the third BE is an old build so I can go move my test BE to the old build all the way up to the most recent build (luupgrade(1M)).
OpenSolaris uses beadm which is a nice replacement to the lu commands. I was a little disappointed when I first started using it because I didn't think it was as flexible as I wanted.. But after playing with it for a while, I have a setup which I'm pretty happy with at the moment.
What I want to be able to do is to have the stock OpenSolaris BE, which gets upgraded at major releases. But I also want to have BEs which are based off of various development builds, and test BEs which I can BFU, etc. This is really nice since these will be COW based clones due to zfs.
So the question was how to update an alternate BE and at the same time, not modify the current BE. i.e. not having to update the authority, upgrade SUNWipkg, etc. The solution is pretty simple, chroot...
Here's how I create a b108 BE on a stock 2008.11 system, while ensuring I keep the 2008.11 bits unmodified. I can switch back to the stock OpenSolaris bits at any time with a beadm activate opensolaris.
beadm create snv108 beadm mount snv108 /mnt mount -F proc /proc /mnt/proc chroot /mnt pkg set-authority -O http://pkg.opensolaris.org/dev opensolaris.org pkg refresh pkg install SUNWipkg pkg install email@example.com bootadm update-archive exit umount /mnt/proc beadm umount snv108 beadm activate snv108