NOTES revision 1.2
11.1SjwiseI have been spending a lot of time lately thinking about how we
21.1Sjwisecan extend our current package system to allow the use of system
31.1Sjwisepackages (and sets thereof) rather than tarballs as our primary
41.1Sjwiseway of installing NetBSD systems.  What follows is a random jumble
51.1Sjwiseof thoughts on where we can go with this.  Based on people's response
61.1Sjwiseto this, I will put together a more concrete proposal soon.
71.1Sjwise
81.1Sjwise1. Package Granularity
91.1Sjwise
101.1Sjwise    People would like to be able to install/remove system software
111.1Sjwise    with a high level of granularity.  (Do I want Kerberos, but
121.1Sjwise    not UUCP?  C but not Fortran?  Text formatting but not printing?)
131.1Sjwise    This could be best addressed by providing our system software
141.1Sjwise    as a series of packages which could be installed individually.
151.1Sjwise    Dependencies would then exist among these packages, which would
161.1Sjwise    insure that a working system resulted from various combinations
171.1Sjwise    users might choose.  For example, users could choose a C package
181.1Sjwise    and/or a Fortran package, and both would depend on a binutils
191.1Sjwise    package.
201.1Sjwise
211.1Sjwise    At the same time, users should not need to choose between a
221.1Sjwise    thousand little packages when installing the system.
231.1Sjwise
241.1Sjwise    This probably means that there should be the concept of `sets'
251.1Sjwise    of packages to be installed all at once, roughly analogous to
261.1Sjwise    our current breakdown into base, comp, etc, games and so on.
271.1Sjwise    A set would contain a number of packages, and a contents file
281.1Sjwise    indicating which packages were part of the set.  An install
291.1Sjwise    program could then default to let users pick among whole sets,
301.1Sjwise    but could have an advanced mode which would let users pick
311.1Sjwise    individual packages instead.
321.1Sjwise
331.1Sjwise    Very possibly, this would open the possibility of keeping set,
341.1Sjwise    information, in addition to package information around, and
351.1Sjwise    offering the ability to remove all installed packages from a
361.1Sjwise    given set at a later date.
371.1Sjwise
381.1Sjwise    Alternately, a system similar to our existing pkg-src/meta-pkgs
391.1Sjwise    mechanism could be used -- users would choose meta-pkgs more
401.1Sjwise    or less equivalent to the current sets, and these would trigger
411.1Sjwise    dependencies on the packages which make up the set.
421.1Sjwise
431.1Sjwise2. Package Registration
441.1Sjwise
451.2Sabs    Currently, packages are installed in /usr/pkg and /usr/X11R7,
461.1Sjwise    and all package registration is done by creating directories
471.1Sjwise    in /var/db/pkg.
481.1Sjwise
491.1Sjwise    This is generally agreed to have a couple of problems, especially
501.1Sjwise    when you want to share /usr/pkg between multiple machines.
511.1Sjwise    Unless /var/db/pkg is the same on both machines, you very
521.1Sjwise    quickly end up with at least one machine not knowing what
531.1Sjwise    packages it has installed.
541.1Sjwise
551.1Sjwise    Alistair Crooks has recently put together changes to use
561.1Sjwise    ${LOCALBASE}/etc/pkg and ${X11BASE}/etc/pkg to store package
571.1Sjwise    registration information, which is a big step toward solving
581.1Sjwise    this problem (yahoo!).  Presumably, system packages will use
591.1Sjwise    /etc/pkg, although this leaves open the question of what to do
601.1Sjwise    if you share /usr between multiple client machines.
611.1Sjwise
621.1Sjwise3. Package Creation
631.1Sjwise
641.1Sjwise    Right now, the Makefile in .../src/etc can be used to build
651.1Sjwise    distribution sets, which are tarballs to be unpacked relative
661.1Sjwise    to / by the installer.  Sets are defined by lists in
671.1Sjwise    .../src/distrib/sets/lists, and consist of MI and MD components.
681.1Sjwise    Thus, where sources are installed in /usr/src,
691.1Sjwise    /usr/src/distrib/sets/lists/comp/mi contains a list of files
701.1Sjwise    in the compiler set which are available on all architectures,
711.1Sjwise    while /usr/src/distrib/sets/lists/comp/md.i386 contains a list
721.1Sjwise    of those files which are on the i386, but not on all other
731.1Sjwise    architectures.  All shared libraries, for example, are in the
741.1Sjwise    md set, since not all ports have shared libraries.
751.1Sjwise
761.1Sjwise    In order to move to using system packages, we will need to
771.1Sjwise    provide a way to generate binary packages from our source tree.
781.1Sjwise    It should be noted that the granularity of packages does not
791.1Sjwise    really match the granularity of source subdirectories in
801.1Sjwise    /usr/src/*, so barring a source tree re-organization (which
811.1Sjwise    seems undesirable), we will need a way to do this which (like
821.1Sjwise    the current mechanism) is outside of the normal `make clean ;
831.1Sjwise    make depend; make' recursion through the source tree.  A system
841.1Sjwise    will also be needed to allow building a set out of a group of
851.1Sjwise    packages.  Both of these systems will need to be simple to use
861.1Sjwise    (one make command line), and should be possible to run on a
871.1Sjwise    single-package or single-set level.
881.1Sjwise
891.1Sjwise4. Package Versioning and Upgrades
901.1Sjwise
911.1Sjwise    One of the neatest features offered by having independent
921.1Sjwise    packages for different parts of the system is the ability to
931.1Sjwise    upgrade a single package independently of the whole system.
941.1Sjwise    Although this should not be abused (we don't want to become
951.1Sjwise    like Linux where on an average system nothing quite matches
961.1Sjwise    anything else), it would provide an ideal way to distribute
971.1Sjwise    important patches and security fixes.
981.1Sjwise
991.1Sjwise    For example, the security patch for NetBSD-SA1998-004 (at(1)
1001.1Sjwise    being usable to view any file) was distributed as a patch to
1011.1Sjwise    the NetBSD-1.3.2 source tree.  This requires anyone who wishes
1021.1Sjwise    to install the fix to have a source tree available, download
1031.1Sjwise    and apply the patch, and then rebuild at(1).
1041.1Sjwise
1051.1Sjwise    In a system based on install systems, an updated version of
1061.1Sjwise    the specific package containing at(1) could be released, which
1071.1Sjwise    users could download and pkg_add in a matter of moments.  It
1081.1Sjwise    would also be easy for an admin to tell if a system had been
1091.1Sjwise    upgraded by looking at pkg_info output.
1101.1Sjwise
1111.2Sabs$Id: NOTES,v 1.2 2021/11/02 22:02:42 abs Exp $
112