2012-02-07 09:55:03 +00:00
|
|
|
<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/>
|
2011-05-09 14:47:25 +00:00
|
|
|
<%
|
2011-10-21 20:12:12 +00:00
|
|
|
configdir="tmp/config_files/s390"
|
2011-05-09 14:47:25 +00:00
|
|
|
BOOTDIR="images"
|
|
|
|
KERNELDIR=BOOTDIR
|
|
|
|
INITRD_ADDRESS="0x02000000"
|
2015-04-29 14:35:41 +00:00
|
|
|
LORAXDIR="usr/share/lorax/"
|
2011-05-09 14:47:25 +00:00
|
|
|
# The assumption seems to be that there is only one s390 kernel, ever
|
|
|
|
kernel = kernels[0]
|
|
|
|
%>
|
|
|
|
|
2011-06-23 00:22:24 +00:00
|
|
|
mkdir images
|
2011-06-23 14:46:28 +00:00
|
|
|
install ${runtime_img} images
|
2012-02-09 15:59:15 +00:00
|
|
|
treeinfo stage2 mainimage images/${runtime_base}
|
2011-06-23 00:22:24 +00:00
|
|
|
|
2011-10-21 20:12:12 +00:00
|
|
|
## install bootloader (such as it is) and bootloader config
|
2011-08-09 00:35:35 +00:00
|
|
|
install ${configdir}/redhat.exec ${BOOTDIR}
|
|
|
|
install ${configdir}/generic.prm ${BOOTDIR}
|
2014-08-21 07:53:14 +00:00
|
|
|
install ${configdir}/genericdvd.prm ${BOOTDIR}
|
2017-08-09 18:44:54 +00:00
|
|
|
install ${configdir}/cdboot.prm ${BOOTDIR}
|
2011-08-09 00:35:35 +00:00
|
|
|
install ${configdir}/generic.ins .
|
2011-05-09 14:47:25 +00:00
|
|
|
|
2011-10-21 20:12:12 +00:00
|
|
|
## configure bootloader
|
2011-05-09 14:47:25 +00:00
|
|
|
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
|
|
|
|
|
2011-10-21 20:12:12 +00:00
|
|
|
## install kernel
|
2011-05-09 14:47:25 +00:00
|
|
|
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
|
|
|
|
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
2011-10-21 20:12:12 +00:00
|
|
|
|
2012-12-19 07:53:08 +00:00
|
|
|
%if doupgrade:
|
2012-12-18 14:08:15 +00:00
|
|
|
## upgrader image
|
|
|
|
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
|
|
|
|
%endif
|
2012-11-13 06:33:17 +00:00
|
|
|
|
2011-10-21 20:12:12 +00:00
|
|
|
## s390 needs some extra boot config
|
2012-02-07 17:46:30 +00:00
|
|
|
createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize
|
2011-10-21 20:12:12 +00:00
|
|
|
|
|
|
|
## s390 also has some special treeinfo data
|
2012-02-07 17:46:30 +00:00
|
|
|
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
|
2011-05-09 14:47:25 +00:00
|
|
|
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
|
2014-08-21 07:53:14 +00:00
|
|
|
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
|
2011-05-09 14:47:25 +00:00
|
|
|
treeinfo images-${basearch} generic.ins generic.ins
|
2018-06-21 15:24:31 +00:00
|
|
|
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
|
2015-04-29 14:35:41 +00:00
|
|
|
|
2017-09-29 16:31:34 +00:00
|
|
|
# Create optional product.img and updates.img in /images/
|
2015-04-29 14:35:41 +00:00
|
|
|
<% imggraft=""; images=["product", "updates"] %>
|
|
|
|
%for img in images:
|
|
|
|
%if exists("%s/%s/" % (LORAXDIR, img)):
|
|
|
|
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
|
|
|
%endif
|
|
|
|
%endfor
|
|
|
|
|
|
|
|
# Inherit iso-graft/ if it exists from external templates
|
|
|
|
<%
|
|
|
|
import os
|
|
|
|
if os.path.exists(workdir + "/iso-graft"):
|
|
|
|
imggraft += " " + workdir + "/iso-graft"
|
|
|
|
%>
|
2017-08-09 18:44:54 +00:00
|
|
|
|
|
|
|
## Make a combined kernel+initrd image for the iso
|
|
|
|
runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \
|
|
|
|
-r ${outroot}/${KERNELDIR}/initrd.img \
|
|
|
|
-p ${outroot}/${BOOTDIR}/cdboot.prm \
|
|
|
|
-o ${outroot}/${BOOTDIR}/cdboot.img
|
|
|
|
|
|
|
|
## make boot.iso
|
|
|
|
runcmd mkisofs -o ${outroot}/images/boot.iso \
|
|
|
|
-b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \
|
2017-08-18 17:19:28 +00:00
|
|
|
-boot-load-size 4 -no-emul-boot \
|
2017-08-09 18:44:54 +00:00
|
|
|
-R -J -V '${isolabel}' -T -graft-points \
|
|
|
|
${BOOTDIR}=${outroot}/${BOOTDIR} \
|
|
|
|
${imggraft}
|
|
|
|
treeinfo images-${basearch} boot.iso images/boot.iso
|