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]
|
2017-03-09 19:08:19 +00:00
|
|
|
|
|
|
|
from os.path import basename
|
2011-05-09 14:47:25 +00:00
|
|
|
%>
|
|
|
|
|
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}
|
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
|
|
|
|
|
|
|
## 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
|
2015-04-29 14:35:41 +00:00
|
|
|
|
|
|
|
# Create optional product.img and updates.img
|
2017-03-09 19:08:19 +00:00
|
|
|
<% filegraft=""; images=["product", "updates"] %>
|
2015-04-29 14:35:41 +00:00
|
|
|
%for img in images:
|
|
|
|
%if exists("%s/%s/" % (LORAXDIR, img)):
|
|
|
|
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
2016-05-11 00:39:01 +00:00
|
|
|
treeinfo images-${basearch} ${img}.img images/${img}.img
|
2017-03-09 19:08:19 +00:00
|
|
|
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
|
2015-04-29 14:35:41 +00:00
|
|
|
%endif
|
|
|
|
%endfor
|
|
|
|
|
|
|
|
# Inherit iso-graft/ if it exists from external templates
|
|
|
|
<%
|
|
|
|
import os
|
|
|
|
if os.path.exists(workdir + "/iso-graft"):
|
2017-03-09 19:08:19 +00:00
|
|
|
filegraft += " " + workdir + "/iso-graft"
|
2015-04-29 14:35:41 +00:00
|
|
|
%>
|
2017-03-09 19:08:19 +00:00
|
|
|
|
|
|
|
# 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
|