From 0274b91a1415f422b98dc7b2de41cedf6eb18dd8 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 eb59bc4fab4a129fb317c68a1bc4ac57c464187d) --- share/arm.tmpl | 2 +- share/live/arm.tmpl | 2 +- share/live/x86.tmpl | 8 ++++++-- share/x86.tmpl | 8 ++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/share/arm.tmpl b/share/arm.tmpl index 49212976..0eb36884 100644 --- a/share/arm.tmpl +++ b/share/arm.tmpl @@ -119,7 +119,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/live/arm.tmpl b/share/live/arm.tmpl index 4b0cd82c..6b96f23b 100644 --- a/share/live/arm.tmpl +++ b/share/live/arm.tmpl @@ -74,7 +74,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/live/x86.tmpl b/share/live/x86.tmpl index f60b80d5..fdd99395 100644 --- a/share/live/x86.tmpl +++ b/share/live/x86.tmpl @@ -75,10 +75,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/x86.tmpl b/share/x86.tmpl index b072e673..78214063 100644 --- a/share/x86.tmpl +++ b/share/x86.tmpl @@ -89,10 +89,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