From ce895bbeb1318eb05dcc88eb6889b3f8173fb065 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 24 Mar 2016 09:33:37 -0700 Subject: [PATCH] templates: On 32 bit systems limit the amount of memory xz uses This uses --memlimit-compress=3700MiB on i386 and arm when building the product and updates images. (cherry picked from commit 99e575e61b59330b9e0979a874fa41b07d1c9a56) --- share/templates.d/99-generic/arm.tmpl | 2 +- share/templates.d/99-generic/live/arm.tmpl | 2 +- share/templates.d/99-generic/live/x86.tmpl | 8 ++++++-- share/templates.d/99-generic/x86.tmpl | 8 ++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/share/templates.d/99-generic/arm.tmpl b/share/templates.d/99-generic/arm.tmpl index 31c2acb8..afbc83b2 100644 --- a/share/templates.d/99-generic/arm.tmpl +++ b/share/templates.d/99-generic/arm.tmpl @@ -43,7 +43,7 @@ treeinfo ${basearch} platforms ${platforms} <% images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): - installimg ${LORAXDIR}/${img}/ images/${img}.img + installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img %endif %endfor diff --git a/share/templates.d/99-generic/live/arm.tmpl b/share/templates.d/99-generic/live/arm.tmpl index 2a0b126b..7e9ed946 100644 --- a/share/templates.d/99-generic/live/arm.tmpl +++ b/share/templates.d/99-generic/live/arm.tmpl @@ -36,7 +36,7 @@ mkdir ${KERNELDIR} <% images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): - installimg ${LORAXDIR}/${img}/ images/${img}.img + installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img %endif %endfor diff --git a/share/templates.d/99-generic/live/x86.tmpl b/share/templates.d/99-generic/live/x86.tmpl index 364b3c10..9d1bdc5d 100644 --- a/share/templates.d/99-generic/live/x86.tmpl +++ b/share/templates.d/99-generic/live/x86.tmpl @@ -85,10 +85,14 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %endif # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% imggraft=""; images=["product", "updates"]; compressargs=None; %> +%if basearch == 'i386': + # Limit the amount of memory xz uses on i386 + <% compressargs="--xz -9 --memlimit-compress=3700MiB" %> +%endif %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): - installimg ${LORAXDIR}/${img}/ images/${img}.img + installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor diff --git a/share/templates.d/99-generic/x86.tmpl b/share/templates.d/99-generic/x86.tmpl index bf25d5d6..a49b5dc2 100644 --- a/share/templates.d/99-generic/x86.tmpl +++ b/share/templates.d/99-generic/x86.tmpl @@ -87,10 +87,14 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %endif # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% imggraft=""; images=["product", "updates"]; compressargs=None; %> +%if basearch == 'i386': + # Limit the amount of memory xz uses on i386 + <% compressargs="--xz -9 --memlimit-compress=3700MiB" %> +%endif %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): - installimg ${LORAXDIR}/${img}/ images/${img}.img + installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor