diff --git a/docs/lorax.rst b/docs/lorax.rst index b62b54b0..92dba3fb 100644 --- a/docs/lorax.rst +++ b/docs/lorax.rst @@ -49,8 +49,10 @@ To drive these processes Lorax uses a custom template system, based on `Mako templates `_ with the addition of custom commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako supports ``%if/%endif`` blocks as well as free-form python code inside ``<% -%>`` tags and variable substitution with ``${}``. The templates are shipped -with lorax in /usr/share/lorax/ and use the ``.tmpl`` extension. +%>`` tags and variable substitution with ``${}``. The default templates are +shipped with lorax in ``/usr/share/lorax/templates.d/99-generic/`` and use the +``.tmpl`` extension. + runtime-install.tmpl ~~~~~~~~~~~~~~~~~~~~ @@ -114,10 +116,21 @@ iso creation 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 -``/usr/share/lorax/`` and are named after the arch, like ``x86.tmpl`` and -``aarch64.tmpl``. They handle creation of the tree, copying configuration -template files, configuration variable substitution, treeinfo metadata (via the -:func:`treeinfo ` template -command). Kernel and initrd are copied from the installroot to their final -locations and then mkisofs is run to create the boot.iso +``/usr/share/lorax/templates.d/99-generic`` and are named after the arch, like +``x86.tmpl`` and ``aarch64.tmpl``. They handle creation of the tree, copying +configuration template files, configuration variable substitution, treeinfo +metadata (via the :func:`treeinfo ` +template command). Kernel and initrd are copied from the installroot to their +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. diff --git a/lorax.spec b/lorax.spec index fffa5750..6feeabe1 100644 --- a/lorax.spec +++ b/lorax.spec @@ -18,6 +18,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: python3-devel +Requires: lorax-templates + Requires: GConf2 Requires: cpio Requires: device-mapper @@ -102,6 +104,14 @@ Requires: anaconda-tui Additional dependencies required by livemedia-creator when using it with --no-virt 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 %setup -q -n %{name}-%{version} @@ -126,13 +136,16 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install %dir %{_sysconfdir}/lorax %config(noreplace) %{_sysconfdir}/lorax/lorax.conf %dir %{_datadir}/lorax -%{_datadir}/lorax/* %{_mandir}/man1/*.1* %files lmc-virt %files lmc-novirt +%files templates-generic +%{_datadir}/lorax/templates.d/* + + %changelog * Wed Jan 13 2016 Brian C. Lane 24.9-1 - livemedia-creator: Add kernel-modules and kernel-modules-extra to examples diff --git a/share/aarch64.tmpl b/share/templates.d/99-generic/aarch64.tmpl similarity index 100% rename from share/aarch64.tmpl rename to share/templates.d/99-generic/aarch64.tmpl diff --git a/share/appliance/libvirt.tmpl b/share/templates.d/99-generic/appliance/libvirt.tmpl similarity index 100% rename from share/appliance/libvirt.tmpl rename to share/templates.d/99-generic/appliance/libvirt.tmpl diff --git a/share/arm.tmpl b/share/templates.d/99-generic/arm.tmpl similarity index 100% rename from share/arm.tmpl rename to share/templates.d/99-generic/arm.tmpl diff --git a/share/config_files/aarch64/boot.msg b/share/templates.d/99-generic/config_files/aarch64/boot.msg similarity index 100% rename from share/config_files/aarch64/boot.msg rename to share/templates.d/99-generic/config_files/aarch64/boot.msg diff --git a/share/config_files/aarch64/grub.conf b/share/templates.d/99-generic/config_files/aarch64/grub.conf similarity index 100% rename from share/config_files/aarch64/grub.conf rename to share/templates.d/99-generic/config_files/aarch64/grub.conf diff --git a/share/config_files/aarch64/grub2-efi.cfg b/share/templates.d/99-generic/config_files/aarch64/grub2-efi.cfg similarity index 100% rename from share/config_files/aarch64/grub2-efi.cfg rename to share/templates.d/99-generic/config_files/aarch64/grub2-efi.cfg diff --git a/share/config_files/common/91-anaconda-autoconnect-slaves.conf b/share/templates.d/99-generic/config_files/common/91-anaconda-autoconnect-slaves.conf similarity index 100% rename from share/config_files/common/91-anaconda-autoconnect-slaves.conf rename to share/templates.d/99-generic/config_files/common/91-anaconda-autoconnect-slaves.conf diff --git a/share/config_files/common/bash_history b/share/templates.d/99-generic/config_files/common/bash_history similarity index 100% rename from share/config_files/common/bash_history rename to share/templates.d/99-generic/config_files/common/bash_history diff --git a/share/config_files/common/i18n b/share/templates.d/99-generic/config_files/common/i18n similarity index 100% rename from share/config_files/common/i18n rename to share/templates.d/99-generic/config_files/common/i18n diff --git a/share/config_files/common/libuser.conf b/share/templates.d/99-generic/config_files/common/libuser.conf similarity index 100% rename from share/config_files/common/libuser.conf rename to share/templates.d/99-generic/config_files/common/libuser.conf diff --git a/share/config_files/common/org.gtk.Settings.Debug.gschema.override b/share/templates.d/99-generic/config_files/common/org.gtk.Settings.Debug.gschema.override similarity index 100% rename from share/config_files/common/org.gtk.Settings.Debug.gschema.override rename to share/templates.d/99-generic/config_files/common/org.gtk.Settings.Debug.gschema.override diff --git a/share/config_files/common/pam.sshd b/share/templates.d/99-generic/config_files/common/pam.sshd similarity index 100% rename from share/config_files/common/pam.sshd rename to share/templates.d/99-generic/config_files/common/pam.sshd diff --git a/share/config_files/common/profile b/share/templates.d/99-generic/config_files/common/profile similarity index 100% rename from share/config_files/common/profile rename to share/templates.d/99-generic/config_files/common/profile diff --git a/share/config_files/common/resolv.conf b/share/templates.d/99-generic/config_files/common/resolv.conf similarity index 100% rename from share/config_files/common/resolv.conf rename to share/templates.d/99-generic/config_files/common/resolv.conf diff --git a/share/config_files/common/rsyslog.conf b/share/templates.d/99-generic/config_files/common/rsyslog.conf similarity index 100% rename from share/config_files/common/rsyslog.conf rename to share/templates.d/99-generic/config_files/common/rsyslog.conf diff --git a/share/config_files/common/selinux.config b/share/templates.d/99-generic/config_files/common/selinux.config similarity index 100% rename from share/config_files/common/selinux.config rename to share/templates.d/99-generic/config_files/common/selinux.config diff --git a/share/config_files/common/spice-vdagentd b/share/templates.d/99-generic/config_files/common/spice-vdagentd similarity index 100% rename from share/config_files/common/spice-vdagentd rename to share/templates.d/99-generic/config_files/common/spice-vdagentd diff --git a/share/config_files/common/sshd_config.anaconda b/share/templates.d/99-generic/config_files/common/sshd_config.anaconda similarity index 100% rename from share/config_files/common/sshd_config.anaconda rename to share/templates.d/99-generic/config_files/common/sshd_config.anaconda diff --git a/share/config_files/common/sysctl.conf b/share/templates.d/99-generic/config_files/common/sysctl.conf similarity index 100% rename from share/config_files/common/sysctl.conf rename to share/templates.d/99-generic/config_files/common/sysctl.conf diff --git a/share/config_files/common/vconsole.conf b/share/templates.d/99-generic/config_files/common/vconsole.conf similarity index 100% rename from share/config_files/common/vconsole.conf rename to share/templates.d/99-generic/config_files/common/vconsole.conf diff --git a/share/config_files/ppc/bootinfo.txt b/share/templates.d/99-generic/config_files/ppc/bootinfo.txt similarity index 100% rename from share/config_files/ppc/bootinfo.txt rename to share/templates.d/99-generic/config_files/ppc/bootinfo.txt diff --git a/share/config_files/ppc/grub.cfg.in b/share/templates.d/99-generic/config_files/ppc/grub.cfg.in similarity index 100% rename from share/config_files/ppc/grub.cfg.in rename to share/templates.d/99-generic/config_files/ppc/grub.cfg.in diff --git a/share/config_files/ppc/mapping b/share/templates.d/99-generic/config_files/ppc/mapping similarity index 100% rename from share/config_files/ppc/mapping rename to share/templates.d/99-generic/config_files/ppc/mapping diff --git a/share/config_files/ppc/ofboot.b b/share/templates.d/99-generic/config_files/ppc/ofboot.b similarity index 100% rename from share/config_files/ppc/ofboot.b rename to share/templates.d/99-generic/config_files/ppc/ofboot.b diff --git a/share/config_files/ppc/yaboot.conf.3264 b/share/templates.d/99-generic/config_files/ppc/yaboot.conf.3264 similarity index 100% rename from share/config_files/ppc/yaboot.conf.3264 rename to share/templates.d/99-generic/config_files/ppc/yaboot.conf.3264 diff --git a/share/config_files/ppc/yaboot.conf.in b/share/templates.d/99-generic/config_files/ppc/yaboot.conf.in similarity index 100% rename from share/config_files/ppc/yaboot.conf.in rename to share/templates.d/99-generic/config_files/ppc/yaboot.conf.in diff --git a/share/config_files/s390/generic.ins b/share/templates.d/99-generic/config_files/s390/generic.ins similarity index 100% rename from share/config_files/s390/generic.ins rename to share/templates.d/99-generic/config_files/s390/generic.ins diff --git a/share/config_files/s390/generic.prm b/share/templates.d/99-generic/config_files/s390/generic.prm similarity index 100% rename from share/config_files/s390/generic.prm rename to share/templates.d/99-generic/config_files/s390/generic.prm diff --git a/share/config_files/s390/genericdvd.prm b/share/templates.d/99-generic/config_files/s390/genericdvd.prm similarity index 100% rename from share/config_files/s390/genericdvd.prm rename to share/templates.d/99-generic/config_files/s390/genericdvd.prm diff --git a/share/config_files/s390/redhat.exec b/share/templates.d/99-generic/config_files/s390/redhat.exec similarity index 100% rename from share/config_files/s390/redhat.exec rename to share/templates.d/99-generic/config_files/s390/redhat.exec diff --git a/share/config_files/sparc/boot.msg b/share/templates.d/99-generic/config_files/sparc/boot.msg similarity index 100% rename from share/config_files/sparc/boot.msg rename to share/templates.d/99-generic/config_files/sparc/boot.msg diff --git a/share/config_files/sparc/silo.conf b/share/templates.d/99-generic/config_files/sparc/silo.conf similarity index 100% rename from share/config_files/sparc/silo.conf rename to share/templates.d/99-generic/config_files/sparc/silo.conf diff --git a/share/config_files/x86/boot.msg b/share/templates.d/99-generic/config_files/x86/boot.msg similarity index 100% rename from share/config_files/x86/boot.msg rename to share/templates.d/99-generic/config_files/x86/boot.msg diff --git a/share/config_files/x86/grub.conf b/share/templates.d/99-generic/config_files/x86/grub.conf similarity index 100% rename from share/config_files/x86/grub.conf rename to share/templates.d/99-generic/config_files/x86/grub.conf diff --git a/share/config_files/x86/grub2-efi.cfg b/share/templates.d/99-generic/config_files/x86/grub2-efi.cfg similarity index 100% rename from share/config_files/x86/grub2-efi.cfg rename to share/templates.d/99-generic/config_files/x86/grub2-efi.cfg diff --git a/share/config_files/x86/isolinux.cfg b/share/templates.d/99-generic/config_files/x86/isolinux.cfg similarity index 100% rename from share/config_files/x86/isolinux.cfg rename to share/templates.d/99-generic/config_files/x86/isolinux.cfg diff --git a/share/efi.tmpl b/share/templates.d/99-generic/efi.tmpl similarity index 100% rename from share/efi.tmpl rename to share/templates.d/99-generic/efi.tmpl diff --git a/share/live/arm.tmpl b/share/templates.d/99-generic/live/arm.tmpl similarity index 100% rename from share/live/arm.tmpl rename to share/templates.d/99-generic/live/arm.tmpl diff --git a/share/live/config_files/ppc/bootinfo.txt b/share/templates.d/99-generic/live/config_files/ppc/bootinfo.txt similarity index 100% rename from share/live/config_files/ppc/bootinfo.txt rename to share/templates.d/99-generic/live/config_files/ppc/bootinfo.txt diff --git a/share/live/config_files/ppc/grub.cfg.in b/share/templates.d/99-generic/live/config_files/ppc/grub.cfg.in similarity index 100% rename from share/live/config_files/ppc/grub.cfg.in rename to share/templates.d/99-generic/live/config_files/ppc/grub.cfg.in diff --git a/share/live/config_files/ppc/mapping b/share/templates.d/99-generic/live/config_files/ppc/mapping similarity index 100% rename from share/live/config_files/ppc/mapping rename to share/templates.d/99-generic/live/config_files/ppc/mapping diff --git a/share/live/config_files/ppc/ofboot.b b/share/templates.d/99-generic/live/config_files/ppc/ofboot.b similarity index 100% rename from share/live/config_files/ppc/ofboot.b rename to share/templates.d/99-generic/live/config_files/ppc/ofboot.b diff --git a/share/live/config_files/ppc/yaboot.conf.3264 b/share/templates.d/99-generic/live/config_files/ppc/yaboot.conf.3264 similarity index 100% rename from share/live/config_files/ppc/yaboot.conf.3264 rename to share/templates.d/99-generic/live/config_files/ppc/yaboot.conf.3264 diff --git a/share/live/config_files/ppc/yaboot.conf.in b/share/templates.d/99-generic/live/config_files/ppc/yaboot.conf.in similarity index 100% rename from share/live/config_files/ppc/yaboot.conf.in rename to share/templates.d/99-generic/live/config_files/ppc/yaboot.conf.in diff --git a/share/live/config_files/x86/boot.msg b/share/templates.d/99-generic/live/config_files/x86/boot.msg similarity index 100% rename from share/live/config_files/x86/boot.msg rename to share/templates.d/99-generic/live/config_files/x86/boot.msg diff --git a/share/live/config_files/x86/grub.conf b/share/templates.d/99-generic/live/config_files/x86/grub.conf similarity index 100% rename from share/live/config_files/x86/grub.conf rename to share/templates.d/99-generic/live/config_files/x86/grub.conf diff --git a/share/live/config_files/x86/grub2-efi.cfg b/share/templates.d/99-generic/live/config_files/x86/grub2-efi.cfg similarity index 100% rename from share/live/config_files/x86/grub2-efi.cfg rename to share/templates.d/99-generic/live/config_files/x86/grub2-efi.cfg diff --git a/share/live/config_files/x86/isolinux.cfg b/share/templates.d/99-generic/live/config_files/x86/isolinux.cfg similarity index 100% rename from share/live/config_files/x86/isolinux.cfg rename to share/templates.d/99-generic/live/config_files/x86/isolinux.cfg diff --git a/share/live/efi.tmpl b/share/templates.d/99-generic/live/efi.tmpl similarity index 100% rename from share/live/efi.tmpl rename to share/templates.d/99-generic/live/efi.tmpl diff --git a/share/live/ppc.tmpl b/share/templates.d/99-generic/live/ppc.tmpl similarity index 100% rename from share/live/ppc.tmpl rename to share/templates.d/99-generic/live/ppc.tmpl diff --git a/share/live/s390.tmpl b/share/templates.d/99-generic/live/s390.tmpl similarity index 100% rename from share/live/s390.tmpl rename to share/templates.d/99-generic/live/s390.tmpl diff --git a/share/live/x86.tmpl b/share/templates.d/99-generic/live/x86.tmpl similarity index 100% rename from share/live/x86.tmpl rename to share/templates.d/99-generic/live/x86.tmpl diff --git a/share/ppc.tmpl b/share/templates.d/99-generic/ppc.tmpl similarity index 100% rename from share/ppc.tmpl rename to share/templates.d/99-generic/ppc.tmpl diff --git a/share/ppc64le.tmpl b/share/templates.d/99-generic/ppc64le.tmpl similarity index 100% rename from share/ppc64le.tmpl rename to share/templates.d/99-generic/ppc64le.tmpl diff --git a/share/pxe-live/pxe-config.tmpl b/share/templates.d/99-generic/pxe-live/pxe-config.tmpl similarity index 100% rename from share/pxe-live/pxe-config.tmpl rename to share/templates.d/99-generic/pxe-live/pxe-config.tmpl diff --git a/share/runtime-cleanup.tmpl b/share/templates.d/99-generic/runtime-cleanup.tmpl similarity index 100% rename from share/runtime-cleanup.tmpl rename to share/templates.d/99-generic/runtime-cleanup.tmpl diff --git a/share/runtime-install.tmpl b/share/templates.d/99-generic/runtime-install.tmpl similarity index 100% rename from share/runtime-install.tmpl rename to share/templates.d/99-generic/runtime-install.tmpl diff --git a/share/runtime-postinstall.tmpl b/share/templates.d/99-generic/runtime-postinstall.tmpl similarity index 100% rename from share/runtime-postinstall.tmpl rename to share/templates.d/99-generic/runtime-postinstall.tmpl diff --git a/share/s390.tmpl b/share/templates.d/99-generic/s390.tmpl similarity index 100% rename from share/s390.tmpl rename to share/templates.d/99-generic/s390.tmpl diff --git a/share/x86.tmpl b/share/templates.d/99-generic/x86.tmpl similarity index 100% rename from share/x86.tmpl rename to share/templates.d/99-generic/x86.tmpl