Home | History | Annotate | Download | only in doc
      1 This hg repository is intended to be a sub-repository of the ON gate,
      2 similar to closed.  It allows ON developers to experiment with
      3 creating an IPS repository from their source changes.
      4 
      5 Questions should be sent to on-ips-dev (a] opensolaris.org.  Users of this
      6 gate are *strongly* encouraged to sign up for this alias as the code
      7 is experimental and procedures may change rapidly.
      8 
      9 Bugs can be filed at defect.opensolaris.org in
     10   Development / osnet-pkg / build.
     11 
     12 Currently, only x86 builds are supported.
     13 
     14 1. Prerequisites
     15 
     16   You must be running an OpenSolaris system, preferably of relatively
     17   recent vintage from the ipkg.sfbay/dev (SWAN) or pkg.opensolaris.org/dev
     18   repository.
     19 
     20 2. Getting Started
     21 
     22    1. hg clone ssh://anon (a] hg.opensolaris.org/hg/pkg/on_ips
     23       A. This is the onnv open source, plus the pkg bits
     24       B. If you want closed bits, get 'em from "the normal place"
     25          (We're not yet maintaining closed project bits, though we
     26 	 will need to do so prior to integration.)
     27    2. Populate your proto area via one of the following methods
     28       A. Do a normal ON build, including the -t option
     29       B. rsync -av elpaso.eng::onnv-proto/root_i386 ${ROOT}/..
     30          rsync -av elpaso.eng::onnv-gate/usr/src/tools/proto ${SRC}/tools
     31    3. Use ws or bldenv to setup your build environment.
     32    4. cd ${SRC)/pkg
     33    5. dmake all check
     34       Realy building "check" is optional, but it gets you validate_pkg
     35       (the new protocmp) output, and you shouldn't skip it.
     36    6. /usr/lib/pkg.depotd -d `pwd`/manifests/repo.redist -p 13000 
     37       /usr/lib/pkg.depotd -d `pwd`/manifests/repo.extra -p 13001 
     38         (or any other appropriate port)
     39    7. On your test system,
     40        # pkg set-publisher -P -O http://<your server host>:13000 on-nightly
     41        # pkg set-publisher -O http://<your server host>:13001 on-extra
     42        # pkg image-update
     43 
     44    If you're doing an external (or internal, open-only) build, you should
     45    omit the second pkg.depotd and set-publisher commands.  If you're
     46    planning on sharing your repositories outside of Sun, you must
     47    build open-only and you should never distribute the extra repository
     48    generated from an internal build, and without it, the redist
     49    repository from a closed build won't install.
     50 
     51    Or, you can archive (tar, cpio, whatever) the "repo" directories, and
     52    have people copy your depot to a local machine and start pkg.depotd
     53    there.  The pkg.depotd can even be running on the system you're
     54    updating.
     55 
     56    We attempt to update the package definitions in usr/src/pkg/manifests
     57    daily to match the ON nightly build from that morning.  That means
     58    that if your workspace is sourced from ON on a different day than
     59    the usr/src/pkg contents, you may not have properly packaged bits.  You
     60    can choose to ignore this mismatch if it doesn't effect your work, or
     61    pull the proper revision of the on_ips gate. When we do putbacks to
     62    sync-up the IPS manifests with the ON contents, we capture the changeid
     63    of the putback we synced with so you can match the two by browsing
     64    on_ips' hg log.
     65 
     66 3. How incremental builds work, because it's not necessarily intuitive
     67 
     68    If you want to build a subset of packages, simply specify them on
     69    the command line.  If you want to build them all, simply specify
     70    the "all" target.  If you want to build just one of the two
     71    repositories, specify either "redist" or "extra":
     72 
     73    	% dmake BRCMbnx BRCMbnxe
     74 	% dmake all
     75 	% dmake redist
     76 
     77    No matter which approach you take (subset, all, or repo), each
     78    package will be published to the on-disk repository iff it meets one
     79    or both of the following criteria:
     80 
     81      1. The corresponding manifest has changed since it was last
     82         published.
     83      2. The on-disk repository is has been created more recently than
     84         the last publication time for the package.
     85 
     86    Furthermore, the on-disk repository will only be initialized when
     87    it does not exist.  Which means that you must build the clobber
     88    target if you don't want to accumulate published packages in your
     89    repository.
     90 
     91    The build dependencies do NOT extend to the binary objects being
     92    packaged, but rather to the manifests that describe collections of
     93    deliverable objects.  If your proto area changes, a pkg build will
     94    not detect it.  So if you want to republish a set of packages,
     95    simply remove the <pkg-name>.pub file from usr/src/pkg/manifests.
     96    If you want to republish all of 'em, then build the clean target.
     97 
     98    So that's the difference between "clean" and "clobber" under the
     99    usr/src/pkg/manifests directory: both remove the processed
    100    manifests, thus causing all packages to be republished.  In
    101    addition, the clobber target causes the repository to be reset, so
    102    you won't continue to accumulate published versions of the same
    103    packages.
    104 
    105 4. If your ON changes include packaging changes
    106 
    107   A caveat: currently there's no double checking of your work by
    108   protocmp.  That will be fixed, but for now you'll need to make
    109   sure you've packaged all your files and haven't missed any
    110   manually.
    111 
    112   You'll need to make corresponding packaging changes to the IPS
    113   manifests.  Here's how.
    114 
    115   For modifications to existing prototype_com and prototype_i386 files:
    116 	* Add appropriate actions to the .manifest files.
    117 
    118   For driver modifications to postinstall scripts:
    119 	* Translate the postinstall invocation into an appropriate
    120 	  "driver" action in the proper usr/src/pkg/manifests/*.manifest
    121 	  file.
    122 
    123 	* Often, this just requires adding alias= entries to the exiting
    124 	  action.
    125 
    126   For other modifications to postinstall scripts:
    127 	* Generally, they must be ignored for now.
    128 
    129   For new packages:
    130 	* Create a new .manifest file, and modify manifests/Makefile,
    131 	  using another package as a template.  The metadata mostly comes
    132 	  from pkginfo.
    133 	* If at all possible, model your work on a similar, existing
    134 	  package manifest.  Ie a different audio driver, etc.
    135 	* Make sure to consider whether the package should be combined with
    136 	  any others.  The u/r package split is explicitly gone now, so
    137 	  no need to create new packages to contain files in /usr when
    138 	  there's already an appropriate root package.
    139 	* Add your new package to the list in manifests/Makefile.
    140 
    141   For deleted packages:
    142 	* Delete the .manifest file.
    143 	* Remove the package from the list in manifests/Makefile.
    144 
    145   If you're changing any of the files in usr/src/pkg/opensolaris_overrides
    146   (e.g. rbac files, passwd, shadow, devicedb/master), updates will need
    147   to be made there, as they are currently expanded clones of the ON
    148   contents.
    149 
    150 5. To upgrade your non-ON software
    151 
    152   Soon the main OpenSolaris development train will release an updated
    153   build.  At that time, you'll probably have to fallback to the full
    154   OpenSolaris build you were running before you started upgrading your ON
    155   bits, then upgrade that.  e.g.
    156 
    157     $ pfexec beadm mount snv_118 /mnt
    158     $ pfexec pkg set-publisher -P opensolaris.org
    159     $ pfexec pkg set-publisher -d on
    160     $ pfexec pkg -R /mnt image-update
    161