Home | History | Annotate | Line # | Download | only in notes
PROPOSAL revision 1.1
      1  1.1  jwise Proposal: NetBSD System Installation Packages
      2  1.1  jwise =============================================
      3  1.1  jwise 
      4  1.1  jwise CONTENTS
      5  1.1  jwise --------
      6  1.1  jwise 0. Introduction
      7  1.1  jwise 1. System Packages
      8  1.1  jwise   1.1 Package Format
      9  1.1  jwise   1.2 Package Granularity
     10  1.1  jwise     1.2.1 Root/User/Share separation
     11  1.1  jwise 2. Package Sets
     12  1.1  jwise   2.1 Set format
     13  1.1  jwise 3. Creation of Packages and Sets
     14  1.1  jwise 4. Modifications to the NetBSD installation process
     15  1.1  jwise A. Working Plan
     16  1.1  jwise 
     17  1.1  jwise ------------------------------------------------------------------------
     18  1.1  jwise 
     19  1.1  jwise 0. Introduction
     20  1.1  jwise 
     21  1.1  jwise   The current NetBSD installation process involves the downloading
     22  1.1  jwise   of binary `sets', which the user can choose among at install time.
     23  1.1  jwise   A set is a tarred, gzipped set of files, to be untarred relative
     24  1.1  jwise   to '/'.  No facility exists to choose convenient subsets of the files
     25  1.1  jwise   in a set to be installed, or to remove a set which has been installed.
     26  1.1  jwise 
     27  1.1  jwise   The current granularity of sets is very large, being divided into:
     28  1.1  jwise 
     29  1.1  jwise   	base	-- general system binaries
     30  1.1  jwise 	comp	-- compilers and related tools
     31  1.1  jwise 	etc	-- system configuration files
     32  1.1  jwise 	games	-- games and other amusements
     33  1.1  jwise 	man	-- system manual pages
     34  1.1  jwise 	misc	-- items not falling into other categories
     35  1.1  jwise 	secr	-- items not exportable under US law
     36  1.1  jwise 	text	-- text processing tools
     37  1.1  jwise 	xbase	-- general X11R6 binaries
     38  1.1  jwise 	xcomp	-- X11R6 development items
     39  1.1  jwise 	xcontrib - random binaries from the X11R6 `contrib' tree
     40  1.1  jwise 	xfont	-- X11R6 fonts
     41  1.1  jwise 	xserver -- X11R6 servers for various video hardware
     42  1.1  jwise 
     43  1.1  jwise   Users who wish to install part of a set need to either install
     44  1.1  jwise   the full set and then determine which files they need to remove,
     45  1.1  jwise   or abandon the normal install process, and figure out which files
     46  1.1  jwise   to unpack by hand.  Similarly, if a set is later determined to
     47  1.1  jwise   be unnecessary, the only way to remove it is to figure out which
     48  1.1  jwise   files on the system belonged to that set, and remove them by hand.
     49  1.1  jwise 
     50  1.1  jwise   When it comes time to upgrade a system which has been installed this
     51  1.1  jwise   way, the usual procedure is to unpack a new version of each installed
     52  1.1  jwise   set over the previous version.  When a file is moved, renamed, or
     53  1.1  jwise   removed in a newer version of a set, the old version often remains on
     54  1.1  jwise   the system for some time.  In at least one recent instance (the move
     55  1.1  jwise   of /sbin/mountd to /usr/sbin/mountd) this has resulted in much
     56  1.1  jwise   confusion, and large amounts of traffic on the relevant mailing lists.
     57  1.1  jwise 
     58  1.1  jwise   The remainder of this document describes a proposed method of handling
     59  1.1  jwise   these and other problems with the current install set system by
     60  1.1  jwise   moving to the use of fine-grained `system packages', based on the
     61  1.1  jwise   currently existing package system for third-party software, and
     62  1.1  jwise   allowing users to choose among either `package sets' at the same
     63  1.1  jwise   granularity as our current install sets, or individual `packages'
     64  1.1  jwise   at a much finer level of granularity.  In either case, the new system
     65  1.1  jwise   would also greatly simplify upgrading or removal of such packages
     66  1.1  jwise   and sets at a later time, and would allow tracking of dependencies
     67  1.1  jwise   between the various sets and packages distributed as part of NetBSD.
     68  1.1  jwise 
     69  1.1  jwise   First, the format of system packages in the proposed system is
     70  1.1  jwise   discussed, followed by the format of package sets, which will serve
     71  1.1  jwise   as a replacement for the current install sets.  The creation of
     72  1.1  jwise   packages in an automated fashion from a NetBSD source tree is
     73  1.1  jwise   discussed as is the effect of this system on the NetBSD installation
     74  1.1  jwise   process.  An appendix discusses my work plan to implement this new
     75  1.1  jwise   system.
     76  1.1  jwise 
     77  1.1  jwise   It is hoped that this document will serve as a basis for discussion
     78  1.1  jwise   of what is involved in changing NetBSD to use system packages for
     79  1.1  jwise   system installation and upgrades, and that after several iterations
     80  1.1  jwise   of discussion and revision, it will serve as a plan for the actual
     81  1.1  jwise   implementation of this system.
     82  1.1  jwise 
     83  1.1  jwise ------------------------------------------------------------------------
     84  1.1  jwise 
     85  1.1  jwise 1. System Packages
     86  1.1  jwise 
     87  1.1  jwise   System packages will be the basic building blocks of a NetBSD system.
     88  1.1  jwise   At install time, the user will choose which system packages to install,
     89  1.1  jwise   subject to dependencies between packages.  After system install,
     90  1.1  jwise   users will be able to install additional packages or remove installed
     91  1.1  jwise   packages.  When it comes time to upgrade the system, packages can
     92  1.1  jwise   be removed and reinstalled in a reliable fashion.  All of this
     93  1.1  jwise   functionality is already available for third-party software via the
     94  1.1  jwise   use of the software package system in /usr/pkgsrc.  This proposal
     95  1.1  jwise   extends that functionality to the NetBSD system itself.
     96  1.1  jwise 
     97  1.1  jwise 1.1 Package Format
     98  1.1  jwise 
     99  1.1  jwise   System packages will be identical in format to the binary packages
    100  1.1  jwise   used by the current third-party package system.  This will allow the
    101  1.1  jwise   same tools to be used for working with system packages as are
    102  1.1  jwise   currently used for working with third-party packages.  This will also
    103  1.1  jwise   also allow the system to benefit from the fact that the workings of
    104  1.1  jwise   the current package system are well understood.
    105  1.1  jwise 
    106  1.1  jwise 1.2 Package Granularity
    107  1.1  jwise 
    108  1.1  jwise   System packages will be at the granularity of groups of related tools
    109  1.1  jwise   and their support files.  Thus, `Kerberos', `UUCP', `Text formatting'
    110  1.1  jwise   and `amd' might each be packages which depended on nothing but a few
    111  1.1  jwise   base packages, while `C Development' and `Fortran development' might
    112  1.1  jwise   be separate packages which each depended upon `Binutils' and `Base
    113  1.1  jwise   EGCS utilities' packages.  Packages sets, described below, would add
    114  1.1  jwise   the ability to choose entire broad categories of software to install,
    115  1.1  jwise   like todays install sets, while maintaining the ability to remove
    116  1.1  jwise   individual packages later.
    117  1.1  jwise 
    118  1.1  jwise 1.2.1 Root/User/Share separation
    119  1.1  jwise 
    120  1.1  jwise   In order to support a variety of system configurations, it is crucial
    121  1.1  jwise   that the new package system support the possibility of some part of
    122  1.1  jwise   a system residing on a server and possibly being shared between
    123  1.1  jwise   multiple machines on a network.  A machine which has some filesystems
    124  1.1  jwise   local and some shared must, at the very least, be able to add and
    125  1.1  jwise   remove packages from local filesystems, and should be able to
    126  1.1  jwise   determine what packages have been added or removed from the volumes
    127  1.1  jwise   mounted over the network.
    128  1.1  jwise 
    129  1.1  jwise   The most common shared configurations are to have a system share
    130  1.1  jwise   /usr/share from the network, and have all other filesystems local,
    131  1.1  jwise   or to share the entirety of /usr from the network, and maintain
    132  1.1  jwise   local root and /var hierarchies, possibly as a single filesystem.
    133  1.1  jwise   Other commonly shared hierarchies include /usr/X11R6 and /usr/pkg.
    134  1.1  jwise 
    135  1.1  jwise   Two steps are necessary to support this type of sharing: the system
    136  1.1  jwise   must be able to check separate repositories for packages installed
    137  1.1  jwise   on different filesystems, and packages must be designed so as to
    138  1.1  jwise   allow a client to install only those parts of the system which reside
    139  1.1  jwise   on local filesystems.
    140  1.1  jwise   
    141  1.1  jwise   The first of these is addressed by a set of patches described by
    142  1.1  jwise   Alistair Crooks in a post to the netbsd-current mailing list on
    143  1.1  jwise   Friday, September 18, 1998.  These patches, which have not yet been
    144  1.1  jwise   committed cause third-party software packages installed in /usr/pkg
    145  1.1  jwise   to be registered in /usr/pkg/etc/pkg, and packages installed in
    146  1.1  jwise   /usr/X11R6 to be registered in /usr/X11R6/etc/pkg.  This could be
    147  1.1  jwise   extended easily to allow sharing of system package installations by
    148  1.1  jwise   having the new system X11R6 packages also use /usr/X11R6/etc/pkg
    149  1.1  jwise   for package registration, to have system packages installed in /usr
    150  1.1  jwise   use /usr/etc/pkg for package registration, and to have system
    151  1.1  jwise   packages installed in / and /var use /etc/pkg for package
    152  1.1  jwise   registration.  This would allow all of the types of filesystem
    153  1.1  jwise   sharing described above, without introducing too much complication
    154  1.1  jwise   into the package system.
    155  1.1  jwise 
    156  1.1  jwise   The second step, that of insuring that a client can choose to install
    157  1.1  jwise   only the parts of the system which reside on local volumes can be
    158  1.1  jwise   most easily addressed by careful consideration of package contents.
    159  1.1  jwise   A look through the contents of the current install sets suggests
    160  1.1  jwise   that relatively few packages will in fact need to install in more
    161  1.1  jwise   than one of /, /usr, /usr/share and /usr/X11R6.  Were such packages
    162  1.1  jwise   split into separate components, based on filesystem boundaries,
    163  1.1  jwise   users would easily be able to install only the parts which are local
    164  1.1  jwise   in their particular configuration.
    165  1.1  jwise 
    166  1.1  jwise ------------------------------------------------------------------------
    167  1.1  jwise 
    168  1.1  jwise 2. Package Sets
    169  1.1  jwise 
    170  1.1  jwise   In moving to fine-grained system packages, it is important that
    171  1.1  jwise   beginning users still be able to select broad categories of software
    172  1.1  jwise   to install at once.  The introduction of `package sets', analogous
    173  1.1  jwise   in granularity, but not mechanism, to the current binary install sets
    174  1.1  jwise   addresses this concern, while maintaining the ability of more advanced
    175  1.1  jwise   users to choose among individual packages at install time, and
    176  1.1  jwise   maintaining the ability to remove, upgrade, or add individual
    177  1.1  jwise   packages at a later time.
    178  1.1  jwise 
    179  1.1  jwise   These package sets will maintain the same layout as the current
    180  1.1  jwise   install sets, so that a user who chooses the same sets as he would
    181  1.1  jwise   have chosen now will see the same results.  In the new system,
    182  1.1  jwise   however, these sets will be made up of binary packages, and installing
    183  1.1  jwise   a set will simply result in the installation of the constituent
    184  1.1  jwise   packages.
    185  1.1  jwise 
    186  1.1  jwise 2.1 Set format
    187  1.1  jwise 
    188  1.1  jwise   A set will be a tar archive containing the packages which make up the
    189  1.1  jwise   set plus a contents file.  At the least, the index file will contain
    190  1.1  jwise   the name of each included package, plus a one line description of each
    191  1.1  jwise   package's contents.  Installation utilities will offer the option of
    192  1.1  jwise   installing the whole set, or choosing among individual packages,
    193  1.1  jwise   based on the descriptions in the contents file.  It is expected that the
    194  1.1  jwise   contents file itself will be automatically generated from the one-line
    195  1.1  jwise   descriptions provided in each package's pkg/COMMENT file.
    196  1.1  jwise 
    197  1.1  jwise   When a set is installed, the contents file will be recorded in a
    198  1.1  jwise   manner similar to the registration of package information in the
    199  1.1  jwise   current third-party package system.  This will allow users to remove
    200  1.1  jwise   an entire set at a later date, without needing to know what individual
    201  1.1  jwise   packages came from that set.
    202  1.1  jwise 
    203  1.1  jwise ------------------------------------------------------------------------
    204  1.1  jwise 
    205  1.1  jwise 3. Creation of Packages and Sets
    206  1.1  jwise 
    207  1.1  jwise   Under the current distribution-building system, the Makefile in
    208  1.1  jwise   /usr/src/etc creates binary install sets from an installed system,
    209  1.1  jwise   based on the set lists in /usr/src/distrib/sets/lists.  In the new
    210  1.1  jwise   system, a new directory hierarchy, /usr/src/distrib/pkg, will
    211  1.1  jwise   contain Makefiles and data files relevant to the creation of
    212  1.1  jwise   system packages and package sets.
    213  1.1  jwise 
    214  1.1  jwise   The directory /usr/src/distrib/pkg/sets will contain a directory
    215  1.1  jwise   for each package set, and each of these directories will contain
    216  1.1  jwise   a directory for each package in that set.  The Makefile in
    217  1.1  jwise   /usr/src/distrib/pkg/sets will recurse into these set directories
    218  1.1  jwise   to build each set.  The individual set Makefiles will recurse into
    219  1.1  jwise   each package directory to build the individual packages, and will
    220  1.1  jwise   then create a set file from the constituent packages and from the
    221  1.1  jwise   contents file, which will be automatically generated from the
    222  1.1  jwise   package directories.
    223  1.1  jwise 
    224  1.1  jwise   The package directories will resemble the package directories for
    225  1.1  jwise   third-party software packages in /usr/pkgsrc, except that they will
    226  1.1  jwise   probably rely on the files making up the package already being
    227  1.1  jwise   present in ${DESTDIR}, rather than building them directly.  This
    228  1.1  jwise   assumption is already present in the current distribution package
    229  1.1  jwise   Makefile code, and is probably reasonable to keep.
    230  1.1  jwise 
    231  1.1  jwise ------------------------------------------------------------------------
    232  1.1  jwise 
    233  1.1  jwise 4. Modifications to the NetBSD installation process
    234  1.1  jwise 
    235  1.1  jwise   Once the NetBSD system is available as system packages and package
    236  1.1  jwise   sets, it will be possible to modify the various installation tools
    237  1.1  jwise   to use these sets to install the system.  It is expected that
    238  1.1  jwise   installation tools will default to allow users to choose among
    239  1.1  jwise   package sets at install time, but allow an `advanced mode' in which
    240  1.1  jwise   packages could be selected and deselected on an individual basis.
    241  1.1  jwise 
    242  1.1  jwise   This will require that the various package tools (at least pkg_add)
    243  1.1  jwise   be present on install media to be used with system packages.
    244  1.1  jwise   Modifications to sysinst and other install tools are beyond the
    245  1.1  jwise   current scope of this proposal, but will be necessary to take
    246  1.1  jwise   advantage of the new capabilities provided by this system.
    247  1.1  jwise 
    248  1.1  jwise ------------------------------------------------------------------------
    249  1.1  jwise 
    250  1.1  jwise A. Working Plan
    251  1.1  jwise 
    252  1.1  jwise   My current plan for implementing system packages and package sets
    253  1.1  jwise   for NetBSD consists of four steps.  All of these steps should be
    254  1.1  jwise   taken in the CVS source tree (segregated into src/distrib/pkg, of
    255  1.1  jwise   course), and hopefully will involve other contributors in addition
    256  1.1  jwise   to myself:
    257  1.1  jwise 
    258  1.1  jwise     1.) Hammer this proposal into a more detailed specification
    259  1.1  jwise     
    260  1.1  jwise         I am submitting this proposal now in the hopes that it
    261  1.1  jwise 	will spark discussion which will lead to a refinement
    262  1.1  jwise 	of the planned system package system.  Once some sort
    263  1.1  jwise 	of consensus is reached on the relevant mailing lists,
    264  1.1  jwise 	I will begin work in earnest on implementing this.
    265  1.1  jwise 
    266  1.1  jwise     2.) Create the /usr/src/distrib/pkg hierarchy, and a template
    267  1.1  jwise         package
    268  1.1  jwise 
    269  1.1  jwise 	The first step in actually implementing this system will
    270  1.1  jwise 	be to create either an actual or mocked-up system package
    271  1.1  jwise 	which can be used as a template for creation of the
    272  1.1  jwise 	remaining system packages.
    273  1.1  jwise 
    274  1.1  jwise     3.) Create system packages
    275  1.1  jwise 
    276  1.1  jwise         I expect that this step will involve most of the actual
    277  1.1  jwise 	work in implementing the new system.  Packages will have
    278  1.1  jwise 	to be created for each functional group of binaries
    279  1.1  jwise 	currently shipped with NetBSD.  A lot of discussion and
    280  1.1  jwise 	design will have to go into the decisions as to how
    281  1.1  jwise 	many packages should make up each set and what files
    282  1.1  jwise 	belong in which packages.
    283  1.1  jwise 
    284  1.1  jwise     4.) Create Package Sets
    285  1.1  jwise 
    286  1.1  jwise         Once all system packages exist, it will be necessary to
    287  1.1  jwise 	put together some code to automatically generate set
    288  1.1  jwise 	contents files and to create sets from each directory
    289  1.1  jwise 	of packages in /usr/src/distrib/pkg/sets.
    290  1.1  jwise 
    291  1.1  jwise   Once these steps are complete, NetBSD will have system packages,
    292  1.1  jwise   and it will be possible to begin looking at modifying the NetBSD
    293  1.1  jwise   install process to use them.  It is important to note that none
    294  1.1  jwise   of these changes will require modifying the current installation
    295  1.1  jwise   set building code in any way, so the use of the current system
    296  1.1  jwise   can continue unhindered while the new system is being implemented.
    297  1.1  jwise 
    298  1.1  jwise ------------------------------------------------------------------------
    299  1.1  jwise $Id: PROPOSAL,v 1.1 2002/01/07 22:46:17 jwise Exp $
    300