be3aa59daa
mk-s390-cdboot has stopped working because the kernel outgrew the hard-coded offset it used when creating cdboot.img. IBM now has a script in s390utils that can do the same thing so use the upstream script instead. This drops mk-s390-cdboot script, switches the s390 templates to use mk-s390image from s390utils. It adds @ROOT@ to cdboot.prm, and sets inst.stage2 so that the installer image will be found when booting the iso. Related: rhbz#1892404
81 lines
2.8 KiB
Cheetah
81 lines
2.8 KiB
Cheetah
<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/>
|
|
<%
|
|
configdir="tmp/config_files/s390"
|
|
BOOTDIR="images"
|
|
KERNELDIR=BOOTDIR
|
|
INITRD_ADDRESS="0x02000000"
|
|
LORAXDIR="usr/share/lorax/"
|
|
MKS390IMAGE="/usr/bin/mk-s390image"
|
|
# The assumption seems to be that there is only one s390 kernel, ever
|
|
kernel = kernels[0]
|
|
|
|
from os.path import basename
|
|
%>
|
|
|
|
mkdir images
|
|
install ${runtime_img} images
|
|
treeinfo stage2 mainimage images/${runtime_base}
|
|
|
|
## install bootloader (such as it is) and bootloader config
|
|
install ${configdir}/redhat.exec ${BOOTDIR}
|
|
install ${configdir}/generic.prm ${BOOTDIR}
|
|
install ${configdir}/genericdvd.prm ${BOOTDIR}
|
|
install ${configdir}/cdboot.prm ${BOOTDIR}
|
|
install ${configdir}/generic.ins .
|
|
|
|
## configure bootloader
|
|
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
|
|
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/cdboot.prm
|
|
|
|
## install kernel
|
|
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
|
|
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
|
|
|
## s390 needs some extra boot config
|
|
createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize
|
|
|
|
## s390 also has some special treeinfo data
|
|
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"] %>
|
|
%for img in images:
|
|
%if exists("%s/%s/" % (LORAXDIR, img)):
|
|
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
|
treeinfo images-${basearch} ${img}.img images/${img}.img
|
|
%endif
|
|
%endfor
|
|
|
|
# Inherit iso-graft/ if it exists from external templates
|
|
<%
|
|
import os
|
|
if os.path.exists(workdir + "/iso-graft"):
|
|
filegraft += " " + workdir + "/iso-graft"
|
|
%>
|
|
|
|
# Add the license files
|
|
%for f in glob("/usr/share/licenses/*-release/*"):
|
|
install ${f} ${f|basename}
|
|
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
|
|
%endfor
|
|
|
|
## Make a combined kernel+initrd image for the iso
|
|
runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \
|
|
${outroot}/${BOOTDIR}/cdboot.img \
|
|
-r ${outroot}/${KERNELDIR}/initrd.img \
|
|
-p ${outroot}/${BOOTDIR}/cdboot.prm
|
|
|
|
## make boot.iso
|
|
runcmd mkisofs -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 \
|
|
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
|
${filegraft}
|
|
treeinfo images-${basearch} boot.iso images/boot.iso
|