Local Mirror of tribblix Zones
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

126 lines
4.2 KiB

I started with a copy of /usr/lib/brand/ipkg
Changed /usr/lib/brand/ipkg to /usr/lib/brand/sparse-root globally
foreach file ( * )
gsed -i s:/usr/lib/brand/ipkg:/usr/lib/brand/sparse-root:g $file
end
So we need to replace pkgcreatezone:
cat /var/sadm/install/contents | nawk '{print $1}' | nawk -F/ '{print $2}' | uniq -c
bin - create symlink
boot - kill
dev - ignore (zoneadm handles it)
devices - kill
etc - populate with fresh copy
export - create empty
home - skip
kernel - kill
lib - lofs mount
mnt - create empty
opt - skip (for tribblix zones anyway)
platform - lofs mount
proc - ignore (zoneadm handles it)
sbin - lofs mount
system - ignore (zoneadm handles it)
tmp - create empty
usr - lofs mount
var - populate with fresh copy
for lofs mounts, need to mkdir the mountpoint
Need to handle /var/sadm specially; remove any paths from the contents
file starting with the killed directories.
For etc and var, either copy the global zone or the pspooled file. By
only copying what the packaging system says is there, we should avoid
copying crap. Then copy /var/sadm with a fixed up contents file.
Handling /lib gets nasty; it contains SMF manifests which we don't want
in a zone, so I've forced a copy under /zonelib/lib which we can edit
(in the global zone).
The list of files to omit there is handled by an ignorelist. From an
illumos-gate package repo, in the pkg directory, look for files with
the variant.opensolaris.zone=global property. Something like
grep zone=global */* | grep -v ':dir ' | grep path=lib | tr ' ' '\n' | grep path= | sort | sed s:path=:/: > /tmp/lib.ignorelist
grep zone=global */* | grep -v ':dir ' | egrep -v path='(lib|usr|sbin|platform|boot|dev|kernel)' | tr ' ' '\n' | grep path= | sort | sed s:path=:/: > /tmp/sparse.ignorelist
grep zone=global */* | grep -v ':dir ' | egrep -v path='(etc|lib|platform|boot|dev|kernel)' | tr ' ' '\n' | grep path= | sort | sed s:path=:/: > /tmp/whole.ignorelist
although we only really need to filter out the SMF stuff.
You need to combine the lists for the different variants to be sure you
catch everything.
For whole-root zones and template zones, we can filter everything out,
including quite a few files under /usr.
While sparse-root is the brand, you need a template. So that's what
TRIBsparse.xml is - which goes into /etc/zones, and then you 'create
-t TRIBsparse' in zonecfg.
TODO:
fix root as a role and jack
ensure the initial BE has a valid UUID, because the uninstall checks
for zone BEs that match the global zone's BE; if they're null the
umount isn't called and you get an rm busy error, and the zone isn't
uninstalled properly
Solaris and OI have a makeuuid command; Tribblix skips it
Could add TRIBsys-mgmt-product-registry so it's included. And need 2
packages for whole and sparse-root zones
So if I manually set
zfs set org.opensolaris.libbe:uuid=51f2d0f4-df6e-6e48-dc0a-a74f37e14930 rpool/ROOT/tribblix
Then 'beadm list -H' shows sensible output, and for a new zone zfs
shows the right property on the zone filesystem
# zfs get all|grep parent
rpool/export/zones/pt2/ROOT/zbe org.opensolaris.libbe:parentbe 51f2d0f4-df6e-6e48-dc0a-a74f37e14930 local
and then zoneadm uninstall works correctly
Cleanup done:
Add my copyright
Remove fmri_compare
sparse-root:
pkgcreatezone: remove -a, -e, -d flags, as they aren't relevant
-p and -u only apply to p2v, so aren't relevant either
-s and -v are only passed to p2v, so they go as well
config.xml: clean up installopts
image_install: kill it completely, and p2v
clone: check sys-unconfig exists before use
whole-root:
use -o for overlays not -e for extra packages
Alien zones:
An alien zone is one containing an alternative illumos distro.
The smarts here is in live-iso-unpack, which takes an iso image,
unpacks it, and munges it into whatever shape is required to
boot as a zone.
It has been extended to add images from tarballs (like zmvi) and zfs send
streams (such as the kayak datasets available for download from OmniOS).
This is a separate brand so an administrator can easily spot that
it's different, and tools can manage them appropriately.
Creating the packages:
======================
$THOME/build/create_pkg TRIBblix-zones $THOME/tribblix-zones