From 8a89edf7bfea7cfc5fa71439ff3c763b35bad249 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 28 Mar 2019 08:34:30 -0700 Subject: [PATCH] Add -iso-level 3 when the install.img is > 4GiB xorrisofs needs to use iso-level 3 when creating images with large files. This adds tests to all the relevant templates, just like we used to do for udf and mkisofs. --- share/templates.d/99-generic/aarch64.tmpl | 10 +++++++++- share/templates.d/99-generic/arm.tmpl | 12 ++++++++++-- share/templates.d/99-generic/live/aarch64.tmpl | 10 +++++++++- share/templates.d/99-generic/live/ppc64le.tmpl | 10 +++++++++- share/templates.d/99-generic/live/x86.tmpl | 10 +++++++++- share/templates.d/99-generic/ppc64le.tmpl | 10 +++++++++- share/templates.d/99-generic/s390.tmpl | 12 ++++++++++-- share/templates.d/99-generic/x86.tmpl | 10 +++++++++- 8 files changed, 74 insertions(+), 10 deletions(-) diff --git a/share/templates.d/99-generic/aarch64.tmpl b/share/templates.d/99-generic/aarch64.tmpl index 35a1cdd3..2893a502 100644 --- a/share/templates.d/99-generic/aarch64.tmpl +++ b/share/templates.d/99-generic/aarch64.tmpl @@ -6,7 +6,15 @@ KERNELDIR=PXEBOOTDIR STAGE2IMG="images/install.img" LORAXDIR="usr/share/lorax/" +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir images @@ -67,7 +75,7 @@ mkdir ${KERNELDIR} %if exists("boot/efi/EFI/*/gcdaa64.efi"): ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ ${efiargs} -R -J -V '${isolabel}' \ -graft-points \ .discinfo=${outroot}/.discinfo \ diff --git a/share/templates.d/99-generic/arm.tmpl b/share/templates.d/99-generic/arm.tmpl index a70e874f..6220d9ae 100644 --- a/share/templates.d/99-generic/arm.tmpl +++ b/share/templates.d/99-generic/arm.tmpl @@ -1,4 +1,4 @@ -<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/> +<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, arch"/> <% configdir="tmp/config_files/uboot" PXEBOOTDIR="images/pxeboot" @@ -12,7 +12,15 @@ LORAXDIR="usr/share/lorax/" platforms = "" delimiter = '' +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir images @@ -84,7 +92,7 @@ treeinfo ${basearch} platforms ${platforms} %if exists("boot/efi/EFI/*/gcdarm.efi"): ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ ${efiargs} -R -J -V '${isolabel}' \ -graft-points \ .discinfo=${outroot}/.discinfo \ diff --git a/share/templates.d/99-generic/live/aarch64.tmpl b/share/templates.d/99-generic/live/aarch64.tmpl index be81eed9..62df5adf 100644 --- a/share/templates.d/99-generic/live/aarch64.tmpl +++ b/share/templates.d/99-generic/live/aarch64.tmpl @@ -12,7 +12,15 @@ def valid_label(ch): isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir ${LIVEDIR} @@ -73,7 +81,7 @@ mkdir ${KERNELDIR} %if exists("boot/efi/EFI/*/gcdaa64.efi"): ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ ${efiargs} -R -J -V '${isolabel}' \ -graft-points \ ${KERNELDIR}=${outroot}/${KERNELDIR} \ diff --git a/share/templates.d/99-generic/live/ppc64le.tmpl b/share/templates.d/99-generic/live/ppc64le.tmpl index c24c0e76..5cd79e0b 100644 --- a/share/templates.d/99-generic/live/ppc64le.tmpl +++ b/share/templates.d/99-generic/live/ppc64le.tmpl @@ -12,7 +12,15 @@ LORAXDIR="usr/share/lorax/" ## with '_', which means we won't need any udev escapes. isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir ${LIVEDIR} @@ -72,7 +80,7 @@ replace @EXTRA@ '${extra_boot_args}' ${GRUBDIR}/grub.cfg %endfor ## make boot.iso -runcmd xorrisofs -v -U -J -R \ +runcmd xorrisofs -v -U -J -R ${isoargs} \ -o ${outroot}/images/boot.iso \ -r -l -sysid PPC \ -A "${product.name} ${product.version}" -V '${isolabel}' \ diff --git a/share/templates.d/99-generic/live/x86.tmpl b/share/templates.d/99-generic/live/x86.tmpl index 51ba70fc..a76c062b 100644 --- a/share/templates.d/99-generic/live/x86.tmpl +++ b/share/templates.d/99-generic/live/x86.tmpl @@ -14,7 +14,15 @@ def valid_label(ch): isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir ${LIVEDIR} @@ -105,7 +113,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %endfor ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ -isohybrid-mbr /usr/share/syslinux/isohdpfx.bin \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -boot-load-size 4 -boot-info-table -no-emul-boot \ diff --git a/share/templates.d/99-generic/ppc64le.tmpl b/share/templates.d/99-generic/ppc64le.tmpl index dc24a16e..dc03c09c 100644 --- a/share/templates.d/99-generic/ppc64le.tmpl +++ b/share/templates.d/99-generic/ppc64le.tmpl @@ -12,7 +12,15 @@ def valid_label(ch): isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir images @@ -78,7 +86,7 @@ replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg %endfor ## make boot.iso -runcmd xorrisofs -v -U -J -R \ +runcmd xorrisofs -v -U -J -R ${isoargs} \ -o ${outroot}/images/boot.iso \ -r -l -sysid PPC \ -A "${product.name} ${product.version}" -V '${isolabel}' \ diff --git a/share/templates.d/99-generic/s390.tmpl b/share/templates.d/99-generic/s390.tmpl index 1cc80f3f..c34b5b90 100644 --- a/share/templates.d/99-generic/s390.tmpl +++ b/share/templates.d/99-generic/s390.tmpl @@ -1,4 +1,4 @@ -<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/> +<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot"/> <% configdir="tmp/config_files/s390" BOOTDIR="images" @@ -8,7 +8,15 @@ LORAXDIR="usr/share/lorax/" # The assumption seems to be that there is only one s390 kernel, ever kernel = kernels[0] +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir images @@ -68,7 +76,7 @@ runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \ -o ${outroot}/${BOOTDIR}/cdboot.img ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ -b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \ -boot-load-size 4 -no-emul-boot \ -R -J -V '${isolabel}' -graft-points \ diff --git a/share/templates.d/99-generic/x86.tmpl b/share/templates.d/99-generic/x86.tmpl index 1a14eb84..3d9d0a47 100644 --- a/share/templates.d/99-generic/x86.tmpl +++ b/share/templates.d/99-generic/x86.tmpl @@ -14,7 +14,15 @@ def valid_label(ch): isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel) +import os from os.path import basename +from pylorax.sysutils import joinpaths + +# Test the runtime_img, if it is > 4GiB we need to set -iso-level to 3 +if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3: + isoargs = "-iso-level 3" +else: + isoargs = "" %> mkdir images @@ -113,7 +121,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %endfor ## make boot.iso -runcmd xorrisofs -o ${outroot}/images/boot.iso \ +runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ -isohybrid-mbr /usr/share/syslinux/isohdpfx.bin \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -boot-load-size 4 -boot-info-table -no-emul-boot \