PROPOSAL revision 1.1
11.1SjwiseProposal: NetBSD System Installation Packages
21.1Sjwise=============================================
31.1Sjwise
41.1SjwiseCONTENTS
51.1Sjwise--------
61.1Sjwise0. Introduction
71.1Sjwise1. System Packages
81.1Sjwise  1.1 Package Format
91.1Sjwise  1.2 Package Granularity
101.1Sjwise    1.2.1 Root/User/Share separation
111.1Sjwise2. Package Sets
121.1Sjwise  2.1 Set format
131.1Sjwise3. Creation of Packages and Sets
141.1Sjwise4. Modifications to the NetBSD installation process
151.1SjwiseA. Working Plan
161.1Sjwise
171.1Sjwise------------------------------------------------------------------------
181.1Sjwise
191.1Sjwise0. Introduction
201.1Sjwise
211.1Sjwise  The current NetBSD installation process involves the downloading
221.1Sjwise  of binary `sets', which the user can choose among at install time.
231.1Sjwise  A set is a tarred, gzipped set of files, to be untarred relative
241.1Sjwise  to '/'.  No facility exists to choose convenient subsets of the files
251.1Sjwise  in a set to be installed, or to remove a set which has been installed.
261.1Sjwise
271.1Sjwise  The current granularity of sets is very large, being divided into:
281.1Sjwise
291.1Sjwise  	base	-- general system binaries
301.1Sjwise	comp	-- compilers and related tools
311.1Sjwise	etc	-- system configuration files
321.1Sjwise	games	-- games and other amusements
331.1Sjwise	man	-- system manual pages
341.1Sjwise	misc	-- items not falling into other categories
351.1Sjwise	secr	-- items not exportable under US law
361.1Sjwise	text	-- text processing tools
371.1Sjwise	xbase	-- general X11R6 binaries
381.1Sjwise	xcomp	-- X11R6 development items
391.1Sjwise	xcontrib - random binaries from the X11R6 `contrib' tree
401.1Sjwise	xfont	-- X11R6 fonts
411.1Sjwise	xserver -- X11R6 servers for various video hardware
421.1Sjwise
431.1Sjwise  Users who wish to install part of a set need to either install
441.1Sjwise  the full set and then determine which files they need to remove,
451.1Sjwise  or abandon the normal install process, and figure out which files
461.1Sjwise  to unpack by hand.  Similarly, if a set is later determined to
471.1Sjwise  be unnecessary, the only way to remove it is to figure out which
481.1Sjwise  files on the system belonged to that set, and remove them by hand.
491.1Sjwise
501.1Sjwise  When it comes time to upgrade a system which has been installed this
511.1Sjwise  way, the usual procedure is to unpack a new version of each installed
521.1Sjwise  set over the previous version.  When a file is moved, renamed, or
531.1Sjwise  removed in a newer version of a set, the old version often remains on
541.1Sjwise  the system for some time.  In at least one recent instance (the move
551.1Sjwise  of /sbin/mountd to /usr/sbin/mountd) this has resulted in much
561.1Sjwise  confusion, and large amounts of traffic on the relevant mailing lists.
571.1Sjwise
581.1Sjwise  The remainder of this document describes a proposed method of handling
591.1Sjwise  these and other problems with the current install set system by
601.1Sjwise  moving to the use of fine-grained `system packages', based on the
611.1Sjwise  currently existing package system for third-party software, and
621.1Sjwise  allowing users to choose among either `package sets' at the same
631.1Sjwise  granularity as our current install sets, or individual `packages'
641.1Sjwise  at a much finer level of granularity.  In either case, the new system
651.1Sjwise  would also greatly simplify upgrading or removal of such packages
661.1Sjwise  and sets at a later time, and would allow tracking of dependencies
671.1Sjwise  between the various sets and packages distributed as part of NetBSD.
681.1Sjwise
691.1Sjwise  First, the format of system packages in the proposed system is
701.1Sjwise  discussed, followed by the format of package sets, which will serve
711.1Sjwise  as a replacement for the current install sets.  The creation of
721.1Sjwise  packages in an automated fashion from a NetBSD source tree is
731.1Sjwise  discussed as is the effect of this system on the NetBSD installation
741.1Sjwise  process.  An appendix discusses my work plan to implement this new
751.1Sjwise  system.
761.1Sjwise
771.1Sjwise  It is hoped that this document will serve as a basis for discussion
781.1Sjwise  of what is involved in changing NetBSD to use system packages for
791.1Sjwise  system installation and upgrades, and that after several iterations
801.1Sjwise  of discussion and revision, it will serve as a plan for the actual
811.1Sjwise  implementation of this system.
821.1Sjwise
831.1Sjwise------------------------------------------------------------------------
841.1Sjwise
851.1Sjwise1. System Packages
861.1Sjwise
871.1Sjwise  System packages will be the basic building blocks of a NetBSD system.
881.1Sjwise  At install time, the user will choose which system packages to install,
891.1Sjwise  subject to dependencies between packages.  After system install,
901.1Sjwise  users will be able to install additional packages or remove installed
911.1Sjwise  packages.  When it comes time to upgrade the system, packages can
921.1Sjwise  be removed and reinstalled in a reliable fashion.  All of this
931.1Sjwise  functionality is already available for third-party software via the
941.1Sjwise  use of the software package system in /usr/pkgsrc.  This proposal
951.1Sjwise  extends that functionality to the NetBSD system itself.
961.1Sjwise
971.1Sjwise1.1 Package Format
981.1Sjwise
991.1Sjwise  System packages will be identical in format to the binary packages
1001.1Sjwise  used by the current third-party package system.  This will allow the
1011.1Sjwise  same tools to be used for working with system packages as are
1021.1Sjwise  currently used for working with third-party packages.  This will also
1031.1Sjwise  also allow the system to benefit from the fact that the workings of
1041.1Sjwise  the current package system are well understood.
1051.1Sjwise
1061.1Sjwise1.2 Package Granularity
1071.1Sjwise
1081.1Sjwise  System packages will be at the granularity of groups of related tools
1091.1Sjwise  and their support files.  Thus, `Kerberos', `UUCP', `Text formatting'
1101.1Sjwise  and `amd' might each be packages which depended on nothing but a few
1111.1Sjwise  base packages, while `C Development' and `Fortran development' might
1121.1Sjwise  be separate packages which each depended upon `Binutils' and `Base
1131.1Sjwise  EGCS utilities' packages.  Packages sets, described below, would add
1141.1Sjwise  the ability to choose entire broad categories of software to install,
1151.1Sjwise  like todays install sets, while maintaining the ability to remove
1161.1Sjwise  individual packages later.
1171.1Sjwise
1181.1Sjwise1.2.1 Root/User/Share separation
1191.1Sjwise
1201.1Sjwise  In order to support a variety of system configurations, it is crucial
1211.1Sjwise  that the new package system support the possibility of some part of
1221.1Sjwise  a system residing on a server and possibly being shared between
1231.1Sjwise  multiple machines on a network.  A machine which has some filesystems
1241.1Sjwise  local and some shared must, at the very least, be able to add and
1251.1Sjwise  remove packages from local filesystems, and should be able to
1261.1Sjwise  determine what packages have been added or removed from the volumes
1271.1Sjwise  mounted over the network.
1281.1Sjwise
1291.1Sjwise  The most common shared configurations are to have a system share
1301.1Sjwise  /usr/share from the network, and have all other filesystems local,
1311.1Sjwise  or to share the entirety of /usr from the network, and maintain
1321.1Sjwise  local root and /var hierarchies, possibly as a single filesystem.
1331.1Sjwise  Other commonly shared hierarchies include /usr/X11R6 and /usr/pkg.
1341.1Sjwise
1351.1Sjwise  Two steps are necessary to support this type of sharing: the system
1361.1Sjwise  must be able to check separate repositories for packages installed
1371.1Sjwise  on different filesystems, and packages must be designed so as to
1381.1Sjwise  allow a client to install only those parts of the system which reside
1391.1Sjwise  on local filesystems.
1401.1Sjwise  
1411.1Sjwise  The first of these is addressed by a set of patches described by
1421.1Sjwise  Alistair Crooks in a post to the netbsd-current mailing list on
1431.1Sjwise  Friday, September 18, 1998.  These patches, which have not yet been
1441.1Sjwise  committed cause third-party software packages installed in /usr/pkg
1451.1Sjwise  to be registered in /usr/pkg/etc/pkg, and packages installed in
1461.1Sjwise  /usr/X11R6 to be registered in /usr/X11R6/etc/pkg.  This could be
1471.1Sjwise  extended easily to allow sharing of system package installations by
1481.1Sjwise  having the new system X11R6 packages also use /usr/X11R6/etc/pkg
1491.1Sjwise  for package registration, to have system packages installed in /usr
1501.1Sjwise  use /usr/etc/pkg for package registration, and to have system
1511.1Sjwise  packages installed in / and /var use /etc/pkg for package
1521.1Sjwise  registration.  This would allow all of the types of filesystem
1531.1Sjwise  sharing described above, without introducing too much complication
1541.1Sjwise  into the package system.
1551.1Sjwise
1561.1Sjwise  The second step, that of insuring that a client can choose to install
1571.1Sjwise  only the parts of the system which reside on local volumes can be
1581.1Sjwise  most easily addressed by careful consideration of package contents.
1591.1Sjwise  A look through the contents of the current install sets suggests
1601.1Sjwise  that relatively few packages will in fact need to install in more
1611.1Sjwise  than one of /, /usr, /usr/share and /usr/X11R6.  Were such packages
1621.1Sjwise  split into separate components, based on filesystem boundaries,
1631.1Sjwise  users would easily be able to install only the parts which are local
1641.1Sjwise  in their particular configuration.
1651.1Sjwise
1661.1Sjwise------------------------------------------------------------------------
1671.1Sjwise
1681.1Sjwise2. Package Sets
1691.1Sjwise
1701.1Sjwise  In moving to fine-grained system packages, it is important that
1711.1Sjwise  beginning users still be able to select broad categories of software
1721.1Sjwise  to install at once.  The introduction of `package sets', analogous
1731.1Sjwise  in granularity, but not mechanism, to the current binary install sets
1741.1Sjwise  addresses this concern, while maintaining the ability of more advanced
1751.1Sjwise  users to choose among individual packages at install time, and
1761.1Sjwise  maintaining the ability to remove, upgrade, or add individual
1771.1Sjwise  packages at a later time.
1781.1Sjwise
1791.1Sjwise  These package sets will maintain the same layout as the current
1801.1Sjwise  install sets, so that a user who chooses the same sets as he would
1811.1Sjwise  have chosen now will see the same results.  In the new system,
1821.1Sjwise  however, these sets will be made up of binary packages, and installing
1831.1Sjwise  a set will simply result in the installation of the constituent
1841.1Sjwise  packages.
1851.1Sjwise
1861.1Sjwise2.1 Set format
1871.1Sjwise
1881.1Sjwise  A set will be a tar archive containing the packages which make up the
1891.1Sjwise  set plus a contents file.  At the least, the index file will contain
1901.1Sjwise  the name of each included package, plus a one line description of each
1911.1Sjwise  package's contents.  Installation utilities will offer the option of
1921.1Sjwise  installing the whole set, or choosing among individual packages,
1931.1Sjwise  based on the descriptions in the contents file.  It is expected that the
1941.1Sjwise  contents file itself will be automatically generated from the one-line
1951.1Sjwise  descriptions provided in each package's pkg/COMMENT file.
1961.1Sjwise
1971.1Sjwise  When a set is installed, the contents file will be recorded in a
1981.1Sjwise  manner similar to the registration of package information in the
1991.1Sjwise  current third-party package system.  This will allow users to remove
2001.1Sjwise  an entire set at a later date, without needing to know what individual
2011.1Sjwise  packages came from that set.
2021.1Sjwise
2031.1Sjwise------------------------------------------------------------------------
2041.1Sjwise
2051.1Sjwise3. Creation of Packages and Sets
2061.1Sjwise
2071.1Sjwise  Under the current distribution-building system, the Makefile in
2081.1Sjwise  /usr/src/etc creates binary install sets from an installed system,
2091.1Sjwise  based on the set lists in /usr/src/distrib/sets/lists.  In the new
2101.1Sjwise  system, a new directory hierarchy, /usr/src/distrib/pkg, will
2111.1Sjwise  contain Makefiles and data files relevant to the creation of
2121.1Sjwise  system packages and package sets.
2131.1Sjwise
2141.1Sjwise  The directory /usr/src/distrib/pkg/sets will contain a directory
2151.1Sjwise  for each package set, and each of these directories will contain
2161.1Sjwise  a directory for each package in that set.  The Makefile in
2171.1Sjwise  /usr/src/distrib/pkg/sets will recurse into these set directories
2181.1Sjwise  to build each set.  The individual set Makefiles will recurse into
2191.1Sjwise  each package directory to build the individual packages, and will
2201.1Sjwise  then create a set file from the constituent packages and from the
2211.1Sjwise  contents file, which will be automatically generated from the
2221.1Sjwise  package directories.
2231.1Sjwise
2241.1Sjwise  The package directories will resemble the package directories for
2251.1Sjwise  third-party software packages in /usr/pkgsrc, except that they will
2261.1Sjwise  probably rely on the files making up the package already being
2271.1Sjwise  present in ${DESTDIR}, rather than building them directly.  This
2281.1Sjwise  assumption is already present in the current distribution package
2291.1Sjwise  Makefile code, and is probably reasonable to keep.
2301.1Sjwise
2311.1Sjwise------------------------------------------------------------------------
2321.1Sjwise
2331.1Sjwise4. Modifications to the NetBSD installation process
2341.1Sjwise
2351.1Sjwise  Once the NetBSD system is available as system packages and package
2361.1Sjwise  sets, it will be possible to modify the various installation tools
2371.1Sjwise  to use these sets to install the system.  It is expected that
2381.1Sjwise  installation tools will default to allow users to choose among
2391.1Sjwise  package sets at install time, but allow an `advanced mode' in which
2401.1Sjwise  packages could be selected and deselected on an individual basis.
2411.1Sjwise
2421.1Sjwise  This will require that the various package tools (at least pkg_add)
2431.1Sjwise  be present on install media to be used with system packages.
2441.1Sjwise  Modifications to sysinst and other install tools are beyond the
2451.1Sjwise  current scope of this proposal, but will be necessary to take
2461.1Sjwise  advantage of the new capabilities provided by this system.
2471.1Sjwise
2481.1Sjwise------------------------------------------------------------------------
2491.1Sjwise
2501.1SjwiseA. Working Plan
2511.1Sjwise
2521.1Sjwise  My current plan for implementing system packages and package sets
2531.1Sjwise  for NetBSD consists of four steps.  All of these steps should be
2541.1Sjwise  taken in the CVS source tree (segregated into src/distrib/pkg, of
2551.1Sjwise  course), and hopefully will involve other contributors in addition
2561.1Sjwise  to myself:
2571.1Sjwise
2581.1Sjwise    1.) Hammer this proposal into a more detailed specification
2591.1Sjwise    
2601.1Sjwise        I am submitting this proposal now in the hopes that it
2611.1Sjwise	will spark discussion which will lead to a refinement
2621.1Sjwise	of the planned system package system.  Once some sort
2631.1Sjwise	of consensus is reached on the relevant mailing lists,
2641.1Sjwise	I will begin work in earnest on implementing this.
2651.1Sjwise
2661.1Sjwise    2.) Create the /usr/src/distrib/pkg hierarchy, and a template
2671.1Sjwise        package
2681.1Sjwise
2691.1Sjwise	The first step in actually implementing this system will
2701.1Sjwise	be to create either an actual or mocked-up system package
2711.1Sjwise	which can be used as a template for creation of the
2721.1Sjwise	remaining system packages.
2731.1Sjwise
2741.1Sjwise    3.) Create system packages
2751.1Sjwise
2761.1Sjwise        I expect that this step will involve most of the actual
2771.1Sjwise	work in implementing the new system.  Packages will have
2781.1Sjwise	to be created for each functional group of binaries
2791.1Sjwise	currently shipped with NetBSD.  A lot of discussion and
2801.1Sjwise	design will have to go into the decisions as to how
2811.1Sjwise	many packages should make up each set and what files
2821.1Sjwise	belong in which packages.
2831.1Sjwise
2841.1Sjwise    4.) Create Package Sets
2851.1Sjwise
2861.1Sjwise        Once all system packages exist, it will be necessary to
2871.1Sjwise	put together some code to automatically generate set
2881.1Sjwise	contents files and to create sets from each directory
2891.1Sjwise	of packages in /usr/src/distrib/pkg/sets.
2901.1Sjwise
2911.1Sjwise  Once these steps are complete, NetBSD will have system packages,
2921.1Sjwise  and it will be possible to begin looking at modifying the NetBSD
2931.1Sjwise  install process to use them.  It is important to note that none
2941.1Sjwise  of these changes will require modifying the current installation
2951.1Sjwise  set building code in any way, so the use of the current system
2961.1Sjwise  can continue unhindered while the new system is being implemented.
2971.1Sjwise
2981.1Sjwise------------------------------------------------------------------------
2991.1Sjwise$Id: PROPOSAL,v 1.1 2002/01/07 22:46:17 jwise Exp $
300