= Generating Templates for OS and gLite = [[TracNav]] [[TOC(inline)]] == OS Templates == To add support for a new OS distribution, the recommended method is to copy with `svn cp` the template hierarchy for the last already supported version with the same architecture. Main part of templates for one specific OS version is [wiki:Development/Templates/Generated#RPMLists RPM lists], with one template per RPM group. This is entirely generated from distribution description. After generating templates for RPM groups, the following templates must be modified or reviewed : * `repository/config.tpl` : edit to point to right RPM repositories ofr the OS version. There is generally one repository per OS version/arch combination. * `config/os/kernel_arch_version.tpl` : update the kernel version and variant to match what is provided by the distribution. * `config/glite/*/base.tpl` and `config/glite/*/postconfig.tpl` : may require some adjustement for RPMs explicitly added/updated/removed. === RPM Lists === OS Templates describing RPM list for each OS feature goup are entirely generated from standard Red Hat (or SL) provided `comps.xml` file. This is done by tool [source:SCDB/trunk/src/utils/misc/buildOSTemplates src/utils/misc/buildOSTemplates]. It requires 2 parameters : * Location of OS distribution : this must me the directory containing both a `RPMS` and a `base` directory. * Templates location : where to put the generated templates. If this is part of SCDB, the script takes care of adding the necessary files to SVN. ''Note : before running [source:SCDB/trunk/src/utils/misc/buildOSTemplates src/utils/misc/buildOSTemplates], you need to edit `comps.xml` file in OS distribution and ensure the first line defining DTD is either commented out or deleted.'' [source:SCDB/trunk/src/utils/misc/buildOSTemplates src/utils/misc/buildOSTemplates] is a wrapper to 3 other tools, hiding the somewhat complex option arguments : * [source:SCDB/trunk/src/utils/misc/rpmProvides.pl src/utils/misc/rpmProvides.pl]: generate a file describing features provided by each RPM in OS distribution * [source:SCDB/trunk/src/utils/misc/rpmRequires.pl src/utils/misc/rpmRequires.pl] : generate a file describing for each RPM in the distribution the required dependencies. Uses file produced by previous step as input. * [source:SCDB/trunk/src/utils/misc/comps2pan.xsl src/utils/misc/comps2pan.xsl] : generate the templates from standard `comps.xml` file provided in OS distribution. Uses file produced by previous step as input. ''Note: because of a SPMA restriction, the RPMs for all architectures of one specific package version must be in the same RPM repository or it will not be found at installation time. If you need to add some `i386` RPMs from `i386` distribution to the `x86_64` distribution, you '''need''' to put them in the same repository/directory as the other RPMs provided by the distribution. See [/wiki/FAQ/Templates#RPMpresentbutinstallationfailingtofindit FAQ] for more details.'' == List of update RPMs == gLite templates allow to define in a specific template a list of RPMs that must be used in replacement of standard RPMs. That means that RPMs listed in this template are installed only if the standard RPM was part of the configuration. ''Note: a similar feature exists for OS templates but is handled a little bit differently. Refer to the [/wiki/DOC/OS/Errata dedicated page] for more information.'' Generally all update RPMs for one product version are kept in one directory. There is a tool to help producing the associated template with the last version of each RPM in this directory, [source:SCDB/trunk/src/utils/misc/rpmUpdates.pl src/utils/misc/rpmUpdates.pl/rpmUpdates.pl], which is part of the [source:SCDB SCDB base]. This script accept one argument, the RPM repository directory, and write the template to `stdout` which must be redirected to a file. ''Note: when a new RPM is introduced in a gLite update (not an update for an already existing RPM), the RPM is note introduced in `updates` repository but in `release` repository. In this case, it is necessary to download it with `wget` or to run [source:SCDB/trunk/src/utils/misc/rpmUpdates.pl src/utils/misc/rpmUpdates.pl/rpmUpdates.pl] to synchrnize the repository with the reference, ignoring the template being built (redirect sdtout to `/dev/null`).'' gLite updates are periodically released and are designated by a number. QWG templates provide the templates required to configure a specific update in a directory `update/nn` in gLite templates, where `nn` is the official gLite update number. This directory contains 2 or more templates : * `config.tpl` : this is the main template used to include other templates required by the update. It generally mainly includes `rpms.tpl`. * `rpms.tpl` : list of RPMs updated by the gLite update. This is normally the output of [source:SCDB/trunk/src/utils/misc/rpmUpdates.pl src/utils/misc/rpmUpdates.pl/rpmUpdates.pl] '''unedited'''. * `init.tpl` (optional) : a template defining some specific configuration options at the very beginning of the node configuration. This can be used to define variables used by other standard templates, e.g. `CONDOR_VERSION`. * update post-config per machine type (optional) : such templates define actions specific to a node type, as installing a specific version of a RPM. This is done after the standard update configuration (`config.tpl`). To be used the template name must be the value of variable `GLITE_UPDATE_POSTCONFIG` (generally defined in a machine type template). If the template designated by `GLITE_UPDATE_POSTCONFIG` doesn't exist for the current gLite Update, it is silently ignored. == Trusted CAs Template == Instructions have been moved to a [wiki:Doc/gLite/Updates#ListofTrustedCAs another page].