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