[PATCH 2/2] Update templates to use installimg for product and updates

Vratislav Podzimek vpodzime at redhat.com
Wed Nov 5 06:35:03 UTC 2014


On Tue, 2014-11-04 at 19:23 -0800, Brian C. Lane wrote:
> With these templates if a package has installed files in
> /usr/share/lorax/product or /usr/share/lorax/updates/ they will be used
> to create product.img and/or updates.img which will be included in the
> images/ directory of the iso and of the final output tree.
> 
> These can be used to customize the installation environment or provide
> updates. See README.product for current documentation.
> ---
>  README.product      | 17 +++++++++++++++++
>  lorax.spec          |  2 +-
>  share/aarch64.tmpl  | 10 ++++++++++
>  share/live/ppc.tmpl | 12 +++++++++++-
>  share/live/x86.tmpl | 12 +++++++++++-
>  share/ppc.tmpl      | 13 ++++++++++++-
>  share/ppc64le.tmpl  | 14 ++++++++++++--
>  share/x86.tmpl      | 12 +++++++++++-
>  8 files changed, 85 insertions(+), 7 deletions(-)
>  create mode 100644 README.product
> 
> diff --git a/README.product b/README.product
> new file mode 100644
> index 0000000..fde376c
> --- /dev/null
> +++ b/README.product
> @@ -0,0 +1,17 @@
> +Lorax now supports creation of product.img and updates.img as part of the build
> +process.  This is implemented using the installimg command which will take the
          ^^ extra space here ;)

> +contents of a directory and create a compressed archive from it. The x86, ppc,
> +ppc64le and aarch64 templates all look for /usr/share/lorax/product/ and
> +/usr/share/lorax/updates/ directories while creating the final install tree. If
> +there are files in those directories lorax will create images/product.img
> +and/or images/updates.img
> +
> +These archives are just like an anaconda updates image -- they are copied over
> +the top of the filesystem at boot time so that you can drop in files to add to
> +or replace anything on the filesystem.
> +
> +For example, to add an installclass to Anaconda you would put a file in:
> +
> +/usr/lib64/python2.7/site-packages/pyanaconda/installclasses/custom.py
> +
> +
> diff --git a/lorax.spec b/lorax.spec
> index f0cc8f9..e291403 100644
> --- a/lorax.spec
> +++ b/lorax.spec
> @@ -86,7 +86,7 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
>  
>  %files
>  %defattr(-,root,root,-)
> -%doc COPYING AUTHORS README.livemedia-creator
> +%doc COPYING AUTHORS README.livemedia-creator README.product
>  %doc docs/*ks
>  %{python_sitelib}/pylorax
>  %{python_sitelib}/*.egg-info
> diff --git a/share/aarch64.tmpl b/share/aarch64.tmpl
> index 66af43f..c073b10 100644
> --- a/share/aarch64.tmpl
> +++ b/share/aarch64.tmpl
> @@ -4,6 +4,7 @@ configdir="tmp/config_files/aarch64"
>  PXEBOOTDIR="images/pxeboot"
>  KERNELDIR=PXEBOOTDIR
>  LIVEDIR="LiveOS"
> +LORAXDIR="usr/share/lorax/"
>  %>
>  
>  mkdir ${LIVEDIR}
> @@ -37,3 +38,12 @@ mkdir ${KERNELDIR}
>      <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/>
>  %endif
>  
> +# Create optional product.img and updates.img
> +<% imggraft=""; images=["product", "updates"] %>
> +%for img in images:
> +    %if exists("%s/%s/" % (LORAXDIR, img)):
Is this condition needed in all the templates? If I understand the
installimg behaviour correctly, it is a noop if the source directory
doesn't exist or is empty.

Other than this question, the neatpick above and that comment in PATCH
1/2 these both look good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list