Switch to using xorrisofs instead of mkisofs

We have already been using it via the mkisofs compatibility mode. Switch
to using it explicitly.

Resolves: rhbz#2017134
This commit is contained in:
Brian C. Lane 2021-10-26 13:50:43 -07:00
parent efb4782908
commit 0c4e1955ee
7 changed files with 84 additions and 81 deletions

View File

@ -6,17 +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 ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
# 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
@ -77,8 +75,8 @@ mkdir ${KERNELDIR}
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${STAGE2IMG}=${outroot}/${STAGE2IMG} \

View File

@ -12,17 +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 ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
# 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}
@ -76,8 +74,8 @@ mkdir ${KERNELDIR}
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \

View File

@ -1,4 +1,4 @@
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/>
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel, extra_boot_args"/>
<%
configdir="tmp/config_files/ppc"
BOOTDIR="ppc"
@ -12,17 +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 ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
# 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}
@ -48,6 +46,7 @@ install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
replace @EXTRA@ '${extra_boot_args}' ${GRUBDIR}/grub.cfg
## Install kernel and bootloader config (in separate places for each arch)
%for kernel in kernels:
@ -81,14 +80,13 @@ replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
%endfor
## make boot.iso
runcmd mkisofs -v -U -J -R -T \
runcmd xorrisofs -v -U -J -R ${isoargs} \
-o ${outroot}/images/boot.iso \
-part -hfs -r -l -sysid PPC \
-r -l -sysid PPC \
-A "${product.name} ${product.version}" -V '${isolabel}' \
-volset "${product.version}" -volset-size 1 -volset-seqno 1 \
-hfs-volid ${product.version} \
-chrp-boot -map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot ${udfargs} -graft-points \
-chrp-boot \
-graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} ${filegraft}

View File

@ -22,9 +22,9 @@ 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:
udfargs = "-allow-limited-size"
isoargs = "-iso-level 3"
else:
udfargs = ""
isoargs = ""
%>
mkdir ${LIVEDIR}
@ -81,10 +81,10 @@ runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \
-p ${outroot}/${BOOTDIR}/cdboot.prm
## make boot.iso
runcmd mkisofs -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}' ${udfargs} -graft-points \
-R -J -V '${isolabel}' -graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${filegraft}

View File

@ -14,17 +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 ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
# 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}
@ -70,7 +68,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
## WHeeeeeeee, EFI.
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
<% efiargs=""; efigraft=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% efiarch32 = 'IA32' %>
%endif
@ -80,18 +78,17 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%if (efiarch32 or efiarch64) and basearch != 'i386':
<%
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
images = [("images/efiboot.img", "-isohybrid-gpt-basdat")]
if domacboot:
images.append("images/macboot.img")
images.append(("images/macboot.img", "-isohybrid-gpt-hfsplus"))
%>
%for img in images:
%for img, hybrid in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot {1}".format(img, hybrid)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<% efihybrid = "--uefi --mac" if domacboot else "--uefi" %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args"/>
%endif
@ -115,15 +112,21 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
# Add the livecd-iso-to-disk script if installed
<% f = "usr/bin/livecd-iso-to-disk" %>
%if exists(f):
install ${f} ${LIVEDIR}/${f|basename}
%endif
## make boot.iso
runcmd mkisofs -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 \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
${efiargs} -R -J -V '${isolabel}' \
-graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${filegraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso

View File

@ -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"
@ -9,7 +9,15 @@ MKS390IMAGE="/usr/bin/mk-s390image"
# 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
@ -39,6 +47,7 @@ treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
treeinfo images-${basearch} generic.ins generic.ins
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
# Create optional product.img and updates.img in /images/
<% filegraft=""; images=["product", "updates"] %>
@ -69,11 +78,11 @@ runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \
-p ${outroot}/${BOOTDIR}/cdboot.prm
## make boot.iso
runcmd mkisofs -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}' -T -graft-points \
generic.ins=${outroot}/generic.ins \
-R -J -V '${isolabel}' -graft-points \
.discinfo=${outroot}/.discinfo \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${filegraft}
treeinfo images-${basearch} boot.iso images/boot.iso

View File

@ -14,17 +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 ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
# 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
@ -71,7 +69,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
## WHeeeeeeee, EFI.
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
<% efiargs=""; efigraft=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% efiarch32 = 'IA32' %>
%endif
@ -81,18 +79,17 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%if (efiarch32 or efiarch64) and basearch != 'i386':
<%
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
images = [("images/efiboot.img", "-isohybrid-gpt-basdat")]
if domacboot:
images.append("images/macboot.img")
images.append(("images/macboot.img", "-isohybrid-gpt-hfsplus"))
%>
%for img in images:
%for img, hybrid in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot {1}".format(img, hybrid)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<% efihybrid = "--uefi --mac" if domacboot else "--uefi" %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
@ -124,14 +121,14 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endfor
## make boot.iso
runcmd mkisofs -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 \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
${efiargs} -R -J -V '${isolabel}' \
-graft-points \
${STAGE2IMG}=${outroot}/${STAGE2IMG} \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${efigraft} ${filegraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso