ColoradoIPSBuild
From Genunix
Contents |
Build Change Proposal for IPS Packages
Source Tree Layout
Create usr/src/ipsdefs directory parallel to usr/src/pkgdefs Like usr/src/pkgdefs, usr/src/ipsdefs has a subdirectory for each package, such as SUNWscu.
In addition to a subdirectory for each package, usr/src/ipsdefs will contain a list of the packages to be send to the repository in the file ips.packagelist.ksh
IPS doesn't have an on-disk package format. Instead, the package is described as a series of actions, such as file installation, directory creation, and so on. The package actions can be listed in a manifest file for pkgsend(1) to use.
Each package directory will contain manifest* files parallel to the prototype* files in the pkgdefs directory.
- manifest_com
- IPS actions common across all platforms
- manifest_sparc
- IPS actions common to all sparc platforms
- manifest_i386
- IPS actions common to all x86 platforms
- manifest_sparc.<OS release>
- IPS actions for release <OS release> on sparc
- manifest_i386.<OS release>
- IPS actions for release <OS release> on x86
- manifest_meta
- Metadata (see below)
There will be a manifest_com.closed file for the refactoring step, because open and closed binaries must go in separate packages. That way we can capture the files that need to be moved to a new package.
The actions in the manifest files other than manifest_meta will be:
- File
- Directory
- Link
- Hardlink
- Driver
The manifest_meta file will contain Set actions to specify package metadata. This file is parallel to the pkginfo file from System V packages. The metadata will include (from http://dlc.sun.com/osol/docs/content/IPS/ggdvj.html):
- pkg.summary
- description
- pkg.detailed_url
- pkg.debug
- ISA
- legacy
We can also define OHAC attributes, similar to the OpenSolaris attributes defined on http://dlc.sun.com/osol/docs/content/IPS/ggdvj.html. Specifics TBD.
Finally, the manifest_meta file will contain the Legacy actions for pkginfo compatibility. There needs to be a way to determine the arch (architecture - either i386 or sparc) and package version information of the corresponding legacy script.
There will also be depend* files parallel to the depend* files in the pkgdefs directory, containing only Depend IPS actions:
- depend_com
- Depend actions common to all platforms
- depend_sparc
- Depend actions common to all sparc platforms
- depend_i386
- Depend actions common to all x86 platforms
- depend_sparc.<OS release>
- Depend actions for release <OS release> on sparc
- depend_i386.<OS release>
- Depend actions for release <OS release> on x86
Each directory will also contain a version.ips file, with nothing but the version string, in a format understood by pkg(5). Note that the IPS version is defined as: component_version,build_version-branch_version. The build_version-branch_version part can be the target build of OpenSolaris on which Colorado will run, I believe. So we may just need the component_version.
There will be a usr/src/ips/common_files directory, parallel to usr/src/pkgdefs/common_files. This directory will contain a license.ips file. This license will be pulled into the final manifest.ips of each ips package during the build (see below).
Finally, each ips package directory will contain Makefiles necessary for performing the build described below.
Populating the usr/src/ipsdefs Directory
Initially, we will do a 1:1 conversion of SVR4 packages to IPS packages. The conversion can be partially automated (the File, Directory, Link, Hardlink, and Set actions). The prototype* and pkginfo* files will be translated as follows:
- prototype_com, prototype.Sol_10 and prototype_com.tmpl -> manifest_com
- prototype_i386 and prototype_i386.Sol_10 -> manifest_i386
- prototype_sparc, prototype_sparc.common and prototype_sparc.Sol_10 -> manifest_sparc
- prototype_com.closed and prototype_com.closed.Sol_10 -> manifest_com.closed
- prototype_i18n -> manifest_i18n
- pkginfo.tmpl and pkginfo.tmpl.Sol_10 -> manifest_meta
We can discard stuff in pkgdefs specific to S9. Note that the S11 build currently uses the S10-specific prototype and pkginfo files, so we need to pull those in.
Note also that we don't need any release specific manifest files for this first release, as we're only supporting one target OS (OpenSolaris 2009.04).
Finally, note that we aren't supporting Sparc in the first release, but we'll populate those files so they're there when we need them.
We will not attempt to use the dependencies from the system V packages (the depend.tmpl files), as they are somewhat imprecise and inaccurate. Dependencies will be filled in based on more detailed automated and manual analysis.
The conversion script will use the XXXIPSXXX keyword within a comment to mark entries that need manual work. Today we know that prototype entries that use the rbac and manifest class action script need additional logic within IPS.
The conversion script does also not handle entries for the driver action.
Volatile files (ftype = v) will be mapped to the file action with option preserve=strawberry.
Editable files (ftype = e) will need manual work (marked with XXXIPSXXX).
The current version of the one-time conversion script can be viewed here.
Build
Building for OSDIST builds ips instead of pkgdefs. Building an IPS package directory consists of combining the manifest* files for the target platform into one manifest.ips file, and adding the text from the ../common_files/license.ips file as a License action.
A new command send_ips, which is equivalent to the current build_cds command, will run a series of pkgsend(1) commands on each IPS package directory. send_ips requires the following information for each package it sends:
- Repository URL: Taken as an argument to send_ips. There is no default; if not specified, send_ips will not send packages.
- Package Name: The name of the directory it's processing
- Package Version: version.ips in that directory
- Actions: manifest.ips in that directory
send_ips will run the following for each IPS package directory:
eval `pkgsend -s <Repository URL> open <Package Name>@>Package Version>` pkgsend include manifest.ips pkgsend close
(the latter two might require -s as well – need to double-check)
send_ips will be called by nbuild during OSDIST builds if nbuild is given the -b option.
Handling replacements for System V Scripts
TBD
