Move templates to /usr/share/lorax/templates.d/99-generic

This commit is contained in:
Brian C. Lane 2016-01-29 17:43:33 -08:00
parent c86bd205c3
commit 76bce910e0
62 changed files with 35 additions and 9 deletions

View File

@ -49,8 +49,10 @@ To drive these processes Lorax uses a custom template system, based on `Mako
templates <http://www.makotemplates.org/>`_ with the addition of custom templates <http://www.makotemplates.org/>`_ with the addition of custom
commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako
supports ``%if/%endif`` blocks as well as free-form python code inside ``<% supports ``%if/%endif`` blocks as well as free-form python code inside ``<%
%>`` tags and variable substitution with ``${}``. The templates are shipped %>`` tags and variable substitution with ``${}``. The default templates are
with lorax in /usr/share/lorax/ and use the ``.tmpl`` extension. shipped with lorax in ``/usr/share/lorax/templates.d/99-generic/`` and use the
``.tmpl`` extension.
runtime-install.tmpl runtime-install.tmpl
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -114,10 +116,21 @@ iso creation
The iso creation is handled by another set of templates. The one used depends The iso creation is handled by another set of templates. The one used depends
on the architecture that the iso is being created for. They are also stored in on the architecture that the iso is being created for. They are also stored in
``/usr/share/lorax/`` and are named after the arch, like ``x86.tmpl`` and ``/usr/share/lorax/templates.d/99-generic`` and are named after the arch, like
``aarch64.tmpl``. They handle creation of the tree, copying configuration ``x86.tmpl`` and ``aarch64.tmpl``. They handle creation of the tree, copying
template files, configuration variable substitution, treeinfo metadata (via the configuration template files, configuration variable substitution, treeinfo
:func:`treeinfo <pylorax.ltmpl.LoraxTemplateRunner.treeinfo>` template metadata (via the :func:`treeinfo <pylorax.ltmpl.LoraxTemplateRunner.treeinfo>`
command). Kernel and initrd are copied from the installroot to their final template command). Kernel and initrd are copied from the installroot to their
locations and then mkisofs is run to create the boot.iso final locations and then mkisofs is run to create the boot.iso
Custom Templates
----------------
The default set of templates and configuration files from the lorax-generic-templates package
are shipped in the ``/usr/share/lorax/templates.d/99-generic/`` directory. You can
make a copy of them and place them into another directory under ``templates.d``
and they will be used instead if their sort order is below all other directories. This
allows multiple packages to ship lorax templates without conflict. You can (and probably
should) select the specific template directory by passing ``--sharedir`` to lorax.

View File

@ -18,6 +18,8 @@ Source0: %{name}-%{version}.tar.gz
BuildRequires: python3-devel BuildRequires: python3-devel
Requires: lorax-templates
Requires: GConf2 Requires: GConf2
Requires: cpio Requires: cpio
Requires: device-mapper Requires: device-mapper
@ -102,6 +104,14 @@ Requires: anaconda-tui
Additional dependencies required by livemedia-creator when using it with --no-virt Additional dependencies required by livemedia-creator when using it with --no-virt
to run Anaconda. to run Anaconda.
%package templates-generic
Summary: Generic build templates for lorax and livemedia-creator
Requires: lorax = %{version}-%{release}
Provides: lorax-templates
%description templates-generic
Lorax templates for creating the boot.iso and live isos are placed in
/usr/share/lorax/templates.d/99-generic
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
@ -126,13 +136,16 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%dir %{_sysconfdir}/lorax %dir %{_sysconfdir}/lorax
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf %config(noreplace) %{_sysconfdir}/lorax/lorax.conf
%dir %{_datadir}/lorax %dir %{_datadir}/lorax
%{_datadir}/lorax/*
%{_mandir}/man1/*.1* %{_mandir}/man1/*.1*
%files lmc-virt %files lmc-virt
%files lmc-novirt %files lmc-novirt
%files templates-generic
%{_datadir}/lorax/templates.d/*
%changelog %changelog
* Wed Jan 13 2016 Brian C. Lane <bcl@redhat.com> 24.9-1 * Wed Jan 13 2016 Brian C. Lane <bcl@redhat.com> 24.9-1
- livemedia-creator: Add kernel-modules and kernel-modules-extra to examples - livemedia-creator: Add kernel-modules and kernel-modules-extra to examples