xref: /netbsd-src/distrib/syspkg/notes/NOTES (revision 6bf98a75969ff8f3fed18a7d59df1f98f11e9d57)
1dec9565bSjwiseI have been spending a lot of time lately thinking about how we
2dec9565bSjwisecan extend our current package system to allow the use of system
3dec9565bSjwisepackages (and sets thereof) rather than tarballs as our primary
4dec9565bSjwiseway of installing NetBSD systems.  What follows is a random jumble
5dec9565bSjwiseof thoughts on where we can go with this.  Based on people's response
6dec9565bSjwiseto this, I will put together a more concrete proposal soon.
7dec9565bSjwise
8dec9565bSjwise1. Package Granularity
9dec9565bSjwise
10dec9565bSjwise    People would like to be able to install/remove system software
11dec9565bSjwise    with a high level of granularity.  (Do I want Kerberos, but
12dec9565bSjwise    not UUCP?  C but not Fortran?  Text formatting but not printing?)
13dec9565bSjwise    This could be best addressed by providing our system software
14dec9565bSjwise    as a series of packages which could be installed individually.
15dec9565bSjwise    Dependencies would then exist among these packages, which would
16dec9565bSjwise    insure that a working system resulted from various combinations
17dec9565bSjwise    users might choose.  For example, users could choose a C package
18dec9565bSjwise    and/or a Fortran package, and both would depend on a binutils
19dec9565bSjwise    package.
20dec9565bSjwise
21dec9565bSjwise    At the same time, users should not need to choose between a
22dec9565bSjwise    thousand little packages when installing the system.
23dec9565bSjwise
24dec9565bSjwise    This probably means that there should be the concept of `sets'
25dec9565bSjwise    of packages to be installed all at once, roughly analogous to
26dec9565bSjwise    our current breakdown into base, comp, etc, games and so on.
27dec9565bSjwise    A set would contain a number of packages, and a contents file
28dec9565bSjwise    indicating which packages were part of the set.  An install
29dec9565bSjwise    program could then default to let users pick among whole sets,
30dec9565bSjwise    but could have an advanced mode which would let users pick
31dec9565bSjwise    individual packages instead.
32dec9565bSjwise
33dec9565bSjwise    Very possibly, this would open the possibility of keeping set,
34dec9565bSjwise    information, in addition to package information around, and
35dec9565bSjwise    offering the ability to remove all installed packages from a
36dec9565bSjwise    given set at a later date.
37dec9565bSjwise
38dec9565bSjwise    Alternately, a system similar to our existing pkg-src/meta-pkgs
39dec9565bSjwise    mechanism could be used -- users would choose meta-pkgs more
40dec9565bSjwise    or less equivalent to the current sets, and these would trigger
41dec9565bSjwise    dependencies on the packages which make up the set.
42dec9565bSjwise
43dec9565bSjwise2. Package Registration
44dec9565bSjwise
45*6bf98a75Sabs    Currently, packages are installed in /usr/pkg and /usr/X11R7,
46dec9565bSjwise    and all package registration is done by creating directories
47dec9565bSjwise    in /var/db/pkg.
48dec9565bSjwise
49dec9565bSjwise    This is generally agreed to have a couple of problems, especially
50dec9565bSjwise    when you want to share /usr/pkg between multiple machines.
51dec9565bSjwise    Unless /var/db/pkg is the same on both machines, you very
52dec9565bSjwise    quickly end up with at least one machine not knowing what
53dec9565bSjwise    packages it has installed.
54dec9565bSjwise
55dec9565bSjwise    Alistair Crooks has recently put together changes to use
56dec9565bSjwise    ${LOCALBASE}/etc/pkg and ${X11BASE}/etc/pkg to store package
57dec9565bSjwise    registration information, which is a big step toward solving
58dec9565bSjwise    this problem (yahoo!).  Presumably, system packages will use
59dec9565bSjwise    /etc/pkg, although this leaves open the question of what to do
60dec9565bSjwise    if you share /usr between multiple client machines.
61dec9565bSjwise
62dec9565bSjwise3. Package Creation
63dec9565bSjwise
64dec9565bSjwise    Right now, the Makefile in .../src/etc can be used to build
65dec9565bSjwise    distribution sets, which are tarballs to be unpacked relative
66dec9565bSjwise    to / by the installer.  Sets are defined by lists in
67dec9565bSjwise    .../src/distrib/sets/lists, and consist of MI and MD components.
68dec9565bSjwise    Thus, where sources are installed in /usr/src,
69dec9565bSjwise    /usr/src/distrib/sets/lists/comp/mi contains a list of files
70dec9565bSjwise    in the compiler set which are available on all architectures,
71dec9565bSjwise    while /usr/src/distrib/sets/lists/comp/md.i386 contains a list
72dec9565bSjwise    of those files which are on the i386, but not on all other
73dec9565bSjwise    architectures.  All shared libraries, for example, are in the
74dec9565bSjwise    md set, since not all ports have shared libraries.
75dec9565bSjwise
76dec9565bSjwise    In order to move to using system packages, we will need to
77dec9565bSjwise    provide a way to generate binary packages from our source tree.
78dec9565bSjwise    It should be noted that the granularity of packages does not
79dec9565bSjwise    really match the granularity of source subdirectories in
80dec9565bSjwise    /usr/src/*, so barring a source tree re-organization (which
81dec9565bSjwise    seems undesirable), we will need a way to do this which (like
82dec9565bSjwise    the current mechanism) is outside of the normal `make clean ;
83dec9565bSjwise    make depend; make' recursion through the source tree.  A system
84dec9565bSjwise    will also be needed to allow building a set out of a group of
85dec9565bSjwise    packages.  Both of these systems will need to be simple to use
86dec9565bSjwise    (one make command line), and should be possible to run on a
87dec9565bSjwise    single-package or single-set level.
88dec9565bSjwise
89dec9565bSjwise4. Package Versioning and Upgrades
90dec9565bSjwise
91dec9565bSjwise    One of the neatest features offered by having independent
92dec9565bSjwise    packages for different parts of the system is the ability to
93dec9565bSjwise    upgrade a single package independently of the whole system.
94dec9565bSjwise    Although this should not be abused (we don't want to become
95dec9565bSjwise    like Linux where on an average system nothing quite matches
96dec9565bSjwise    anything else), it would provide an ideal way to distribute
97dec9565bSjwise    important patches and security fixes.
98dec9565bSjwise
99dec9565bSjwise    For example, the security patch for NetBSD-SA1998-004 (at(1)
100dec9565bSjwise    being usable to view any file) was distributed as a patch to
101dec9565bSjwise    the NetBSD-1.3.2 source tree.  This requires anyone who wishes
102dec9565bSjwise    to install the fix to have a source tree available, download
103dec9565bSjwise    and apply the patch, and then rebuild at(1).
104dec9565bSjwise
105dec9565bSjwise    In a system based on install systems, an updated version of
106dec9565bSjwise    the specific package containing at(1) could be released, which
107dec9565bSjwise    users could download and pkg_add in a matter of moments.  It
108dec9565bSjwise    would also be easy for an admin to tell if a system had been
109dec9565bSjwise    upgraded by looking at pkg_info output.
110dec9565bSjwise
111*6bf98a75Sabs$Id: NOTES,v 1.2 2021/11/02 22:02:42 abs Exp $
112