2012-06-21 07:31:58 +00:00
|
|
|
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/>
|
|
|
|
<%
|
|
|
|
configdir="tmp/config_files/uboot"
|
|
|
|
PXEBOOTDIR="images/pxeboot"
|
2013-10-14 22:55:06 +00:00
|
|
|
DTBDIR="images/pxeboot/dtb"
|
2012-06-21 07:31:58 +00:00
|
|
|
BOOTDIR="boot"
|
|
|
|
KERNELDIR=PXEBOOTDIR
|
2015-02-27 20:00:44 +00:00
|
|
|
STAGE2IMG="images/install.img"
|
2014-11-06 17:16:49 +00:00
|
|
|
LORAXDIR="usr/share/lorax/"
|
2012-06-21 07:31:58 +00:00
|
|
|
|
2013-01-26 01:35:24 +00:00
|
|
|
# keep a comma-delimited list of platforms installed to add to .treeinfo
|
|
|
|
platforms = ""
|
|
|
|
delimiter = ''
|
2017-05-31 15:32:34 +00:00
|
|
|
|
|
|
|
from os.path import basename
|
2012-06-21 07:31:58 +00:00
|
|
|
%>
|
|
|
|
|
2015-02-27 20:00:44 +00:00
|
|
|
mkdir images
|
|
|
|
install ${runtime_img} ${STAGE2IMG}
|
|
|
|
treeinfo stage2 mainimage ${STAGE2IMG}
|
2012-06-21 07:31:58 +00:00
|
|
|
|
2013-10-14 22:55:06 +00:00
|
|
|
mkdir ${DTBDIR}
|
|
|
|
install boot/dtb-*/*dtb ${DTBDIR}/
|
|
|
|
|
2012-06-21 07:31:58 +00:00
|
|
|
## install kernels
|
|
|
|
mkdir ${KERNELDIR}
|
|
|
|
%for kernel in kernels:
|
|
|
|
%if kernel.flavor:
|
|
|
|
installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
|
|
|
|
installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
|
2013-01-26 01:35:24 +00:00
|
|
|
<%
|
|
|
|
platforms = platforms + delimiter + kernel.flavor
|
|
|
|
delimiter = ','
|
|
|
|
%>
|
2012-06-21 07:31:58 +00:00
|
|
|
%else:
|
|
|
|
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
|
|
|
|
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
|
|
|
%endif
|
|
|
|
%endfor
|
|
|
|
|
2013-01-26 01:35:24 +00:00
|
|
|
# add platform to treeinfo for Beaker support
|
|
|
|
treeinfo ${basearch} platforms ${platforms}
|
|
|
|
|
2014-11-06 17:16:49 +00:00
|
|
|
# Create optional product.img and updates.img
|
|
|
|
<% images=["product", "updates"] %>
|
|
|
|
%for img in images:
|
|
|
|
%if exists("%s/%s/" % (LORAXDIR, img)):
|
2016-03-24 16:33:37 +00:00
|
|
|
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
|
2016-05-11 00:39:01 +00:00
|
|
|
treeinfo images-${basearch} ${img}.img images/${img}.img
|
2014-11-06 17:16:49 +00:00
|
|
|
%endif
|
|
|
|
%endfor
|
2012-06-21 07:31:58 +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}
|
|
|
|
%endfor
|
|
|
|
|
2012-06-21 07:31:58 +00:00
|
|
|
## FIXME: ARM may need some extra boot config
|